[R] understanding the output
Peter Dalgaard BSA
p.dalgaard at biostat.ku.dk
Thu Jun 20 14:11:20 CEST 2002
"Ronaldo Reis Jr." <chrysopa at insecta.ufv.br> writes:
> Estimate Std. Error t value Pr(>|t|)
> (Intercept) 4.8660 0.9808 4.961 0.000101 ***
> gen2g 3.8504 1.3870 2.776 0.012459 *
> ---
...
> > tapply(peso,gen,mean)
> 1g 2g
> 4.8660 8.7164
>
> The values is the same in estimate.
> But the SE, when I try using tapply the SE is different os the SE of
> estimates. look
>
> > tapply(peso,gen,sd)/sqrt(tapply(peso,gen,length))
> 1g 2g
> 0.8665567 1.0829789
>
> Why this difference? What SE I can use with mean???
(I assume you are only looking at the intercept, i.e. the mean of
group "1g"). glm() assumes a constant SD and uses the pooled SD.
Try for illustration:
sds <- tapply(peso,gen,sd)
lens <- tapply(peso,gen,len)
dfs <- lens - 1
sd.pool <- sqrt(sum(sds^2*dfs)/sum(dfs))
sd.pool/sqrt(lens)
It's a matter of taste which SE you'd put on a plot. Some people feel
that you "shouldn't mix in the other groups" in a mainly descriptive
plot, but as soon as any modelling is involved (e.g., age-adjusted
means) you pretty much have to extract SE's from the model.
--
O__ ---- Peter Dalgaard Blegdamsvej 3
c/ /'_ --- Dept. of Biostatistics 2200 Cph. N
(*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list