3
$\begingroup$

I am quite newbie of ANOVA, and just learnt how to run the function.

I am using the function 'Anova' from the package 'car' in R, and when I summary the analysis, I see the text:

Univariate Type II Repeated-Measures ANOVA Assuming Sphericity

My professor told me that, "assuming sphericity" is not the thing she want, and she want some kind of "real" thing. Unfortunately, she does not know R well so she cannot tell me how to do that.

Could you explain me what is "assuming sphericity", and how could I satisfy the requirement of my prof?

Updated:

Thanks for Rolan and Peter, I chose to run "lme" (in package "nlme") and I have the output:

    lme3 <- lme (Z_score ~ WTH1 + WTH2, random = ~1|BTW, data = spf)
    summary (lme3)

> Linear mixed-effects model fit by REML  Data: spf 
>        AIC      BIC    logLik
>   327.9795 341.7903 -158.9897
> 
> Random effects:  Formula: ~1 | BTW
>          (Intercept)  Residual StdDev: 2.310226e-05 0.8962092
> 
> Fixed effects: Z_score ~ WTH1 + WTH2 
>                  Value Std.Error  DF   t-value p-value  
>(Intercept) -0.6584315 0.1417031 113 -4.646557   0e+00  
>WTH11        0.6741030 0.1636247 113  4.119813   1e-04  
>WTH21        0.6427601 0.1636247 113  3.928259   1e-04  
>Correlation: 
>       (Intr) WTH11  
> WTH11 -0.577        
> WTH21 -0.577  0.000
> 
> Standardized Within-Group Residuals:
>        Min         Q1        Med         Q3        Max 
> -2.1274596 -0.7449203 -0.1466509  0.6385587  3.2199382 
> 
> Number of Observations: 120 Number of Groups: 5

So, you can see, my dataset have 5 columns:

> str (spf)
> 'data.frame': 120 obs. of  5 variables:
>  $ id     : Factor w/ 30 levels "1","2","3","4",..: 1 1 1 1 2 2 2 2 3 3 ... 
    >  $ BTW    : Factor w/ 5 levels "1","2","3","4",..: 1 1 1 1 1 1 1 1 1 1 ...
>  $ WTH1   : Factor w/ 2 levels "0","1": 1 1 2 2 1 1 2 2 1 1 ...
    >  $ WTH2   : Factor w/ 2 levels "0","1": 1 2 1 2 1 2 1 2 1 2 ...
>  $ Z_score: num  -1.06 -0.678 1.194 1.94 -1.06 ...

BTW (between) is actually a Group ID (we run an experiment 5 times, each time with a different group), and WTH1 and WTH2 (within) are within variables. Z_score is the measurement.

I want to know, is there any effect of BTW on WTH1 and WTH2 (I hope not), but I do not know how to interpret the data of lme?

(Using Anova function I mentioned above, the result is quite straightforward, with the notion '*' and '' etc to determine the significant level, but there is a problem related to 'Assuming Sphericity")

$\endgroup$
  • 2
    $\begingroup$ You should probably switch to linear mixed effects models then. Look into package nlme and this book: Pinheiro, J.C., and Bates, D.M. (2000) "Mixed-Effects Models in S and S-PLUS", Springer. $\endgroup$ – Roland Oct 14 '15 at 9:59
  • 3
    $\begingroup$ What does 'some kind of "real" thing' mean? $\endgroup$ – Glen_b Oct 14 '15 at 10:18
  • 1
    $\begingroup$ It's not a function of the forum to read your professor's mind! $\endgroup$ – Nick Cox Oct 14 '15 at 10:52
  • $\begingroup$ Of course, I understood that. Just if there is something opposite with "assuming sphericity" in Anova and it's okay. $\endgroup$ – mommomonthewind Oct 14 '15 at 11:03
  • 2
    $\begingroup$ The way you structured your lme() call does not seem to include an interaction term between BTW and the WTHs, which is what you would need to see if there is "any effect of BTW on WTH1 and WTH2." I'm not sure how to specify such an interaction in lme. It can be done in lmer; see the cheat sheet for how to specify models for that function. Note that this can take a good deal of care both in specifying the model and in interpreting the results. $\endgroup$ – EdM Oct 14 '15 at 13:01
4
$\begingroup$

Sphericity is a condition of the data and an assumption of RM-ANOVA. All variances of differences between all possible pairs of groups must be equal. This is rarely a reasonable assumption with repeated measures.

As @Roland said, one way around this is to use mixed effects (aka multilevel models). Pinheiro and Bates, which he recommends, is good, but may be rather heavy going. There are lots of good books on these issues. I like Hedeker and Gibbons.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ Hi Peter, if possible, could you introduce me a resource with R code. It is easier for me. $\endgroup$ – mommomonthewind Oct 14 '15 at 11:05
  • $\begingroup$ I usually use SAS for this sort of model, myself. But look at the nlme package. Pinheiro and Bates does have R code, if you want a book. @FrankHarrell 's book Regression Modelling Strategies covers much more than this sort of model, but does have a section on repeated measures and is R based. $\endgroup$ – Peter Flom Oct 14 '15 at 11:18
  • $\begingroup$ Hi Peter, thanks for your comment, I can run lme now, but the problem is I do not understand the result. I updated my question, so if possible, could you please tell me what does it mean? $\endgroup$ – mommomonthewind Oct 14 '15 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.