Blog Archives

Multilevel modeling of community composition with imperfect detection

June 19, 2014
By
Multilevel modeling of community composition with imperfect detection

This is a guest post generously provided by Joe Mihaljevic. A common goal of community ecology is to understand how and why species composition shifts across space. Common techniques to determine which environmental covariates might lead to such shifts typically rely on ordination of community data to reduce the amount of data. These techniques include redundancy analysis (RDA), canonical...

Read more »

Shiny variance inflation factor sandbox

April 30, 2014
By

In multiple regression, strong correlation among covariates increases the uncertainty or variance in estimated regression coefficients. Variance inflation factors (VIFs) are one tool that has been used as an indicator of problematic covariate collinearity. In teaching students about VIFs, it may be useful to have some interactive supplementary material so that they can manipulate factors affecting the uncertainty in...

Read more »

Stochastic search variable selection in JAGS

March 22, 2014
By
Stochastic search variable selection in JAGS

Stochastic search variable selection (SSVS) identifies promising subsets of multiple regression covariates via Gibbs sampling (George and McCulloch 1993). Here’s a short SSVS demo with JAGS and R. Assume we have a multiple regression problem: We suspect only a subset of the elements of $\boldsymbol{\beta}$ are non-zero, i.e. some of the covariates have no effect. Assume $\boldsymbol{\beta}$...

Read more »

Better living through zero-one inflated beta regression

February 6, 2014
By
Better living through zero-one inflated beta regression

Dealing with proportion data on the interval $$ is tricky. I realized this while trying to explain variation in vegetation cover. Unfortunately this is a true proportion, and can’t be made into a binary response. Further, true 0’s and 1’s rule out beta regression. You could arcsine square root transform the data (but shouldn’t; Warton and Hui 2011)....

Read more »

Errors-in-variables models in stan

November 27, 2013
By
Errors-in-variables models in stan

In a previous post, I gave a cursory overview of how prior information about covariate measurement error can reduce bias in linear regression. In the comments, Rasmus Bååth asked about estimation in the absence of strong priors. Here, I’ll describe a Bayesian approach for estimation and correction for covariate measurement error using a latent-variable based errors-in-variables...

Read more »

R and my divorce from Word

October 30, 2013
By
R and my divorce from Word

Being in grad school, I do a lot of scholarly writing that requires associated or embedded R analyses, figures, and tables, plus bibliographies. Microsoft Word makes this unnecessarily difficult. Many tools are now available to break free from the tyranny of Word. The ones I like involve writing an article in markdown format, integrating all data preparation,...

Read more »

How heavy is the Siberut macaque? A Bayesian phylogenetic approach

September 30, 2013
By
How heavy is the Siberut macaque? A Bayesian phylogenetic approach

Among-species comparisons can include phylogenetic information to account for non-independence arising from shared evolutionary history. Often, phylogenetic topologies and branch lengths are not known exactly, but are estimated with uncertainty. This uncertainty can be accounted for using methods recently described in a neat paper called Bayesian models for comparative analysis integrating phylogenetic uncertainty by Villemereuil et...

Read more »

Animating the Metropolis algorithm

September 8, 2013
By
Animating the Metropolis algorithm

The Metropolis algorithm, and its generalization (Metropolis-Hastings algorithm) provide elegant methods for obtaining sequences of random samples from complex probability distributions. When I first read about modern MCMC methods, I had trouble visualizing the convergence of Markov chains in higher dimensional cases. So, I thought I might put together a visualization in a two-dimensional case. I’ll use...

Read more »

Quantifying uncertainty around R-squared for generalized linear mixed models

August 22, 2013
By
Quantifying uncertainty around R-squared for generalized linear mixed models

People love $R^2$. As such, when Nakagawa and Schielzeth published an article in the journal Methods in Ecology and Evolution earlier this year, ecologists (amid increasing use of generalized linear mixed models (GLMMs)) rejoiced. Now there’s an R function that automates $R^2$ calculations for GLMMs fit with the lme4 package. $R^2$ is usually reported as a...

Read more »

Clarifying vague interactions

August 18, 2013
By
Clarifying vague interactions

For some reason, authors occasionally present linear model results with vague or unintelligible interaction effects. One way to be vague when presenting interaction effects is to provide only a table of model coefficients, including no information on the range of covariate values observed, and no plots to aid in interpretation. Here’s an example: Suppose you have discovered a statistically significant...

Read more »