SOURCEBOOK

R | Data Analysis

Independent Samples t Test

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

Obtaining Descriptive Statistics

Get the mean and standard deviation for the dependent variable for each of the levels.

by(Outcome,Factor,mean)
by(Outcome,Factor,sd)

Obtaining Inferential Statistics

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

t.test(Outcome~Factor,var.equal=T)