pdf("ex0511.pdf") # Read in data from ASCII formatted (Fixed With File) ex0511dat <- read.fwf("http://www.stat.ufl.edu/~winner/data/biostat/ex0511.dat", width=c(8,8), col.names=c("delivery","outcome")) # Create a dataset (frame) from input data ex0511 <- data.frame(ex0511dat) # Attach the dataset for analysis attach(ex0511) # Obtain crosstabulation of delivery and outcome freqdo <- table(delivery, outcome) freqdo # Obtain the Kruskall-Wallis test to compare outcomes across delivery routes # They make adjustment for ties not shown in text kruskal.test(outcome ~ delivery) dev.off()