[R-sig-ME] how to derive 5 level nested anova results table

Douglas Bates bates at stat.wisc.edu
Wed Feb 11 13:58:45 CET 2009


On Wed, Feb 11, 2009 at 2:36 AM, Mao Jianfeng <jianfeng.mao at gmail.com> wrote:
> Hello.

> I am new to R. And, I want to perform a multiple nested anova on a large
> datasets (with 9448 observations).  Under the helps from R-Sig-ecology
> mailing list, I have gained many progresses. But I still have some
> confusions. I want to ask for some helps here.

> my dataset("SeedL.txt") was not attached. Data are not sorted by factors.

> In this dataset, "SpecN" "PopN"  "TreeN" "ConeN" "SeedN" were 5 factors (as
> Explanatory), with "PopN" nested within "SpecN"; "TreeN" nested within
> "PopN"; "ConeN" nested within "TreeN" and "SeedN" nested within "ConeN".
> These are categories.

> "SeedL" is a dependent variate (as Response).

Thank you for your inquiry.  Your data sound fascinating.  I have, on
occasion, described several levels of nested categories with a
hypothetical example having a structure like this (my hypothetical
example used "seed pod" instead of cone).  It is charming to see a
hypothetical example suddenly spring to life.

> I have performed a successful mutinested anova using function lme()
> (library(nlme)).But I still do not know how to get a anova result table
> (sth. like SAS output).

Could you provide more detail on what you would like to see in such an
anova table, please?  For example, are you interested in the results
of hypothesis tests regarding whether certain variance components can
be zero?

You may find that

intervals(f1)

provides some of the information you want to see (although not the
type of hypothesis test I mentioned above).

>> f1 <- lme(SeedL~1, data=seedL, random=~1|SpecN/PopN/TreeN,
> na.action=na.omit)

>> f1
> Linear mixed-effects model fit by REML
>  Data: seedL
>  Log-restricted-likelihood: 14369.45
>  Fixed: SeedL ~ 1
> (Intercept)
>  0.6153105
>
> Random effects:
>  Formula: ~1 | SpecN
>        (Intercept)
> StdDev:  0.08008076
>
>  Formula: ~1 | PopN %in% SpecN
>        (Intercept)
> StdDev:  0.05413198
>
>  Formula: ~1 | TreeN %in% PopN %in% SpecN
>        (Intercept)   Residual
> StdDev:  0.04566776 0.04790476
>
> Number of Observations: 9447
> Number of Groups:
>                     SpecN            PopN %in% SpecN TreeN %in% PopN %in%
> SpecN
>                         3                         47
> 731
>> anova(f1)
>            numDF denDF  F-value p-value
> (Intercept)     1  8716 169.2052  <.0001
>
> I appreciate any advice.
>
> Mao J-F
> State Key Lab of Systematics and Evolutionary Botany
> Institute of Botany
> Chinese Academy of Sciences
> Beijing, China
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>




More information about the R-sig-mixed-models mailing list