Computes a confidence interval for a population paired-samples mean difference using the estimated means, estimated standard deviations, estimated correlation, and sample size. Use the t.test function for raw data input.
ci.mean.ps(alpha, m1, m2, sd1, sd2, cor, n)
alpha level for 1-alpha confidence
estimated mean for measurement 1
estimated mean for measurement 2
estimated standard deviation for measurement 1
estimated standard deviation for measurement 2
estimated correlation between measurements
sample size
Returns a 1-row matrix. The columns are:
Estimate - estimated mean difference
SE - standard error
t - t test statistic
df - degrees of freedom
p - p-value
LL - lower limit of the confidence interval
UL - upper limit of the confidence interval
ci.mean.ps(.05, 58.2, 51.4, 7.43, 8.92, .537, 30)
#> Estimate SE t df p LL UL
#> [1,] 6.8 1.455922 4.670578 29 6.33208e-05 3.822304 9.777696
# Should return:
# Estimate SE t df p LL UL
# [1,] 6.8 1.455922 4.670578 29 6.33208e-05 3.822304 9.777696