The mean-t statistic of the distance between two groups of growth curves.

meanT(y1, y2)

Arguments

y1

matrix of response values for the first group, with a row for each individual and a column for each time. Missing values are allowed.

y2

matrix of response values for the second group. Must have the same number of columns as y1. Missing values are allowed.

Details

This function computes the pooled two-sample t-statistic between the response values at each time, and returns the mean of these values weighted by the degrees of freedom. This function is used by compareGrowthCurves.

Value

numeric vector of length one containing the mean t-statistic.

Author

Gordon Smyth

Examples

y1 <- matrix(rnorm(4*3),4,3)
y2 <- matrix(rnorm(4*3),4,3)
meanT(y1,y2)
#> [1] -0.5168165

data(PlantGrowth)
compareGrowthCurves(PlantGrowth$group,as.matrix(PlantGrowth$weight))
#> ctrl trt1  1.19 
#> ctrl trt2  -2.13 
#> trt1 trt2  -3.01 
#>   Group1 Group2      Stat    P.Value adj.P.Value
#> 1   ctrl   trt1  1.191260 0.24875622  0.24875622
#> 2   ctrl   trt2 -2.134020 0.04477612  0.08955224
#> 3   trt1   trt2 -3.010099 0.01492537  0.04477612
# Can make p-values more accurate by nsim=10000