SOURCEBOOK

R Articles

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.

table(Outcome)

Obtaining Descriptive Statistics

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

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