# Blog Archives

## The five element ninjas approach to teaching design matrices

April 25, 2016
By

Design matrices unite seemingly disparate statistical methods, including linear regression, ANOVA, multiple regression, ANCOVA, and generalized linear modeling. As part of a hierarchical Bayesian modeling course that we offered this semester, we wanted our students to learn about design matrices to facilitate model specification and parameter interpretation. Naively, I thought that I could spend a few minutes in class reviewing matrix...

## Maungawhau with a Gaussian process

October 22, 2015
By

The Maungawhau volcano dataset is an R classic, often used to illustrate 3d plotting. Being on a Gaussian process kick lately, it seemed fun to try to interpolate the volcano elevation data using a subset of the full dataset as training data. Even with...

## First year books

September 7, 2015
By

I had to read a lot of books in graduate school. Some were life-changing, and others were forgettable. If I could bring a reading list back in time for my ‘first year’ graduate self, it would include the following: Bayesian Data Analysis Third Edition, by Andrew Gelman, John B. Carlin, Hal S. Stern, David B. Dunson, Aki Vehtari, and Donald B. Rubin

## The IQUIT R video series

August 28, 2015
By

I’ve uploaded 20+ R tutorials to YouTube for a new undergraduate course in Ecology and Evolutionary Biology at CU developed by Andrew Martin and Brett Melbourne, which in jocular anticipation was named IQUIT: an introduction to quantitative inference and thinking. We made the videos to address the most common R programming problems that arose for students in the...

## Plotting spatial neighbors in ggmap

June 15, 2015
By

The R package spdep has great utilities to define spatial neighbors (e.g. dnearneigh, knearneigh, with a nice vignette to boot), but the plotting functionality is aimed at base graphics. If you’re hoping to plot spatial neighborhoods as line segments in ggplot2, or ggmap, you’ll need the neighborhood data to be stored in a data frame. So, to...

## Why I think twice before editing plots in Powerpoint, Illustrator, Inkscape, etc.

February 26, 2015
By

Thanks to a nice post by Meghan Duffy on the Dynamic Ecology blog (How do you make figures?), we have some empirical evidence that many figures made in R by ecologists are secondarily edited in other programs including MS Powerpoint, Adobe Illustrator, Inkscape, and Photoshop. This may not be advisable* for two reasons: reproducibility and bonus learning. Reproducibility R...

## Why I think twice before editing plots in Powerpoint, Illustrator, Inkscape, etc.

February 26, 2015
By

Thanks to a nice post by Meghan Duffy on the Dynamic Ecology blog (How do you make figures?), we have some empirical evidence that many figures made in R by ecologists are secondarily edited in other programs including MS Powerpoint, Adobe Illustrator, Inkscape, and Photoshop. This may not be advisable* for two reasons: reproducibility and bonus learning. Reproducibility R is nice...

## Visualizing bivariate shrinkage

January 20, 2015
By

Inspired by this post about visualizing shrinkage on Coppelia, and this thread about visualizing mixed models on Stack Exchange, I started thinking about how to visualize shrinkage in more than one dimension. One might find themselves in this situation with a varying slope, varying intercept hierarichical (mixed effects) model, a model with two varying intercepts, etc. Then...

## Visualizing bivariate shrinkage

January 20, 2015
By

Inspired by this post about visualizing shrinkage on Coppelia, and this thread about visualizing mixed models on Stack Exchange, I started thinking about how to visualize shrinkage in more than one dimension. One might find themselves in this situation with a varying slope, varying intercept hierarichical (mixed effects) model, a model with two varying intercepts, etc. Then...

## Notes on shrinkage & prediction in hierarchical models

December 13, 2014
By

Ecologists increasingly use mixed effects models, where some intercepts or slopes are fixed, and others are random (or varying). Often, confusion exists around whether and when to use fixed vs. random intercepts/slopes, which is understandable given their multiple definitions. In an attempt to help clarify the utility of varying intercept models (and more generally, hierarchical modeling), specifically in...