A wrapper to stats::t.test() with paired = TRUE.

paired_t_test(y1, y2, data, ...)

Arguments

y1

A numeric vector of observations

y2

A numeric vector of observations, with each value of y2 is assumed to be paired, such as by repeated measures, the corresponding value of y1.

data

A data frame with y1 and y2 as values.

...

Additional arguments passed to stats::t.test().

Value

A list with class "htest" as returned by stats::t.test().

Examples

paired_t_test(y1, y2, data = pairedsleep)
#> 
#> 	Paired t-test
#> 
#> data:  vec_1 and vec_2
#> t = -4.0621, df = 9, p-value = 0.002833
#> alternative hypothesis: true mean difference is not equal to 0
#> 95 percent confidence interval:
#>  -2.4598858 -0.7001142
#> sample estimates:
#> mean difference 
#>           -1.58 
#>