-----Oorspronkelijk bericht-----
Van: r-sig-mixed-models-bounces at r-project.org
[mailto:r-sig-mixed-models-bounces at r-project.org] Namens Iker
Vaquero Alba
Verzonden: woensdag 23 februari 2011 15:30
Aan: Daniel; Douglas Bates
CC: R-sig-mixed-models at r-project.org
Onderwerp: Re: [R-sig-ME] Difference lme4 and nlme
?
?? Just a technical question: Would "(1|PARTY) + (1|J:PARTY)"
be equal to "(1|J/PARTY)" and this to "(J|PARTY)"?
?? I've tried the last two ones and as long as I saw, I got
the same results, but I might have overlooked something.
?? Thank you. Regards.
?? Iker
--- El mi?, 23/2/11, Douglas Bates <bates at stat.wisc.edu> escribi?:
De: Douglas Bates <bates at stat.wisc.edu>
Asunto: Re: [R-sig-ME] Difference lme4 and nlme
Para: "Daniel" <dmsilv at gmail.com>
CC: R-sig-mixed-models at r-project.org
Fecha: mi?rcoles, 23 de febrero, 2011 15:08
Notice that the first model has 27 levels for J and the
second model has 465 levels for PARTY %in% J.? That's the difference.
If you do indeed want to have PARTY nested within J then your
call to lmer should use the formula
REVENUES ~ INCUMBENCY + (1|PARTY) + (1|J:PARTY)
On Wed, Feb 23, 2011 at 6:27 AM, Daniel <dmsilv at gmail.com> wrote:
Hello list,
I'm just try to find out how can I produce the results
Perhaps I'm using different equation. Trailer model are
Stata output using (tmixed REVENUES INCUMBENCY || J: || PARTY:)
lme2 <-
lmer(REVENUES~INCUMBENCY+(1|J)+(1|PARTY),data=data,na.action =
"na.omit", REML=TRUE)
Linear mixed model fit by REML
Formula: REVENUES ~ INCUMBENCY + (1 | J) + (1 | PARTY)
?Data: data
?AIC ? BIC logLik deviance REMLdev
78123 78153 -39057 ? ?78154 ? 78113
Random effects:
Groups ? Name ? ? ? ?Variance ? Std.Dev.
J ? ? ? ?(Intercept) 9.6263e+08 ?31026 PARTY ? ?(Intercept)
41836 Residual ? ? ? ? ? ? 3.0534e+10 174741 Number of obs: 2894,
groups: J, 27; PARTY, 27
Fixed effects:
? ? ? ? ? Estimate Std. Error t value
(Intercept) ? ?34244 ? ? ?11657 ? 2.938 INCUMBENCY ? ?211495 ? ? ?
9536 ?22.178
Correlation of Fixed Effects:
? ? ? ? ?(Intr)
INCUMBENCY -0.097
lme3 <- lme(REVENUES~INCUMBENCY, random=~1
|J/PARTY,data=data,na.action = "na.omit", REML=TRUE)
Linear mixed-effects model fit by REML
?Data: data
?Log-restricted-likelihood: -39078.07
?Fixed: REVENUES ~ INCUMBENCY
(Intercept) ?INCUMBENCY
? 52469.19 ? 220521.74
Random effects:
?Formula: ~1 | J
? ? ? ?(Intercept)
StdDev: ? ?25424.31
?Formula: ~1 | PARTY %in% J
? ? ? ?(Intercept) Residual
StdDev: ? ? 45574.5 173465.7
Number of Observations: 2894
Number of Groups:
? ? ? ? ? J PARTY %in% J
? ? ? ? ?27 ? ? ? ? ?465
--
Daniel Marcelino
Skype: dmsilv
http://sites.google.com/
? ? ? ?[[alternative HTML version deleted]]