###################################################################### # R commands Stat 704 # Lab 6 2017 University of South Carolina ###################################################################### # This file contains the R commands for the lab. # # Lines beginning with the symbol '#' are comments in R. All other # lines contain code. # # In R for Windows, you may wish to open this file from the menu bar # (File:Display file); you can then copy commands into the command # window. (Use the mouse to highlight one or more lines; then # right-click and select "Paste to console".) ###################################################################### tolucaURL<-"https://netfiles.umn.edu/users/nacht001/www/nachtsheim/5th/KutnerData/Chapter%20%201%20Data%20Sets/CH01TA01.txt" dat<-read.table(file=tolucaURL, header=F, sep="", stringsAsFactors=F) colnames(dat)<-c("LotSize", "WorkHour") attach(dat) fit1<-lm(WorkHour ~ LotSize) summary(fit1) anova(fit1) p<-cor.test(WorkHour, LotSize, method="pearson") p s<-cor.test(WorkHour, LotSize, method="spearman") s