SOURCEBOOK

R | Data Analysis

Descriptives

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 Frequencies

Get the frequency distribution for the variable.

FrequencyTable <- table(Outcome)
FrequencyTable
prop.table(FrequencyTable)

Obtaining Descriptive Statistics

Get the mean, variance, and standard deviation for the variable.

mean(Outcome)
var(Outcome)
sd(Outcome)