Click on the R icon
If no R icon, go to Start and then All Programs to find R
Notice that the W=15 is not the Wilcoxon W, but the Mann-Whitney U!
The help file for the data set is vitcap.pdf
> source("http://www.rohan.sdsu.edu/~babailey/stat672/vitcap.R")To see if you have it,
> vitcapLet's make some exporatory plots of the data:
> plot(vital.capacity~age, pch=group, data=vitcap) > boxplot(vital.capacity~group, data=vitcap) > hist(vitcap$vital.capacity[vitcap$group==1]) > hist(vitcap$vital.capacity[vitcap$group==3])
Let's make 2 datasets,
> x <- vitcap$vital.capacity[vitcap$group==1] > y <- vitcap$vital.capacity[vitcap$group==3]
Let's do an F test (just for fun):
> help(var.test)Let's do a t-test (just for fun)
> help(t.test)Maybe normality is not such a good assumption?
What about the Wilcoxon Rank Sum Test?
Practice writing R code that can calculate the Uhat statistics for
Problem 4.41,
which should be close to -1.348.
Here is a place to start: ustat.r