[R] proc mixed vs. lme

Peter Dalgaard BSA p.dalgaard at biostat.ku.dk
Wed Oct 9 17:40:14 CEST 2002


Douglas Bates <bates at stat.wisc.edu> writes:

> "Grathwohl,Dominik,LAUSANNE,NRC/NT" <dominik.grathwohl at rdls.nestle.com> writes:
> 
> > Hallo Peter,
> > 
> > Thank you for the advice, now I have to update my table:
> > 
> >                             SAS                           R
> > random statement            random subj(program);         random = ~ 1 |
> > Subj
> > -2*loglik                   1420.8                        1420.820
> > random effects
> > variance(Intercept)         9.6033                        9.603331
> > variance(residual)          1.1969                        1.196873
> > the first 3 fixed effects
> > intercept                   83.0952                        83.09524
> > ProgramCont                -3.4952                       -3.49524
> > ProgramRI                  -1.9702                       -1.97024
> > ...                        ...                            ...
> > 
> > Everything looks nice. Perhaps Douglas could update the help file in
> > SASmixed, 
> > where I copied the misleading code!
> 
> Umm, my version of that help file has
> 
> \examples{
> options(
>   contrasts = c(unordered = "contr.SAS", ordered = "contr.poly"))
> data(Weights)
> fm1Weight <- lme( strength ~ Program * Time,
>                   data = Weights, random = ~ 1 | Subj)
> summary( fm1Weight )               # compare with output 3.1, p. 91
> VarCorr( fm1Weight )
> anova( fm1Weight )
> fm2Weight <- update( fm1Weight, random = ~ Time | Subj )
> anova( fm1Weight, fm2Weight )
> summary( fm2Weight )
> VarCorr( fm2Weight )
> intervals( fm2Weight )
> }
> 
> Notice the first line.

That's not the issue (and I believe it was in Dominik's code too).
Dominik's PROC MIXED code was using Time as a categorical variable,
whereas it is numeric in the Weights data frame. (whereas Program is
already a factor - I missed that). Of course the model ~Program*Time
is perfectly sensible even with Time as numeric, it's just not the
same model that Dominik was comparing with....

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list