Lab Exercise 2 for R: Descriptive Statistics

Exercise 1:

> trees <- read.table("http://caspar.bgsu.edu/~courses/stats/Labs/Datasets/TreesU.txt", sep="\t", header=T, na.strings = ".")
> write.table(trees)

> names(trees)

Exercise 2:

> xtabs(~Name, data = trees)
> summary(trees$Diam)
> mean(trees$Diam, na.rm=TRUE)

> install.packages("pastecs"); library(pastecs)
> options(digits=4)
> stat.desc(trees)

> install.packages("psych"); library(psych)
> describe(trees)
> install.packages("Hmisc"); library(Hmisc)
> describe(trees)

This reports descriptive stats for tree species subgroups

> describeBy(trees$Diam, group = trees$Name)


Exercise 3:


> qqnorm(trees$Diam)
> qqline(trees$Diam,col="red")



last modified: 2/2/15