ttest.matrix: Compute running t-tests

Description Usage Arguments Details Value Author(s) Examples

Description

Compute a running pooled t-test

Usage

1
2
ttest.matrix(ctr, trt)
t.test.matrix(ctr, trt)

Arguments

ctr

matrix of control samples, 1 sample per column, 1 variable per row

trt

matrix of treatment samples, 1 sample per column, 1 variable per row

Details

This function applies a pooled variance t-test 'sequentially' to the control and treatment values specified in order to experimentally test the power of the t-test at various sample sizes. IE, it efficiently performs the equivalent of

  1. 1 t.test( ctr[1:2], trt[1:2] )

  2. 2 t.test( ctr[1:3], trt[1:3] )

  3. 3 t.test( ctr[1:4], trt[1:4] )

  4. ncol(ctr)-1 t.test( ctr[1:ncol(ctr)], trt[1:ncol(trt)])

Value

Matrix of p-values of dimension nrow(x) by (ncol(x)-1)

Author(s)

Peng Liu peng\_liu@groton.pfizer.com

Examples

1
2
3
4
5
6
  x <- rbind(V1=rnorm(20, mean=0, sd=1),
             V2=rnorm(20, mean=0, sd=2))
  y <- rbind(V1=rnorm(20, mean=0.25, sd=1),
             V2=rnorm(20, mean=0.25, sd=2))

  ttest.matrix(x,y)

warnes/exp.ssize documentation built on May 4, 2019, 12:59 a.m.