R Open Labs: QQPlot

Post by Ellie Ransom, Research Services Coordinator, Science and Engineering Libraries
At last week’s R Open Lab, we visualized our data to test our assumptions of normality using two of of R’s native commands, qqnorm and qqline.
We practiced using the built in dataset, trees, and looked at the variables Height and Volume separately.
Notice how the Height variable is basically normal, but the Volume variable appears to be skewed.
qqnorm(trees$Height)
qqline(trees$Height)
Inline image 2
qqnorm(trees$Volume)
qqline(trees$Volume)
Inline image 3
It might make sense to transform the skewed data before analyzing it!
qqnorm(log(trees$Volume))
qqline(log(trees$Volume))
Inline image 4
Share your thoughts and suggestions with us here, and we’ll see you next week!