Do all pairwise comparisons between groups of growth curves using a permutation test.
compareGrowthCurves(group, y, levels=NULL, nsim=100, fun=meanT, times=NULL,
verbose=TRUE, adjust="holm", n0=0.5)
compareTwoGrowthCurves(group, y, nsim=100, fun=meanT, n0=0.5)
plotGrowthCurves(group, y, levels=sort(unique(group)), times=NULL, col=NULL,...)
compareTwoGrowthCurves
returns a list with two components, stat
and p.value
, containing the observed statistics and the estimated p-value. compareGrowthCurves
returns a data frame with components
name of first group in a comparison
name of second group in a comparison
observed value of the statistic
permutation p-value
p-value adjusted for multiple testing
vector or factor indicating group membership. Missing values are allowed in compareGrowthCurves
but not in compareTwoGrowthCurves
.
matrix of response values with rows for individuals and columns for times. The number of rows must agree with the length of group
. Missing values are allowed.
a character vector containing the identifiers of the groups to be compared. By default all groups with two more more members will be compared.
number of permutations to estimated p-values.
a function defining the statistic used to measure the distance between two groups of growth curves.
Defaults to meanT
.
a numeric vector containing the column numbers on which the groups should be compared. By default all the columns are used.
should progress results be printed?
method used to adjust for multiple testing, see p.adjust
.
offset used for numerator and denominator of p-value calculation.
vector of colors corresponding to distinct groups
other arguments passed to plot()
Gordon Smyth
compareTwoGrowthCurves
performs a permutation test of the difference between two groups of growth curves.
compareGrowthCurves
does all pairwise comparisons between two or more groups of growth curves.
The permutation p-values are computed as p = (ngt + neq/2 + n0) / (nsim + n0) where ngt is the number of permutations with test statistics greater than observed, neq is the number of permuttation with test statistics equal to that observed, and n0 is an offset to avoid p-values of zero (Phipson & Smyth 2010).
The offset n0 improves the type I error rate control and can be interpreted as allowing for the observed data as one of the permutations.
High resolution p-values can be obtained by setting nsim
to some large value, nsim=10000
say.
Elso, C. M., Roberts, L. J., Smyth, G. K., Thomson, R. J., Baldwin, T. M., Foote, S. J., and Handman, E. (2004). Leishmaniasis host response loci (lmr13) modify disease severity through a Th1/Th2-independent pathway. Genes and Immunity 5, 93-100.
Baldwin, T., Sakthianandeswaren, A., Curtis, J., Kumar, B., Smyth, G. K., Foote, S., and Handman, E. (2007). Wound healing response is a major contributor to the severity of cutaneous leishmaniasis in the ear model of infection. Parasite Immunology 29, 501-513.
Phipson B, Smyth GK (2010). Permutation P-values should never be zero: calculating exact P-values when permutations are randomly drawn. Statistical Applications in Genetics and Molecular Biology, Volume 9, Issue 1, Article 39. tools:::Rd_expr_doi("10.2202/1544-6115.1585"), tools:::Rd_expr_doi("10.48550/arXiv.1603.05766").
meanT
, compareGrowthCurves
, compareTwoGrowthCurves
# A example with only one time
data(PlantGrowth)
compareGrowthCurves(PlantGrowth$group,as.matrix(PlantGrowth$weight))
# Can make p-values more accurate by nsim=10000
Run the code above in your browser using DataLab