Section author: Ravi Selker, Jonathon Love, Damian Dropmann
Paired Samples T-Test (ttestPS)
Description
The Student’s paired samples t-test (sometimes called a dependent-samples t-test) is used to test the null hypothesis that the difference between pairs of measurements is equal to zero. A low p-value suggests that the null hypothesis is not true, and that the difference between the measurement pairs is not zero.
Usage
ttestPS(
data,
pairs,
students = TRUE,
bf = FALSE,
bfPrior = 0.707,
wilcoxon = FALSE,
hypothesis = "different",
norm = FALSE,
qq = FALSE,
meanDiff = FALSE,
ci = FALSE,
ciWidth = 95,
effectSize = FALSE,
ciES = FALSE,
ciWidthES = 95,
desc = FALSE,
plots = FALSE,
miss = "perAnalysis"
)
Arguments
|
the data as a data frame |
|
a list of lists specifying the pairs of
measurement in |
|
|
|
|
|
a number between 0.5 and 2 (default 0.707), the prior width to use in calculating Bayes factors |
|
|
|
|
|
|
|
|
|
|
|
|
|
a number between 50 and 99.9 (default: 95), the width of confidence intervals |
|
|
|
|
|
a number between 50 and 99.9 (default: 95), the width of confidence intervals for the effect sizes |
|
|
|
|
|
|
Details
The Student’s paired samples t-test assumes that pair differences follow a normal distribution – in the case that one is unwilling to assume this, the non-parametric Wilcoxon signed-rank can be used in it’s place (however, note that the Wilcoxon signed-rank has a slightly different null hypothesis; that the two groups of measurements follow the same distribution).
Output
A results object containing:
|
a table containing the t-test results |
|
a table containing the normality test results |
|
a table containing the descriptives |
|
an array of the descriptive plots |
Tables can be converted to data frames with asDF or
as.data.frame(). For example:
results$ttest$asDF
as.data.frame(results$ttest)
Examples
data('bugs', package = 'jmv')
ttestPS(bugs, pairs = list(
list(i1 = 'LDLF', i2 = 'LDHF')))
#
# PAIRED SAMPLES T-TEST
#
# Paired Samples T-Test
# --------------------------------------------------------------
# statistic df p
# --------------------------------------------------------------
# LDLF LDHF Student's t -6.65 90.0 < .001
# --------------------------------------------------------------
#