Skip to content

mixed model fitting between R and SAS

2 messages · ONKELINX, Thierry, array chip

#
John,

Please keep sending the mails to the mixed models list which is more appropriate than R-help.

Both models have a different interpretation.
the nested model is indeed
y_ijk=fixed_effect + b_i + b_ij + e_ijk
the the one with the random slopes is rather
y_ijk=fixed_effect + b_1i + b_2i + e_ijk
with b_1i the effect of location 1 for pid i and b_2i the effect of location 2 for pid i.
The fits will be mathematically equal, but the parametrisation is different.

Best regards,

Thierry
#
Dear Thierry,

Thanks very much again for your input! Pardon me that I still got 2 questions:

First regarding the argument "correlation=corAR1()", how does model correctly know the grouping structure to apply this particular correlation structure appropriately to observations?

With nested model specification (random=~1|pid/biopsy.site), I understand it's straightforward to figure out that it applies to the 2 time points within the same biopsy.site within the same subject.

But with random slope model specification (e.g. random=list(pid=pdIdent(~0? + biopsy.site))), how does the model figure out what observations it applies the correlation structure to? The random term only indicates that "pid' is the grouping variable, will it also add in the random slope variable as one of the grouping variable as well?

Also the "time" variable in the data is a factor, not a continuous variable, so I can't use corAR1(~time) syntax, just use corAR1() is ok?

The second question is when you say the 2 models are mathematically equal but different parameterisation, which particular pdClasses structure are you referring to, pdIdent()?

Actually, I tried all of pdClasses, but got different results by comparing fixed effect estimates:
?? (Intercept)??????????? age????? timeDAY 8?????????? trtB?????????? trtC 
?-0.0664413311?? 0.0001562844?? 0.1041869499? -0.0198187975?? 0.2225816296 
????????? trtD timeDAY 8:trtB timeDAY 8:trtC timeDAY 8:trtD 
? 0.0600800217? -0.0691869499? -0.2417960052? -0.0906501595
?? (Intercept)??????????? age????? timeDAY 8?????????? trtB?????????? trtC 
?-7.329312e-02?? 3.404107e-05?? 1.356288e-01?? 2.397692e-02?? 2.435217e-01 
????????? trtD timeDAY 8:trtB timeDAY 8:trtC timeDAY 8:trtD 
? 6.953377e-02? -1.057646e-01? -2.983250e-01? -1.256355e-01
?? (Intercept)??????????? age????? timeDAY 8?????????? trtB?????????? trtC 
?-7.370652e-02?? 2.550198e-05?? 1.371592e-01?? 2.763169e-02?? 2.446715e-01 
????????? trtD timeDAY 8:trtB timeDAY 8:trtC timeDAY 8:trtD 
? 7.000318e-02? -1.075655e-01? -3.009948e-01? -1.271838e-01
?? (Intercept)??????????? age????? timeDAY 8?????????? trtB?????????? trtC 
?-0.0855931906?? 0.0002516472?? 0.1364347017?? 0.0105537241?? 0.2457796991 
????????? trtD timeDAY 8:trtB timeDAY 8:trtC timeDAY 8:trtD 
? 0.0709443633? -0.1120889667? -0.3029470038? -0.1273406900
?? (Intercept)??????????? age????? timeDAY 8?????????? trtB?????????? trtC 
?-0.0854646844?? 0.0002610673?? 0.1351021118?? 0.0067663008?? 0.2451183499 
????????? trtD timeDAY 8:trtB timeDAY 8:trtC timeDAY 8:trtD 
? 0.0707007033? -0.1102181249? -0.3006730214? -0.1259701144

Greatly appreciated!

John





----- Original Message -----
From: "ONKELINX, Thierry" <Thierry.ONKELINX at inbo.be>
To: array chip <arrayprofile at yahoo.com>; "R-SIG-Mixed-Models at r-project.org" <R-SIG-Mixed-Models at r-project.org>
Cc: 
Sent: Tuesday, August 9, 2011 3:20 AM
Subject: RE: [R] mixed model fitting between R and SAS

John,

Please keep sending the mails to the mixed models list which is more appropriate than R-help.

Both models have a different interpretation.
the nested model is indeed
y_ijk=fixed_effect + b_i + b_ij + e_ijk
the the one with the random slopes is rather
y_ijk=fixed_effect + b_1i + b_2i + e_ijk
with b_1i the effect of location 1 for pid i and b_2i the effect of location 2 for pid i.
The fits will be mathematically equal, but the parametrisation is different.

Best regards,

Thierry