SOURCEBOOK

R | Data Analysis

One Sample t Test

Prior to the steps below, enter the data as appropriate for the analyses (described elsewhere). As always, the following commands should be typed directly in the R console window.

Obtaining Descriptive Statistics

Get the mean and standard deviation for the variable.

mean(Outcome)
sd(Outcome)

Obtaining Inferential Statistics

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

t.test(Outcome,mu=7)