epiTTest {epibasix}R Documentation

Epidemiological T-Test Function

Description

This function computes the standard two sample T-Test, as well as performing hypothesis tests and computing confidence intervals for the equality of both population means.

Usage

epiTTest(X,Y, alpha=0.05, pooled=FALSE, digits=3)

Arguments

X A vector of observed values of a continuous random variable.
Y A vector of observed values of a continuous random variable.
alpha The desired Type I Error Rate for Confidence Intervals
pooled Logical: If TRUE, a pooled estimate of the variance is used. That is, the variance is assumed to be equal in both groups. If FALSE, the Satterthwaite estimate of the variance is used.
digits Number of Digits to round calculations

Details

This function performs the simple two-sample T-Test, while providing detailed information regarding the analysis and summary information for both groups. Note that this function requires the input of two vectors, so if the data is stored in a matrix, it must be separated into two distinct vectors, X and Y.

Value

nx The number of observations in X.
ny The number of observations in Y.
mean.x The sample mean of X.
mean.y The sample mean of Y.
s.x The standard deviation of X.
s.y The standard deviation of Y.
d The difference between sample means, that is, mean.x - mean.y.
s2p The pooled variance, when applicable.
df The degrees of freedom for the test.
TStat The test statistic for the null hypothesis mu_X - mu_Y = 0.
p.value The P-value for the test statistic for mu_X - mu_Y = 0.
CIL The lower bound of the constructed confidence interval for mu_X - mu_Y = 0.
CIU The lower bound of the constructed confidence interval for mu_X - mu_Y = 0.
pooled Logical: as above for assuming variances are equal.
alpha The desired Type I Error Rate for Confidence Intervals

Author(s)

Michael Rotondi, mrotondi@uwo.ca

References

Casella G and Berger RL. Statistical Inference (2nd Ed.) Duxbury: New York, 2002.

Szklo M and Nieto FJ. Epidemiology: Beyond the Basics, Jones and Bartlett: Boston, 2007.

Examples

X <- rnorm(100,10,1);
Y <- rnorm(100);
summary(epiTTest(X,Y, pooled = FALSE));

[Package epibasix version 1.1 Index]