1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
context('t-test')
data('ToothGrowth')
test_that('ttest works', {
ttestBF(ToothGrowth$len, ToothGrowth$dose)
ttestBF(formula=len~supp, data=ToothGrowth)
})
test_that('rejects bad input', {
expect_error(
ttestBF(formula=len~dose, data=ToothGrowth),
'Indep. groups t test requires a factor with exactly 2 levels.',
fixed=TRUE
)
expect_error(
ttestBF(formula=len~dose+supp, data=ToothGrowth),
'Indep. groups t test can only support 1 factor as predictor.',
fixed=TRUE
)
expect_error(
ttestBF(formula=len~dose:supp, data=ToothGrowth),
'Interaction terms are not allowed in t test.',
fixed=TRUE
)
})
|