d <- file.choose(); d <- as.data.frame(read.csv(d), header=T)
require(foreign) library(foreign) // the ID number is even, hence we take the first 71 observations d<-d[1:71,] // Check the new data set: d // Choose variables participating in the assignment: 292302%%13+2 [1] 12 2302%%13+2 [1] 3 // Our explanatory variables are variable #3 (lgdp2) and #12 (gcony2) //Now plot a loess regression for variable #3 scatter.smooth(d[,2]~d[,3]) abline(lm(d[,2]~d[,3]),col="red", lwd=4) // Add a robust linear regression and add a blue line ...