t.test.cluster: t-test for Clustered Data

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/t.test.cluster.s

Description

Does a 2-sample t-test for clustered data.

Usage

1
2
3
t.test.cluster(y, cluster, group, conf.int = 0.95)
## S3 method for class 't.test.cluster'
print(x, digits, ...)

Arguments

y

normally distributed response variable to test

cluster

cluster identifiers, e.g. subject ID

group

grouping variable with two values

conf.int

confidence coefficient to use for confidence limits

x

an object created by t.test.cluster

digits

number of significant digits to print

...

unused

Value

a matrix of statistics of class t.test.cluster

Author(s)

Frank Harrell

References

Donner A, Birkett N, Buck C, Am J Epi 114:906-914, 1981.

Donner A, Klar N, J Clin Epi 49:435-439, 1996.

Hsieh FY, Stat in Med 8:1195-1201, 1988.

See Also

t.test

Examples

1
2
3
4
5
6
7
8
9
set.seed(1)
y <- rnorm(800)
group <- sample(1:2, 800, TRUE)
cluster <- sample(1:40, 800, TRUE)
table(cluster,group)
t.test(y ~ group)   # R only
t.test.cluster(y, cluster, group)
# Note: negate estimates of differences from t.test to
# compare with t.test.cluster

harrelfe/Hmisc documentation built on Oct. 3, 2019, 9:34 p.m.