Skip to contents

Runs a paired t-test and report the results in APA style

A paired-samples t-test was conducted to compare {dv} between {level1} (M = {mean1}, SD = {sd1}) and {level2} (M = {mean2}, SD = {sd2}). There was a {non}significant difference; t({df}) = {t_value}, p = {p_value}.

Usage

apa_t_pair(x, y, dv = "the DV", level1 = "level 1", level2 = "level 2")

Arguments

y

A vector of the values for level 2.

dv

The text describing the DV in the output statement.

level1

The text describing level 1 in the output statement.

level2

The text describing level 2 in the output statement.

z

A vector of the values for level 1.

Value

A character string of the results text.

Examples

# use generic text
apa_t_pair(x = self_res_att$f_self,
           y = self_res_att$f_non)
#> A paired-samples t-test was conducted to compare the DV between level 1 (M = 3.5, SD = 1.6) and level 2 (M = 3.0, SD = 1.2). There was a significant difference; t(107) = 3.60, p = 0.000.

# specify the text for dv and levels
apa_t_pair(x = self_res_att$f_self,
           y = self_res_att$f_non,
           dv = "preferences for female faces",
           level1 = "participants who resembled those faces",
           level2 = "non-self participants")
#> A paired-samples t-test was conducted to compare preferences for female faces between participants who resembled those faces (M = 3.5, SD = 1.6) and non-self participants (M = 3.0, SD = 1.2). There was a significant difference; t(107) = 3.60, p = 0.000.