[R] basic anova and t-test question

Spencer Graves
Thu, 01 Sep 2005 02:32:13 -0000

Does the following answer your question:

 > set.seed(1)
 > z0 <- rnorm(100)
 > p.z <- 2*pnorm(-abs(z0))
 > sum(p.z<0.05)
[1] 5
 > pchisq(sum(z0^2), 100, lower=FALSE)
[1] 0.917285

	  Some of the 100 (in this case) normal random deviates seem
statistically significant, even though the ensemble is not.

	  spencer graves

Arne.Muller at sanofi-aventis.com wrote:

> Hello,
>
> I'm posting this to receive some comments/hints about a rather
statistical than R-technical question ... .
>
> In an anova of a lme factor SSPos11 shows up non-significant,
but in the t-test of the summay 2 of the 4 levels (one for
constrast) are significant. See below for some truncated
output.
>
> I realize that the two test are different (F-test/t-test),
but I'm looking for for a "meaning". Maye you have a schenario
that explains how these differences can be created and how you'd
go ahead and analyse it further.
>
> When I use SSPos11 as te only fixed effect, it does it is not
significant in either anova nor t-test, and a boxplot of the
factor shows that the levels are all quite similar (similar
variance and mean). Might the effect I observe be linked to
an unbalance design in the multifactorial model?
>
> 	thanks a lot for your help,
> 	+kind regards,
>
> 	Arne
>
>
>>anova(fit)
>
>              numDF denDF  F-value p-value
> (Intercept)      1   540 323.4442  <.0001
> SSPos1           3   540  15.1206  <.0001
> ...
> SSPos11          3   540   1.1902  0.3128
> ...
>
>
>>summary(fit)
>
> Linear mixed-effects model fit by REML
>  Data: d.orig
>        AIC      BIC    logLik
>   1007.066 1153.168 -469.5329
>
> Random effects:
>  Formula: ~1 | Method
>         (Intercept)  Residual
> StdDev:   0.4000478 0.4943817
>
> Fixed effects: log(value + 7.5) ~ SSPos1 + SSPos2 + SSPos6 + SSPos7 +
SSPos10 + SSPos11 + SSPos13 + SSPos14 + SSPos18 + SSPos19 +
>                   Value  Std.Error  DF   t-value p-value
> (Intercept)   2.8621811 0.23125065 540 12.376964  0.0000
> SSPos1C      -0.1647937 0.06293993 540 -2.618269  0.0091
> SSPos1G      -0.3448095 0.05922479 540 -5.822047  0.0000
> SSPos1T       0.1083988 0.06087095 540  1.780797  0.0755
> ...
> SSPos11C     -0.1540292 0.06171635 540 -2.495761  0.0129
> SSPos11G     -0.1428980 0.05993122 540 -2.384368  0.0175
> SSPos11T     -0.0039434 0.06133920 540 -0.064289  0.9488
> ...
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

--
Spencer Graves, PhD
Senior Development Engineer
PDF Solutions, Inc.
333 West San Carlos Street Suite 700
San Jose, CA 95110, USA

spencer.graves at pdf.com
www.pdf.com <http://www.pdf.com>
Tel:  408-938-4420
Fax: 408-280-7915