[R] Indexing ANOVA table

Pascal.Niklaus@unibas.ch Pascal.Niklaus at unibas.ch
Sat Nov 29 11:37:47 CET 2003


Hi all,

I'd like to extract a value from an ANOVA table, but experience the following
problem:

### This works:

> s.pseudo <- summary(aov(m ~ block + mix*graz,data=split1))
> s.pseudo
            Df  Sum Sq Mean Sq F value  Pr(>F)
block        2 1114.66  557.33  4.4296 0.04192 *
mix          1    6.14    6.14  0.0488 0.82956
graz         2    1.45    0.72  0.0057 0.99427
mix:graz     2    3.82    1.91  0.0152 0.98495
Residuals   10 1258.19  125.82
---
Signif. codes:  0 `***' 0.001 `**' 0.01 `*' 0.05 `.' 0.1 ` ' 1
> s.pseudo[[1]]["mix ","Pr(>F)"]
[1] 0.8295556

### But this doesn't -- why?

> s.split <-  summary(aov(m ~ block + mix*graz + Error(Plot),data=split1))
> s.split

Error: Plot
          Df  Sum Sq Mean Sq F value Pr(>F)
block      2 1114.66  557.33  0.8994 0.5265
mix        1    6.14    6.14  0.0099 0.9298
Residuals  2 1239.37  619.68

Error: Within
          Df  Sum Sq Mean Sq F value Pr(>F)
graz       2  1.4464  0.7232  0.3073 0.7437
mix:graz   2  3.8206  1.9103  0.8117 0.4776
Residuals  8 18.8278  2.3535
> s.split[["Error: Plot"]]  ## extracting first list element works
          Df  Sum Sq Mean Sq F value Pr(>F)
block      2 1114.66  557.33  0.8994 0.5265
mix        1    6.14    6.14  0.0099 0.9298
Residuals  2 1239.37  619.68
> s.split[["Error: Plot"]]["mix ","Pr(>F)"]  ### <== FAILS
Error in s.split[["Error: Plot"]]["mix ", "Pr(>F)"] :
        incorrect number of dimensions

So where is the difference between the two?

Thanks for any hint

Pascal




-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/




More information about the R-help mailing list