# [R] nested anova

Joshua Wiley jwiley.psych at gmail.com
Fri Oct 22 09:48:55 CEST 2010

```Hi Rick,

Whenever I hear my instant association with post hoc and ANOVA would
be ?TukeyHSD  However, if you are not comfortable interpreting the
model you ran, this suggests that you may benefit more from learning
more statistical theory or finding someone to consult with who can
help.  You might also try graphing your data.  Something like this
would be one (of very many and not necessarily the best for your data)
option:

library(lattice)
xyplot(catchrate ~ habitat | site, data = pat)
xyplot(catchrate ~ site | Gear, data = pat)
xyplot(catchrate ~ habitat | Gear, data = pat)

I tend to prefer using regression and then either accepting the
default contrasts or (if I have some theory/hypothesis) specifying my
own contrast matrices and using those.  However, it is not really
feasible for members of this list to help you interpret your results
or suggest appropriate statistical techniques without knowing your
actual data.  If you have specific questions related to R (e.g., "How
can I calculate <some test or statistic>?  Here is a representative,
but small sample dataset."), you will get a lot more advice and help.

Best regards,

Josh

On Thu, Oct 21, 2010 at 4:13 PM, mirick <mirick2 at yahoo.com> wrote:
>
> Hello all,
> Can any of you R gurus help me out?  I’m not all that great at stats to
> begin with, and I’m also learning the R ropes (former SAS user).
> Here’s what I need help with…  I have a nested sample design and ran a
> nested anova, but I don’t know how to interpret the results
> habitat (four different types) is nested in site (three types), and site is
> nested in gear (two types)
>  My  code:    pat2<-aov(catchrate~habitat/site/gear, data=pat)
> This created the following outcome:
>                               Df               Sum Sq           Mean Sq
> F value                      Pr(>F)
> habitat                   3                2.932              0.9774
> 0.9543               0.4155656
> habitat:site           8                18.716            2.3395
> 2.2842                0.0235207
> habitat:site:Gear  12             39.244            3.2704
> 3.1930                0.0003546
> Residuals              186 190.505  1.0242
>
>  What exactly does this outcome mean?   It looks like there are differences
> between gears and sites, but not among habitats.  Which gear is better,
> which site is better, which gear works better in each site, etc.?
> I’ve looked for some post hoc code to do this, but I can’t find anything and
> I am at wits end.
> Thanks,
> Rick M.
>
> --
> View this message in context: http://r.789695.n4.nabble.com/nested-anova-tp3006469p3006469.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

--
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/

```