[R-sig-eco] Nested Permanova with repeated measures

Steve Brewer jbrewer at olemiss.edu
Tue Mar 17 21:05:44 CET 2015


Paul,

As I think you've figured out, you can't use nested permanova when you have
blocks. It is not clear to me why you would have mesocosm included as an
effect in the model. My understanding is that you have a randomized block
design with no "repetitions" of treatment by block combinations. Hence,
ignoring time and its interactions, the between-subjects effects are block
and treatment, and the residual variation is the experimental error term
(I.e., the block by treatment "interaction" term).

The model for a given time (week) would simply be community~treatment +
block

The mesocosm is the experimental unit. So, you don't want to specify it in
the model.

If you want to include all weeks and examine the between-subjects effects,
then you need to use betadisper() to get the centroid across all 11 weeks
for each microcosm. Using a grouping variable (let's call it
block.treatment.combo), you can get a new matrix made up of 12 centroids,
one for each subject (mesocosm; let's call it
community.centroids.among.weeks). Using this matrix of centroids, run the
following model:

Community.centroids.among.weeks ~ treatment + block

You should get an anova table containing treatment (3 df), block (2 df), and
residual error with (4-1)*(3-1) = 6 df. Total = 11 df.

To analyze the within-subjects effects (which must be done in a separate
analysis), you use the original matrix (not the matrix of centroids) and
construct the following model

Community ~ week + week:treatment + block.treatment.combo

The block.treatment.combo is the grouping variable that you create from your
factors that includes all block by treatment combinations (e.g., b1t1, b1t2,
b1t3, b1c, b2t1, b2t2, etc). It will have 11 degrees of freedom (3 blocks x
4 treatments) -1, the same total df for the between-subjects analysis. This
factor will account for and remove the between-subjects variation from the
residual error (ignore the result of the test of this factor).

The resulting anova table should look like this:

Block.treatment.combo (11 df; ignore test), time (10 df), time:treatment (30
df), and residual error (80 df).

Hope this helps.
Steve


J. Stephen Brewer 
Professor 
Department of Biology
PO Box 1848
 University of Mississippi
University, Mississippi 38677-1848
 Brewer web page - http://home.olemiss.edu/~jbrewer/
FAX - 662-915-5144 Phone - 662-202-5877

From:  Paul Moquin <moquin.paul at gmail.com>
Date:  Tue, 17 Mar 2015 11:42:26 -0700
To:  <r-sig-ecology at r-project.org>, Pyro Maniac <jbrewer at olemiss.edu>
Subject:  Nested Permanova with repeated measures

Hi Stephen and all Permanoverts!

Thank you for posting your thoughts about repeated measure Permanova. I am
following your methods (From Feb 25 2013- posted below) where you use adonis
for the time and time by treatment interaction and , in a seperate step, the
BiodiversityR for the main effect. When I run nested.npmanova the p value I
get for my treatment is 1.0 leading me to believe there is something wrong-
there is of course the possibility that there really is nothing there but
when I look at the plots there seems to be some kind of treatment effect at
least for 5 of the 10 species....so if not significant at least not p=1! I
will provide a glimpse into the design and data I have in the hopes of
finding my issue. 

Melting permafrost which slumps into Arctic lakes has been associated with
phisio-chemical and biological changes in these lakes. To replicate these
slumps, I ran an experiment in an unslumped Arctic lake where I dosed
mesocosms with melted permafrost soil. The experiment had three replicates
of 3 treatment levels plus a control for a total of 12 mesocosms. The
experiment was set up in a randomized block design (ie 3 blocks with 4
mesocosms each- one of each treatment). I have zooplankton community data
for 11 time steps (weeks).

For a number of other univariate parameters I have used a mixed effects
model with mesocosm within block as my random terms and treatment and time
and their interaction as my main effects. (though I am not really interested
in the effect of time)

But in multivariate space I think the best I can do is:
to test time and its interaction with treatment I have
adonis(community~week*treatment, method="bray", perm=999,strata =
enviro$mesocosm, data=enviro)

and to test the main effect:

library(BiodiversityR)
nested.npmanova(community ~treatment + mesocosm, method="bray", data =
enviro) 
>  

Does this seem right? I acknowledge that I loose the ability to use "block"
here but not much I can do right?


I get this as the result:

Total sum of squares for non-parametric manova: 26.8071635047485

Nested anova for mc nested within t.level

                  Df       SumsofSquares       F               N.Perm
Pr(>F)   
treatment    3        1.4607                     0.1727      100
1.000000   
mesocosm  1        2.8188                     15.8910    100
0.009901 **
Residuals 127       22.5277                   0.1774
---
Signif. codes:  0 Œ***¹ 0.001 Œ**¹ 0.01 Œ*¹ 0.05 Œ.¹ 0.1 Œ ¹ 1
> 

Thank you very much

Paul Moquin
 


[R-sig-eco] Permanova with nested data
Steve Brewer jbrewer at olemiss.edu
<mailto:r-sig-ecology%40r-project.org?Subject=Re%3A%20%5BR-sig-eco%5D%20Perm
anova%20with%20nested%20data&In-Reply-To=%3CCD50D4BB.1E27D%25jbrewer%40olemi
ss.edu%3E> 
Mon Feb 25 16:13:18 CET 2013

* Previous message: [R-sig-eco] lme4 for pseudoreplication avoidance
<https://stat.ethz.ch/pipermail/r-sig-ecology/2013-February/003594.html>
* Next message: [R-sig-eco] Validation of linear regression
<https://stat.ethz.ch/pipermail/r-sig-ecology/2013-February/003597.html>
* Messages sorted by: [ date ]
<https://stat.ethz.ch/pipermail/r-sig-ecology/2013-February/date.html#3595>
[ thread ] 
<https://stat.ethz.ch/pipermail/r-sig-ecology/2013-February/thread.html#3595
>  [ subject ] 
<https://stat.ethz.ch/pipermail/r-sig-ecology/2013-February/subject.html#359
5>  [ author ] 
<https://stat.ethz.ch/pipermail/r-sig-ecology/2013-February/author.html#3595
> 

Beth and others,

Given several recent queries regarding how to analyze repeated-measures
and split-plot perManova using adonis, I thought I would pass along what I
think is a reasonable solution.

I just saw the recent exchange over the use of BiodiversityR to do nested
perMANOVA. I was unaware of this function until today.

With that in mind, it is possible to do a simple repeated-measures
permanova using two different analyses, one for the within-subjects
effects and one for the between-subjects effects. The same approach
applies to a simple split-plot analysis.

For the within-subjects (or sub-plot) effects, you use adonis and the
strata function. The model formula could look something like:

Assume species responses are in "Speciesdata" and the treatment, time, and
plot effects are in "envfactors"

Adonis(Speciesdata ~ betweensubtrtmt * time + plot, data = envfactors,
strata = plot)

Where plot is nested within the betweensubtrtmnt

Strata restricts the permutation, and the residual error term will give
you the correct test for the time effect and the betweensubtrtmnt * time
interaction, but the test for the betweensubtrmnt main effect will be
wrong because plot, and not the residual error term, is the correct error
term for testing it.

To get a test for the betweensubtrtmnt main effect, load the BiodiversityR
package (I use the 1.6 version, but see the recent discussion about this)
and use the nested.npmanova function.

nested.npmanova(speciesdata ~ betweensubtrtmnt + plot, data = envfactors)

In this case, the betweensubtrtmnt is tested with plot; plot is tested
with the residual error term but that latter test is not correct in this
instance and is usually not of interest anyway.

Note that the default distance is euclidean; you'll to use "method" to
specify a different distance, e.g.,

nested.npmanova(speciesdata ~ betweensubtrtmnt + plot, data = envfactors;
method ="bray")


The same principles apply to a simple split-plot design, except that the
whole-plot treatment is treated like a between-subjects treatment and the
sub-plot treatment is treated like the time effect.

Hope this is of some help.

Steve

J. Stephen Brewer 
Professor 
Department of Biology
PO Box 1848
 University of Mississippi
University, Mississippi 38677-1848
 Brewer web page - http://home.olemiss.edu/~jbrewer/
FAX - 662-915-5144 <tel:662-915-5144>
Phone - 662-915-1077 <tel:662-915-1077>



	[[alternative HTML version deleted]]



More information about the R-sig-ecology mailing list