diff --git a/RASL_Ex1.r b/RASL_Ex1.r new file mode 100644 index 0000000000000000000000000000000000000000..524e77181839777f72218800c4f0d91d8fa79a1f --- /dev/null +++ b/RASL_Ex1.r @@ -0,0 +1,22 @@ +#Exercise 2 + +#a) +pickup=read.csv("pickup.csv",header=TRUE) +attach(pickup) +plot(pickup) + +#b) +#linear model +linearmodel=lm(log(price)~.,data=pickup) +summary(linearmodel) + +#model diagnostics +plot(linearmodel) + +#c) +#adding interaction terms +linearmodel2=lm(log(price)~year+miles+make+make*miles+make*year,data=pickup) +summary(linearmodel2) + +plot(linearmodel2) +