[R] fixed effects anova in lme lmer
s.blomberg1 at uq.edu.au
Wed Jun 6 04:23:43 CEST 2007
?gls in package nlme. It's like lme but with no random effects. But you
can still model the variance-covariance properties of the data.
On Tue, 2007-06-05 at 19:11 -0700, toby909 at gmail.com wrote:
> Can lme or lmer fit a plain regular fixed effects anova? Ie a model without a
> random effect, or have there be at least one random effect in order for these
> functions to work?
> Trying to run such, (1) without specifying a random effect produces an error,
> (2) specifying that there is no random effect does not produce the same output
> as an anova run in lm(); (2b) specifying that there is no random effect in lmer
> crashed R (division by zero, I think).
> Just trying to see the connection of fixed and random effects anova in R. STATA
> gives me same results for both models up to the point where they differ.
> Best Toby
> dt1 =
> summary(a1 <- lm(V1~factor(V2)-1, dt1))
> summary(a1 <- lm(V1~factor(V2), dt1))
> dt1$f = factor(dt1$V2)
> summary(a2 <- lme(V1~f, dt1)) #1a
> summary(a2 <- lme(V1~f, dt1, ~-1|f)) #2a
> lmer(V1~f, dt1) #1b
> lmer(V1~f+(-1|f), dt1) #2b
> R-help at stat.math.ethz.ch mailing list
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
Simon Blomberg, BSc (Hons), PhD, MAppStat.
Lecturer and Consultant Statistician
Faculty of Biological and Chemical Sciences
The University of Queensland
St. Lucia Queensland 4072
Room 320, Goddard Building (8)
T: +61 7 3365 2506
The combination of some data and an aching desire for
an answer does not ensure that a reasonable answer can
be extracted from a given body of data. - John Tukey.
More information about the R-help