test.var.het {paleoTS} | R Documentation |
Tests for heterogeneity of sample variances in a paleoTS
object.
test.var.het(y, method = "Bartlett") pool.var(y, nn=NULL, ret.paleoTS=FALSE)
y |
a paleoTS object |
method |
test to be used; currently only Bartlett's test is implemented |
nn |
if y is a vector of variances, nn is a vector of sample sizes |
ret.paleoTS |
logical, indicating if the function should return a new paleoTS object with variances replaced by pooled variance. |
Tests for variance heterogeneity among samples. In the absence of evidence for heterogeniety, it may be desirable to replace individual estimates of phenotypic variance with a variance estimate pooled over all samples.
Function pool.var
is used internally in test.var.het
. It returns the value of the pooled variance.
Function pool.var
either returns a paeloTS
object, or the pooled variance.
Function test.var.het
returns a list with the following elements relevant to Bartlett's test
stat |
test statistic for Bartlett's test |
p.value |
P-vlaue for statistical test |
df |
degrees of freedom, equal to one fewer than the number of samples |
Gene Hunt
Hunt, G. 2006. Fitting and comparing models of phyletic evolution: random walks and beyond. Paleobiology32:578–601.
Sokal, R. and F. J. Rohlf 1995. Biometry, 3rd Ed.
# generate simulated data with no real variance heterogeneity y <- sim.GRW(20, 0, 1) bart <- test.var.het(y) # nonsignificant 95% of the time! ys<- pool.var(y, ret.paleoTS=TRUE) cat (ys$vv) # note all variances now the same