title: “Untitled” author: “leela” date: “October 9, 2017” output: html_document data(“cars”) head(cars) scatter.smooth(x=cars\(speed,y=cars\)dist,main=“Dist vs Speed”) ### boxplot -checking for outliers ### boxplot(cars) M<-cor(cars) ###visualizing coorelation plot ##Correlogram : Visualizing the correlation matrix install.packages(“corrplot”) library(corrplot) corrplot(M,method=“number”)
linearMod <- lm(dist ~ speed, data=cars) summary(linearMod)$r.squared par(mfrow=c(2,2)) plot(linearMod)
chceking for autocorreltaion
acf(linearMod$residuals)
print(linearMod) install.packages(“gvlma”) ####### Check Assumptions Automatically gvlma::gvlma(linearMod)