0

am trying to perform a linear mixed model via R. I have a SAS code existing and I am trying to translate it in R.

Here is my data: 2 groups products: treated, témoin 5 times: T0, T1, T2, T4 et T6 vol (Subjets) = 12 Subjets 1 response : y

Here is my SAS code:

proc mixed data =toto method= ML;
              class = traitement temps vol ;
              model  y= traitement temps traitement*temps /ddfm=kr outp=residuals;
              repeated traitement*temps / subject =vol type=ar(1) group=traitement*temps;

              lsmeans traitement*temps / pdiff= all cl;
run;

and here is my R code:

mod<-nlme::lme(y ~ temps*traitement,
         data=data,
         random = ~ traitement | id,
         correlation =corCAR1(form = ~ temps | id/traitement),
         method="ML" ,contrasts=list(traitement="contr.sum" ))

  ls.m<-lsmeans(mod,list(pairwise ~ temps|traitement, 
                             pairwise ~ traitement|temps))  


      summary(glht(mod, linfct=mcp(traitement="Dunnett")))
     contrastes<- pairs(ls.m)

AIC and BIC are differents: and my R model is differents, no same p-values ...

Have you any ideas ?

Many thanks !!

Roman Luštrik
  • 69,533
  • 24
  • 154
  • 197
Maïna Kerbrat
  • 326
  • 2
  • 3
  • 10

0 Answers0