and especially to those who can help.
I'm trying to run a mixed model ANOVA on an imputed data set (MICE) after dealing with missing data. I have managed to run the MICE analysis and generate 5 complete data sets. I am looking to get a pooled estimate on a time x group interaction.
My data set looks like this after running the following code:
library(mice)
missdata2 <- mice(x, seed = 393939)
summary(missdata2)
nomiss = complete(missdata2, 1)
SS-d1, SS-d7, SS-d14, A-d1, A-d7, A-d14, ER-d1, ER-d7, ER-d14, Group
Above is the variables in my data set
I then ran the following code to save all 5 imputed data sets in my files
implist <- mids2mplus(missdata2)
This created the following in my files
imp1
imp2
imp3
imp4
imp5
I need to fit an anova model to these imputed data sets (implist) that gives me the pooled estimate for the time by group interaction f statistics. There are three-time points D1 (day 1) D7 (day 7) and D14 (day 14) measured across three constructs of SS, A and ER as labelled in the data set and a group variable that contains three groups labels 1, 2 and 4. Ultimately I'm looking to obtain the pooled Time by group interaction for each of the following - SS, A, and ER.
For the first interaction, I tried several things that led to this, but this does not work either:
library(lme4) # package needed to run MIXED ANOVA
fit3 <- with(implist, lmer(SS_D1, SS_D7, SS_D14 + GROUP))
testEstimates(fit3, var.comp = TRUE)
#Errors
`fit3 <- with(implist, lmer(SS_D1, SS_D7, SS_D14 + GROUP))
Error in as.formula(formula) : object 'SS_D1' not found
> testEstimates(fit3, var.comp = TRUE)
Error in testEstimates(fit3, var.comp = TRUE) :
could not find function "testEstimates"`
When I run
head (implist)
it comes back as null which may indicate why it can't find the SS_D1 variables etc.
I am new to r and have jumped straight in the deep end, so please be gentle with me :).
Thanks to anyone who will give this a go.