SOURCEBOOK

R | Data Analysis

Paired Samples t Test

Prior to the steps below, enter the data as appropriate for the analyses (described elsewhere).

Obtaining Descriptive Statistics

Get the means and standard deviations for the variables.

mean(Outcome1)
sd(Outcome1)
mean(Outcome2)
sd(Outcome2)

Obtaining Inferential Statistics

Test the mean difference for statistical significance and its confidence interval.

t.test(Outcome1-Outcome2,mu=0)
t.test(Outcome1,Outcome2,paired=TRUE)