Hi all,

I understand that gls() uses generalized least squares, but I thought
that maybe optimum weights from gls might be used as weights in lm (as
shown below), but apparently this is not the case. See:

library(nlme)
f1 <- gls(Petal.Width ~ Species / Petal.Length, data = iris,  weights
= varIdent(form = ~ 1 | Species))
aa <- attributes(summary(f1)$modelStruct$varStruct)$weights
f2 <- lm(Petal.Width ~ Species / Petal.Length, data = iris, weights = aa)

summary(f1)$tTable; summary(f2)

So, the two models with the very same weights do differ (in terms of
standard errors). Could you please explain why? Are these different
types of weights?

Many thanks in advance,
Stats Wolf

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to