Wednesday, February 2, 2011

Commands for Calculating Mean, Variance, & Standard Deviation

Commands in Excel

Statistic: MEAN
Command: =AVERAGE(left click and select data)

Statistic: VARIANCE
Command: =VAR(left click and select data)

Statistic: STANDARD DEVIATION
Command: STDEV(left click and select data)


Commands in R

garst <- c(148, 150, 152, 146, 154)    # enter values for 'garst'

print(garst)     # see if the data is there

var(garst)      # compute variance

sd(garst)      # compute standard deviation

plot(garst)   # plot

hist(garst) # histogram or distribution