Re: [MORPHMET] problems with nested ANOVA

2016-03-04 Thread Collyer, Michael
Dear Brenna,

There is a lot to digest here, so apologies up front if I miss something.  
Also, I’ll keep my response general for the benefit of our colleagues.  We can 
work out specific issues with your data and your analyses via direct email 
communication.

First, you have two sets of shape variables that you present so it is difficult 
to compare your different results and understand exactly the problem, but I see 
a couple of things.  I’m surprised you did not get an error message, as we set 
traps to avoid the type of nested analysis you were trying to perform.  
Currently, nested.update is not that sophisticated to handle a structure like ~ 
a/b/c.  You eluded the trap, somehow (I’ll have to look into this), but if c is 
nested within b and b is nested with a, and one wants to adjust F values such 
that F for b = MSb/MSc and F for a = MAa/MSb, the procedure should be to use a 
recursive strategy with nested.update, to update the fit first by ~b/c, then 
use that update and update it again with ~a/b.  I’m not sure what to tell you 
about the results because I am surprised you got results.

Second, the reason for the same results in your second and third example is 
that bout/rep is the same the error.  In this case, nested.update will not 
accomplish anything, other than identify that there are no residuals after you 
account for your nested effect.

Third, your centroid size (near) invariance appears to have resulted from 
performing GPA on a subset of data that already had GPA performed.  You found a 
significant shape-size association despite what appeared to be little 
variation, but this might just be a scaling issue.  For example, multiply the 
centroid size values by 1 and re-run the analysis.  The SS and MS will 
change, and the new variable will seem less invariant, but I suspect the 
F-value and P-value will not change.

Good luck and feel free to send me your data-specific questions!

Mike

Michael Collyer

Associate Professor
Biostatistics
Department of Biology
Western Kentucky University
1906 College Heights Blvd. #11080
Bowling Green, KY 42101-1080
Phone: 270-745-8765; Fax: 270-745-6856
Email: michael.coll...@wku.edu

On Mar 4, 2016, at 2:45 PM, Brenna Hays 
mailto:bkhays...@gmail.com>> wrote:

Hi All,

I am trying to perform a nested ANOVA in R to test for repeatability and 
subjectivity of landmark placements on three randomly chosen images. I have 
landmarked each image 10 times, in 2 separate bouts (a few months apart).

This is my result from incorporating the entire data set into a nested ANOVA:
#nested ANOVA
error <- procD.lm(f1=ALLlp.shape~ind/bout/rep, iter=999, RRPP=TRUE, data=NULL)
error <- nested.update(error, ~ind/bout/rep)
summary(error)
Call:
procD.lm(f1 = ALLlp.shape ~ ind/bout/rep, iter = 999, RRPP = TRUE,  data = 
NULL)

Type I (Sequential) Sums of Squares and Cross-products
Randomized Residual Permutation Procedure Used
1000 Permutations

Df  SS  MS Rsq   F  
 Z  Pr(>F)
ind20.71265   0.35632  0.98767  1410.6169   19.2446  0.001 
**
ind:bout10.00276   0.00276  0.00383   10.9405  13.4952  0.001 **
ind:bout:rep 36   0.00108   0.3  0.001500.11910.2891  1.000
Residuals20   0.00505   0.00025
Total 59 0.72155
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

I was concerned, however, that these results are comparing between individuals 
(images) which I do not want, since all three images are of different 
individuals. Really, I just want to test variance between bouts and reps, so I 
performed separate nested ANOVAs for each individual. Here is the result for 
one of the individuals (note: it will not let me put the ind factor in since 
for each separate test there is only one category (1 image)):
> error = procD.lm(f1=CochaClp.shape~bout/rep, iter=999, RRPP=TRUE, data=NULL)
> error <- nested.update(error, ~bout/rep)
> summary(error)
Call:
procD.lm(f1 = CochaClp.shape ~ bout/rep, iter = 999, RRPP = TRUE,  data = 
NULL)

Type I (Sequential) Sums of Squares and Cross-products
Randomized Residual Permutation Procedure Used
1000 Permutations

*** F values, Z scores, and P values updated for nested effects

Df SS MS   Rsq  F   
 Z   Pr(>F)
bout  1   0.00238108  0.00238108   0.75651  55.925   9.0398  0.001 **
bout:rep   18  0.00076637  0.4258   0.243491.0534  0.001 **
Residuals  0  0.
Total19  0.00314745

I also performed an ANOVA on just the bout factor to see. I don't know if the 
residual sum of squares and mean squares should match the bout:rep numbers 
above, but it doesn't seem right to me.
> errorb = procD.lm(CochaClp.shape~bout, iter=999, RRPP=TRUE)
> summary(errorb)
Call:
procD.lm(f1 = CochaClp.shape ~ bout, iter = 999, RRPP = TRUE)

Type I (Sequential) Sums of Squares 

[MORPHMET] problems with nested ANOVA

2016-03-04 Thread Brenna Hays
Hi All, 

I am trying to perform a nested ANOVA in R to test for repeatability and 
subjectivity of landmark placements on three randomly chosen images. I have 
landmarked each image 10 times, in 2 separate bouts (a few months apart). 

This is my result from incorporating the entire data set into a nested 
ANOVA:
#nested ANOVA
error <- procD.lm(f1=ALLlp.shape~ind/bout/rep, iter=999, RRPP=TRUE, 
data=NULL)
error <- nested.update(error, ~ind/bout/rep)
summary(error)
Call:
procD.lm(f1 = ALLlp.shape ~ ind/bout/rep, iter = 999, RRPP = TRUE, 
 data = NULL) 

Type I (Sequential) Sums of Squares and Cross-products
Randomized Residual Permutation Procedure Used
1000 Permutations

Df  SS  MS Rsq   F 
  Z  Pr(>F)   
ind20.71265   0.35632  0.98767  1410.6169   19.2446 
 0.001 **
ind:bout10.00276   0.00276  0.00383   10.9405  13.4952 
 0.001 **
ind:bout:rep 36   0.00108   0.3  0.001500.11910.2891  1.000 
  
Residuals20   0.00505   0.00025
Total 59 0.72155
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

I was concerned, however, that these results are comparing between 
individuals (images) which I do not want, since all three images are of 
different individuals. Really, I just want to test variance between bouts 
and reps, so I performed separate nested ANOVAs for each individual. Here 
is the result for one of the individuals (note: it will not let me put the *ind 
*factor in since for each separate test there is only one category (1 image)
):
> error = procD.lm(f1=CochaClp.shape~bout/rep, iter=999, RRPP=TRUE, 
data=NULL)
> error <- nested.update(error, ~bout/rep)
> summary(error)
Call:
procD.lm(f1 = CochaClp.shape ~ bout/rep, iter = 999, RRPP = TRUE,  data 
= NULL) 

Type I (Sequential) Sums of Squares and Cross-products
Randomized Residual Permutation Procedure Used
1000 Permutations

*** F values, Z scores, and P values updated for nested effects

Df SS MS   Rsq  F   
 Z   Pr(>F)   
bout  1   0.00238108  0.00238108   0.75651  55.925   9.0398  0.001 
**
bout:rep   18  0.00076637  0.4258   0.243491.0534 
 0.001 **
Residuals  0  0.   
Total19  0.00314745   

I also performed an ANOVA on just the bout factor to see. I don't know if 
the residual sum of squares and mean squares should match the bout:rep 
numbers above, but it doesn't seem right to me.
> errorb = procD.lm(CochaClp.shape~bout, iter=999, RRPP=TRUE)
> summary(errorb)
Call:
procD.lm(f1 = CochaClp.shape ~ bout, iter = 999, RRPP = TRUE) 

Type I (Sequential) Sums of Squares and Cross-products
Randomized Residual Permutation Procedure Used
1000 Permutations

 Df SSMS  Rsq  F   
Z   Pr(>F)   
bout   10.00238108   0.00238108 0.75651 55.925 9.5151  0.001 **
Residuals 18   0.00076637   0.4258
Total  19  0.00314745   


Additionally, on a simpler note, I performed an ANOVA testing the 
significance of centroid size on shape. The results here do not make sense 
to me either - it states a significant variance but the variance of the 
centroid sizes is so small. 
> csize <- centroid.size(CochaClp.shape)
> csize
 [1] 1.62 1.67 1.64 1.68 1.59 1.75 1.71 
1.74 1.79 1.66
[11] 1.70 1.000122 1.65 1.93 1.71 1.98 1.000117 
1.97 1.72 1.83
> var(csize)
[1] 3.170611e-10

Call:
procD.lm(f1 = CochaClp.shape ~ log(csize), iter = 999, seed = NULL,  
RRPP = TRUE, int.first = FALSE, data = NULL) 



Type I (Sequential) Sums of Squares and Cross-products
Randomized Residual Permutation Procedure Used
1000 Permutations

   Df SS MS Rsq  F  Z Pr(>F)   
log(csize)  1 0.00098216 0.00098216 0.31205 8.1646 4.1957  0.002 **
Residuals  18 0.00216529 0.00012029
Total  19 0.00314745   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1


I believe, as a whole, I am either doing something wrong in my coding with 
procD.lm, or interpreting it incorrectly. Any input or suggestions would be 
extremely helpful. Thank you!

Brenna

-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org
--- 
You received this message because you are subscribed to the Google Groups 
"MORPHMET" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to morphmet+unsubscr...@morphometrics.org.