# Embedding subplots in ggplot2 graphics

I first learned about embedding many small subplots into a larger plot as a way to visualize large datasets with package ggsubplot. Embedding subplots is still possible in ggplot2 today with the annotation_custom() function. I demonstrate one approach to do this, making many subplots in a loop and then adding them to the larger plot.

# Lots of zeros or too many zeros?: Thinking about zero inflation in count data

When working with counts, having many zeros does not necessarily indicate zero inflation. I demonstrate this by simulating data from the negative binomial and generalized Poisson distributions. I then show one way to check if the data has excess zeros compared to the number of zeros expected based on the model.

# The log-0 problem: analysis strategies and options for choosing c in log(y + c)

Analyzing positive data with 0 values can be challenging, since a direct log transformation isn't possible. I discuss some of the things to consider when deciding on an analysis strategy for such data and then explore the effect of the value of the constant, c, when using log(y + c) as the response variable.

# Automating exploratory plots with ggplot2 and purrr

In this post I show an example of how to automate the process of making many exploratory plots in ggplot2 with multiple continuous response and explanatory variables. To loop through both x and y variables involves nested looping. In the latter section of the post I go over options for saving the resulting plots, either together in a single document, separately, or by creating combined plots prior to saving.

# Time after time: calculating the autocorrelation function for uneven or grouped time series

Checking for autocorrelation must be done carefully when some observations are missing from a time series or the time series is measured for independent groups. I show an approach where I pad the dataset with NA via tidyr::complete() to fill in any missed sampling times and make sure groups are considered independent prior to calculating the autocorrelation function.

# Unstandardizing coefficients from a GLMM

Unstandardizing coefficients in order to interpret them on the original scale can be needed when explanatory variables were standardized to help with model convergence when fitting generalized linear mixed models. Here I show one approach to unstandardizing for a generalized linear mixed model fit with lme4.