# Example: Computer-assisted learning # A study of computer-assisted learning in 12 students investigated the # relationship between # Cost: cost of computer time (in cents) # Responses: the total number of responses in completing a lesson dados<-scan("http://www.stat.ufl.edu/~winner/sta4210/data/CH11PR06.txt", list(cost=0, responses=0)) attach(dados) plot(responses,cost, pch=16) fit.model<-lm(cost~responses) library(MASS) plot(fitted(fit.model),stdres(fit.model), pch=16) plot(responses,stdres(fit.model), pch=16) fit.model<-lm(cost~responses, weight=1/(responses^2)) plot(fitted(fit.model),stdres(fit.model),pch=16)