Perfect. Thank you. It is good to know that we can specify the
equal to zero. Thanks.
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free.
<http://www.avg.com/email-signature?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Post by Ben Bolker(please keep r-sig-mixed-models in the Cc:)
I'm pretty sure that lmer and lm models are commensurate, in case that
helps. Here's an example rigged to make the random-effects variance
equal to zero, so we can check that the log-likelihoods etc. are identical.
set.seed(101)
dd <- data.frame(y=rnorm(20),x=rnorm(20),f=factor(rep(1:2,10)))
library(lme4)
m1 <- lmer(y~x+(1|f),data=dd,REML=FALSE) ## estimated sigma^2_f=0
m2 <- lm(y~x,data=dd)
all.equal(c(logLik(m1)),c(logLik(m2))) ## TRUE
all.equal(fixef(m1),coef(m2))
anova(m1,m2)
Thank you. Oh, was just trying to compare my random-effects model to the
one where my grouping variable (schools) is treated as fixed.
Peter
<http://www.avg.com/email-signature?utm_medium=email&
utm_source=link&utm_campaign=sig-email&utm_content=webmail>
Virus-free. www.avg.com
<http://www.avg.com/email-signature?utm_medium=email&
utm_source=link&utm_campaign=sig-email&utm_content=webmail>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
I'm not 100% sure I understand the question, but I think the
answer is
"no": lmer cannot fit a model that doesn't contain any random
effects.
Perhaps you can give more context as to why it won't work for you to
revert to lm() or plm() in these cases?
Post by Peter PaprzyckiThis is very basic, is there a way to specify in lmer function
that I would
Post by Peter Paprzyckilike to run my grouping variable as a fixed factor only, without
reverting
Post by Peter Paprzyckito lm or plm functions. If one does not specify a random variable,
one gets
Post by Peter Paprzyckithe error message with lmer function; something that is equivalent
to the
Post by Peter Paprzyckistatement, "index = "grouping variable", model = "within"" with
the plm
<http://www.avg.com/email-signature?utm_medium=email&
utm_source=link&utm_campaign=sig-email&utm_content=webmail
<http://www.avg.com/email-signature?utm_medium=email&
utm_source=link&utm_campaign=sig-email&utm_content=webmail>>
Post by Peter PaprzyckiVirus-free.
www.avg.com <http://www.avg.com>
<http://www.avg.com/email-signature?utm_medium=email&
utm_source=link&utm_campaign=sig-email&utm_content=webmail
<http://www.avg.com/email-signature?utm_medium=email&
utm_source=link&utm_campaign=sig-email&utm_content=webmail>>
Post by Peter Paprzycki<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
[[alternative HTML version deleted]]
_______________________________________________
https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
<https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models>
--
Peter Paprzycki, Ph.D.
Visiting Assistant Professor
Research Support Center Manager
Educational Research and Administration
College of Education and Psychology
The University of Southern Mississippi
USM Box 5093; 118 College Drive
Hattiesburg, Mississippi 39406-0001
tel. (601)-266-4708
Sidere mens eadum mutato
Peter Paprzycki, Ph.D.
tel. (601)-266-4708