[R] Single Factor Anova

Liaw, Andy andy_liaw at merck.com
Fri Apr 2 17:07:20 CEST 2004


Sorry, I apparently left out the line

  sum.fit <- summary(fit)

Andy

> From: Liaw, Andy
> 
> So what is your question?  With R-1.8.1 on WinXPPro, I get:
> 
> > y <- scan("clipboard")
> Read 48 items
> > f <- factor(rep(1:2, 24))
> > fit <- aov(y ~ f)
> > print(unclass(sum.fit)[[1]], dig=15)
>             Df               Sum Sq              Mean Sq  F 
> value     Pr(>F)
> 
> f            1 3.63834187585414e-09 3.63834187585414e-09 
> 15.94673 0.00023268
> ***
> Residuals   46 1.04951729171680e-08 2.28155932981910e-10
> 
> ---
> Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1 
> 
> Andy
> 
> 
> > From: christopher ciotti
> > 
> > Hello all -
> > 
> > As I progress in R I am trying to automate functions I would have 
> > normally farmed out to Excel, SPSS or Statistica.  Single 
> > factor anova 
> > is one of them.  For example, a dataset from NIST StRD 
> > (http://www.itl.nist.gov/div898/strd/anova/AtmWtAg.html) has 
> > two groups:
> > 
> > 1             2
> > 
> > 107.8681568   107.8681079
> > 107.8681465   107.8681344
> > 107.8681572   107.8681513
> > 107.8681785   107.8681197
> > 107.8681446   107.8681604
> > 107.8681903   107.8681385
> > 107.8681526   107.8681642
> > 107.8681494   107.8681365
> > 107.8681616   107.8681151
> > 107.8681587   107.8681082
> > 107.8681519   107.8681517
> > 107.8681486   107.8681448
> > 107.8681419   107.8681198
> > 107.8681569   107.8681482
> > 107.8681508   107.8681334
> > 107.8681672   107.8681609
> > 107.8681385   107.8681101
> > 107.8681518   107.8681512
> > 107.8681662   107.8681469
> > 107.8681424   107.8681360
> > 107.8681360   107.8681254
> > 107.8681333   107.8681261
> > 107.8681610   107.8681450
> > 107.8681477   107.8681368
> > 
> > 
> > The certified values are (I hope the spaces remain intact):
> > 
> > Sums of                    Mean               
> > Variation          df      Squares              Squares     
>         F 
> > Statistic
> > 
> > Between Instrument  1 3.63834187500000E-09 3.63834187500000E-09 
> > 1.59467335677930E+01
> > Within Instrument  46 1.04951729166667E-08 2.28155932971014E-10
> > 
> > 
> > Any assistance you can offer is greatly appreciated.  Thanks.
> > 
> > 
> > - --
> > chris ciotti (chris_ciotti at yahoo.com)
> > PGP ID: 0xE94BB3B7
> > 
> > 
> > -----BEGIN PGP SIGNATURE-----
> > Version: PGP 8.0
> > 
> > iQA/AwUBQG16A1kgIqbpS7O3EQI+0wCbBfmexypwUit+JQfHx/ePbq3csyMAoJp+
> > bvKJsTwB/sjUAf4sXWpWQieb
> > =w7Bq
> > -----END PGP SIGNATURE-----
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
> 
> --------------------------------------------------------------
> ----------------
> Notice:  This e-mail message, together with any attachments, contains
> information of Merck & Co., Inc. (One Merck Drive, Whitehouse 
> Station, New
> Jersey, USA 08889), and/or its affiliates (which may be known 
> outside the
> United States as Merck Frosst, Merck Sharp & Dohme or MSD and 
> in Japan as
> Banyu) that may be confidential, proprietary copyrighted 
> and/or legally
> privileged. It is intended solely for the use of the 
> individual or entity
> named on this message.  If you are not the intended 
> recipient, and have
> received this message in error, please notify us immediately 
> by reply e-mail
> and then delete it from your system.
> --------------------------------------------------------------
> ----------------
>




More information about the R-help mailing list