Welcome to my blog

I mainly post about data analysis and applied statistics stuff, usually in R. Frequent topics include Bayesian statistics, multilevel models, and statistical power.

Written by A. Solomon Kurz

Conditional logistic models with brms: Rough draft.

After tremendous help from Henrik Singmann and Mattan Ben-Shachar, I finally have two (!) workflows for conditional logistic models with brms. These workflows are on track to make it into the next update of my ebook translation of Kruschke’s text. But these models are new to me and I’m not entirely confident I’ve walked them out properly. The goal of this blog post is to present a draft of my workflow, which will eventually make it’s way into Chapter 22 of the ebook.

By A. Solomon Kurz

November 17, 2021

If you fit a model with multiply imputed data, you can still plot the line.

If you’re an R user and like multiple imputation for missing data, you probably know all about the mice package. The bummer is there are no built-in ways to plot the fitted lines from models fit from multiply-imputed data using van Buuren’s mice-oriented workflow. However, there is a way to plot your fitted lines by hand and in this blog post I’ll show you how.

By A. Solomon Kurz

October 21, 2021

Sexy up your logistic regression model with logit dotplots

The major shortcoming in typical logistic regression line plots is they usually don’t show the data due to overplottong across the y-axis. Happily, new developments with Matthew Kay’s ggdist package make it easy to show your data when you plot your logistic regression curves. In this post I’ll show you how.

By A. Solomon Kurz

September 22, 2021

One-step Bayesian imputation when you have dropout in your RCT

Say you have 2-timepoint RCT, where participants received either treatment or control. Even in the best of scenarios, you’ll probably have some dropout in those post-treatment data. To get the full benefit of your data, you can use one-step Bayesian imputation when you compute your effect sizes. In this post, I’ll show you how.

By A. Solomon Kurz

July 27, 2021

Got overdispersion? Try observation-level random effects with the Poisson-lognormal mixture

It turns out that you can use random effects on cross-sectional count data. Yes, that’s right. Each count gets its own random effect. Some people call this observation-level random effects and it can be a tricky way to handle overdispersion. The purpose of this post is to show how to do this and to try to make sense of what it even means.

By A. Solomon Kurz

July 12, 2021

Example power analysis report

If you plan to analyze your data with anything more complicated than a t-test, the power analysis phase gets tricky. I’m willing to bet that most applied researchers have never done a power analysis for a multilevel model and probably have never seen what one might look like, either. The purpose of this post is to give a real-world example of just such an analysis.

By A. Solomon Kurz

July 2, 2021

Make ICC plots for your brms IRT models

The purpose of this blog post is to show how one might make ICC and IIC plots for brms IRT models using general-purpose data wrangling steps.

By A. Solomon Kurz

June 29, 2021

Don’t forget your inits

When your MCMC chains look a mess, you might have to manually set your initial values. If you’re a fancy pants, you can use a custom function.

By A. Solomon Kurz

June 5, 2021

Yes, you can fit an exploratory factor analysis with lavaan

Just this past week, I learned that, Yes, you can fit an exploratory factor analysis (EFA) with lavaan. The purpose of this blog post is to make EFAs with lavaan even more accessible and web searchable by walking through a quick example.

By A. Solomon Kurz

May 11, 2021