Calulates a 95
Uses an approximation to degrees of freedom of n observations - 2.
Thus, may give broader confidence intervals than built in t.test()
function
ci_diff_means(data, var, by)
A data frame
A numeric variable containing the data for the calculation of the means
A grouping variable with only two values
A numeric value for the difference in means
data(sleep)
sleep$group <- as.numeric(sleep$group)
ci_diff_means(data = sleep, var = "extra", by = "group")
#> [1] "(-3.36-0.20)"