Linear Mixed Model Sample Size Calculations

I have created a Shiny app to calculate the required sample size for a two-group linear mixed model.

It uses the power.mmrm function from the longpower package (see Lu, Luo, & Chen, 2008, for more information).

The input is simplified, whereby users are limited to five time-points, the correlation matrix is a compound symmetry correlation structure that is identical for both groups, and the attrition rate is assumed to be the same for both groups.

Shiny App

https://sammancuso.shinyapps.io/power/

Power Screenshot Continue reading “Linear Mixed Model Sample Size Calculations”

Moderation with a multicategorical moderating variable

UPDATE: Please see the following post for an all-in-one solution: RePROCESS Model 1

This post was was inspired by Nicholas Michalak’s Novum R-ganum blog posts on reproducing Hayes’ PROCESS Model 1 in R. He has two posts where he presents the R code for examining a continuous × continuous moderation and a dichotomous × continuous moderation.

However, a quick Google search suggests a paucity of information for conducting moderation analyses using a multicategorical moderating variables.

Therefore, this post will outline how to run the PROCESS Model 1 with a multicategorical moderator (M) in R. We will examine how to code the M variable,  simulate some data, run the PROCESS analyses in both SPSS and R, and compare the results from both software packages.

Continue reading “Moderation with a multicategorical moderating variable”