|
t-tests
The following sections describe how to perform t-tests in R. One-Sample t-test
A one sample t-test can be performed via the t.test function. t.test (NumericResponseVector, mu = MeanValue) Example: > t.test (shrimp, mu=25) Important Notes:
Independent (unpaired) two sample t-test
An independent two sample t-test can be performed via the t.test function. t.test (NumericResponseVector ~ CategoricalGroupingVector) or t.test (NumericResponseGroup1, NumericResponseGroup2) Example: > t.test (ToothGrowth$len ~ ToothGrowth$supp, var.equal = TRUE) Important Notes:
Paired two sample t-test
A paired two sample t-test can be performed via the t.test function. t.test (NumericResponseGroup1, NumericResponseGroup2, paired = TRUE) Example: > t.test (bdf$langPRET, bdf$langPOST, paired = TRUE) Important Notes:
|