[R] anova results?
David Meyer
david.meyer at ci.tuwien.ac.at
Thu Jan 24 17:24:31 CET 2002
dechao wang wrote:
>
> Dear R users,
>
> I did 16 experiments, with 16 responses (yield), and 4
> factors(hidden, theres, lrate, cycl) with each having
> 2 levels as shown below. I want to do analysis of
> variance to see which factor affect the response. The
> coses are as follows:
>
> hidden<-c(2,2,10,10,2,2,10,10,2,2,10,10,2,2,10,10)
> theres<-c(0.0001, 0.1, 0.0001, 0.1, 0.0001, 0.1,
> 0.0001, 0.1, 0.0001, 0.1, 0.0001, 0.1, 0.0001, 0.1,
> 0.0001, 0.1)
> lrate<-c(0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.2,0.9,0.9,0.9,0.9,0.9,0.9,0.9,0.9)
> cycl<-c(5000,5000,5000,5000,10000,10000,10000,10000,5000,5000,5000,5000,10000,10000,10000,10000)
> yield<-c(0.26, 1.77, 0.29, 1.75, 0.26, 1.77, 0.31,
> 1.75, 0.29, 1.78, 0.35, 1.83, 0.29, 1.79, 0.35, 1.83)
>
> npk <- data.frame(H=factor(hidden),
> T=factor(theres),
> L=factor(lrate),
> C=factor(cycl), yield=yield)
>
> ( npk.aov <- aov(yield ~ H*T*L*C, npk) )
> summary(npk.aov)
>
> when I run it, I got the following results: but there
> is no any F values and p-values. Can you please advise
> me what I missed? Many thanks in advance, dechao
Your model is much to complex for only 16 observations.
The following e.g. works:
tmp <- lm(yield ~ H+T+L+C, npk)
> summary(tmp)
Call:
lm(formula = yield ~ H + T + L + C, data = npk)
Residuals:
Min 1Q Median 3Q Max
-0.029375 -0.009687 -0.001250 0.011563 0.025625
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.260625 0.010618 24.545 5.88e-11 ***
H10 0.031250 0.009497 3.290 0.007200 **
T0.1 1.483750 0.009497 156.228 < 2e-16 ***
L0.9 0.043750 0.009497 4.607 0.000757 ***
C10000 0.003750 0.009497 0.395 0.700503
---
Signif. codes: 0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1
Residual standard error: 0.01899 on 11 degrees of freedom
Multiple R-Squared: 0.9996, Adjusted R-squared: 0.9994
F-statistic: 6110 on 4 and 11 DF, p-value: 0
>
> Df Sum Sq Mean Sq
> H 1 0.0039 0.0039
> T 1 8.8061 8.8061
> L 1 0.0077 0.0077
> C 1 0.0001 0.0001
> H:T 1 0.0014 0.0014
> H:L 1 0.0018 0.0018
> H:C 1 6.25e-06 6.25e-06
> T:L 1 0.0001 0.0001
> T:C 1 6.25e-06 6.25e-06
> L:C 1 6.25e-06 6.25e-06
> H:T:L 1 0.0005 0.0005
> H:T:C 1 0.0001 0.0001
> H:L:C 1 0.0001 0.0001
> T:L:C 1 0.0001 0.0001
> H:T:L:C 1 6.25e-06 6.25e-06
>
> __________________________________________________
>
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
>
> -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> 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
> _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
--
Mag. David Meyer Wiedner Hauptstrasse 8-10
Vienna University of Technology A-1040 Vienna/AUSTRIA
Department for Tel.: (+431) 58801/10772
Statistics and Probability Theory mail: david.meyer at ci.tuwien.ac.at
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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