library(pastecs)
options(scipen=100)
options(digits=2)
stat.desc(Train)
The mean price of the retail car is $21650.42 with a standard deviation of $9973.78. The median price of retail cars is $18214.45. The minimum and maximum recorded retail price of car is $ 9041.91 and $70755.47 respectively.
The mean mileage of the retail car is 19808.3 with a standard deviation of 8005.7. The median mileage of retail cars is 20954. The minimum and maximum recorded retail mileage of car is $ 266 and 41829 respectively.
From the above histogram, we see that the distribution of price of retail cars has longer tail on the right side of the normal curve, indicating that the distribution of price of cars is skewed right or positively skewed
From the above histogram, we see that the distribution of mileage of retail cars has longer tail on the left side of the normal curve, indicating that the distribution of mileage of cars is skewed left or negatively skewed
Since the sample size is large, the distribution of price and mileage follows normal (by central limit theorem)
Regression Model
The multiple regression analysis is performed to predict price using mileage, cylinder,doors, cruise,sound and leather as independent variables. The R code is given below
regression.out<-lm(Price~Mileage+Cylinder+Litre+Doors+Cruise+Sound+Leather,data=Train)
summary (regression.out)
The value of F test statistic is 67 and its corresponding p – value < 0.05, indicating that the estimated regression model is good fit in predicting the dependent variable price
The coefficient of determination is 0.57. This indicates that 57% of the variation in the dependent variable is explained by the regression model while the remaining 43% left unexplained
b)
The regression coding is given below
regression.out<-lm(Price~Mileage+Cylinder+Litre+Doors+Cruise+Sound+Leather,data=Train)
coef <- coefficients(regression.out)
resid <- residuals(regression.out)
predict<-predict(regression.out)
rsq <- summary(regression.out)$r.squared
se <- summary(regression.out)$sigma
stat.coef <- summary(regression.out)$coefficients
coef <- stat.coef[,1]
se.coef <- stat.coef[,2]
t.coef <- stat.coef[,3]
p.coef <- stat.coef[,4]
plot(Train)
plot(Train$Mileage,residuals(regression.out))
plot(Train$Cylinder,residuals(regression.out))
plot(Train$Litre,residuals(regression.out))
plot(Train$Doors,residuals(regression.out))
library(visreg)
out = visreg(regression.out, band=FALSE)
Regression Plots
The plot and the deviances suggest that the linear model is probably sufficient. This is a subjective judgment based on eyeballing the data and fits - perhaps the most important aspect of model fitting.
1,212,718Orders
4.9/5Rating
5,063Experts
Turnitin Report
$10.00Proofreading and Editing
$9.00Per PageConsultation with Expert
$35.00Per HourLive Session 1-on-1
$40.00Per 30 min.Quality Check
$25.00Total
FreeGet
500 Words Free
on your assignment today
Get
500 Words Free
on your assignment today
Request Callback
Doing your Assignment with our resources is simple, take Expert assistance to ensure HD Grades. Here you Go....
Speak directly with a qualified subject expert.
Get clarity on your assignment, structure, and next steps.
In this free session, you can: