Learn R Programming

statpsych (version 1.7.0)

ci.mean.ps: Confidence interval for a paired-samples mean difference

Description

Computes a confidence interval for a population paired-samples mean difference using the estimated means, estimated standard deviations, estimated correlation, and sample size. Also computes a paired-samples t-test. Use the t.test function for raw data input.

Usage

ci.mean.ps(alpha, m1, m2, sd1, sd2, cor, n)

Value

Returns a 1-row matrix. The columns are:

  • Estimate - estimated mean difference

  • SE - standard error

  • t - t test statistic

  • df - degrees of freedom

  • p - two-sided p-value

  • LL - lower limit of the confidence interval

  • UL - upper limit of the confidence interval

Arguments

alpha

alpha level for 1-alpha confidence

m1

estimated mean for measurement 1

m2

estimated mean for measurement 2

sd1

estimated standard deviation for measurement 1

sd2

estimated standard deviation for measurement 2

cor

estimated correlation between measurements

n

sample size

Examples

Run this code
ci.mean.ps(.05, 58.2, 51.4, 7.43, 8.92, .537, 30)

# Should return:
# Estimate       SE        t df            p       LL       UL
#      6.8 1.455922 4.670578 29  6.33208e-05 3.822304 9.777696


Run the code above in your browser using DataLab