pdf("ex0708.pdf") # Read in data from ASCII formatted (Fixed With File) ex0708dat <- read.fwf("http://www.stat.ufl.edu/~winner/data/biostat/ex0708.dat", width=c(8,8,8,8), col.names=c("drug","tb","logplsmd0","logplsmd21")) # Create a dataset (frame) from input data ex0708 <- data.frame(ex0708dat) # Attach the dataset for analysis attach(ex0708) # Fit the multiple linear regression model with dependent variable = logplsmd21 # and independent variables = logplsmd0, drug, tb ex0708.reg <- lm(logplsmd21 ~ logplsmd0 + drug + tb) # Print out the estimates, standard errors and t-tests, R-Square, and F-test summary(ex0708.reg) # Print out the ANOVA table anova(ex0708.reg) dev.off()