# Data from Myers (1990) Classical and Modern Regression with Applications # 10 measurements on spray paint efficiency were taken at each of 4 combinations # of air velocity and voltage. The variance of the 10 measurements was estimated # for each combination, as recorded below data <- matrix(scan(),ncol=4,byrow=TRUE) 50 60 87.5 0.52913 50 60 88.2 0.52913 50 60 88.1 0.52913 50 60 87.3 0.52913 50 60 89.5 0.52913 50 60 89.2 0.52913 50 60 86.2 0.52913 50 60 85.9 0.52913 50 60 90.0 0.52913 50 60 87.0 0.52913 50 120 82.5 0.39971 50 120 81.3 0.39971 50 120 81.6 0.39971 50 120 80.7 0.39971 50 120 77.4 0.39971 50 120 79.3 0.39971 50 120 81.5 0.39971 50 120 82.0 0.39971 50 120 79.7 0.39971 50 120 79.2 0.39971 70 60 77.4 0.01841 70 60 68.1 0.01841 70 60 70.7 0.01841 70 60 65.3 0.01841 70 60 67.0 0.01841 70 60 61.0 0.01841 70 60 71.7 0.01841 70 60 81.7 0.01841 70 60 79.2 0.01841 70 60 60.3 0.01841 70 120 61.2 0.01648 70 120 50.7 0.01648 70 120 67.2 0.01648 70 120 52.3 0.01648 70 120 55.9 0.01648 70 120 68.6 0.01648 70 120 52.0 0.01648 70 120 69.5 0.01648 70 120 63.5 0.01648 70 120 70.1 0.01648 data WLS1 <- data.frame(data) colnames(WLS1) <- c("voltage","velocity","y","vweight") WLS1 rm(data) WLS1.wlm1 <- lm(y ~ voltage +velocity, weights=vweight, data=WLS1) # remove objects when finished rm(WLS1,WLS1.wlm1)