R and SAS code to fit a mixed-effects model instead of two-way ANOVA with repeated measures in both factors
Prism 8 introduces fitting a mixed-effects model to allow, essentially, repeated measures ANOVA with missing values. We provide R and SAS code to show your statistical consultants, so they can understand what Prism is doing. This example is for two-way ANOVA with repeated measures in both factors. Another FAQs covers one-way repeated measures ANOVA.
Download the Prism file (ANOVA2.RM_Maxwell_Delaney_12_1.prism)
Download the data file used by R and SAS (anova2.rm.maxwell_12.1.csv)
SAS Code
PROC IMPORT DATAFILE=REFFILE
DBMS=CSV
OUT=gsData;
GETNAMES=YES;
RUN;
CLASS A B S;
MODEL Y = A B A*B;
RANDOM Int A B / SUBJECT=S;
RUN;
R code
fit <- aov(Y ~ A * B + Error(S / (A * B)), data = noiseData)
summary(fit)