Dear R help group,  I am teaching myself linear mixed models with missing data 
since I would like to analyze a stats design with these kind of models. The 
textbook example is for the procedure "proc MIXED" in SAS, but I would like to 
know if there is an equivalent in R.  This example only includes two 
time-measurements across subjects (a t-test "with missing values"), but I will 
need to to this with three time-measurements (repeated measures ANOVA with 
missing values):

Patient     Treatment
                 A      B


1               20     12
2               26     24
3               16     17
4               29     21
5               22     N/A
6               N/A  12

I have tried this analysis using using the instructions below with the help of 
"Mixed-Effects Models in S and S-Plus", but have not been able to go around the 
missing data issue as follows:

tmtA <- c(20,26, 16,29,22,NA)
tmtB <- c(12,24,17,21,NA,17)
require(lme4)
dv <- c(20,12,26,24,16,17,29,21,22,17)
subject <- rep(c("s1","s2","s3","s4","s5","s6"),each=2)
subject <- subject[-c(10,11)]
myfactor <- rep(c("f1","f2"), 6)
myfactor <- myfactor[-c(10,11)]
mydata <- data.frame(dv, subject, myfactor)
am2 <- lmer(dv ~ myfactor + (1|subject)), data = mydata)
summary(am2)
anova(am2)
subject <- subject[-c(10,11)]


Any help would be greatly appreciated.  Thank you,

Rafael Diaz
Assistant Professor
Math and Stats Dept
California State University Sacramento



      
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to