copier on a franchise basis and performs preventive maintenance and repair servi
ID: 3172268 • Letter: C
Question
copier on a franchise basis and performs preventive maintenance and repair service on
this copier. The data provided on the course web site is for 45 recent calls on users to
perform routine preventive maintenance service; for each call, X = number of copiers
serviced and Y = total number of minutes spent by the service person. Assume that
a simple linear regression model is appropriate for the data.
a) The cases are given in time order. Prepare a time plot for the number of copiers
serviced. What does your plot show?
b) Compute the residuals from the estimated SLR model and prepare the following
plots.
i. Boxplot of residuals.
ii. Residuals versus fitted values.
iii. Time plot of residuals.
iv. Normal probability plot of residuals.
What departures from the SLR model can be studied from each of the plots? Are
there any noteworthy features in the plots? State your findings.
c) Obtain the coefficient of correlation between the ordered residuals and their expected
values under normality. Use Table B.6 and = 0:1 to determine whether
the normality assumption appear to be tenable here.
d) Conduct the Breusch-Pagan test at = 0:05 to determine whether or not the
error variance varies with the level of X. State the alternatives, decision rule and
conclusion.
e) Information on two predictor variables not included in the regression model is
provided on the course web site, namely, mean operational age of copiers serviced
on the call(x2, in months) and years of experience of the service person making
the call (x3). Plot the residuals against X2 and X3 to ascertain whether the
model can be improved by including one or both of these variables. What do you
conclude?
Explanation / Answer
Here i am using R to answer this question.
1>a ##name the txt file as chegg.txt and save it to documents.
data=read.table("chegg.txt", sep="",col.names=c("Y","X","X2","X3"))
data
y=data$Y
y
x=data$X
x
plot(x)
## Run the above codes and the plot will show a more or less random pattern.
b>to find the residuals run the following code
fit=lm(y~x)
fit
par(mfrow=c(2,2)) # init 4 charts in 1 panel
plot(fit)
res=residuals(fit)
res
z=fitted(fit)
z
boxplot(res)
plot(res,z)
qqnorm(res,ylab="Residuals", xlab="Normal Scores", main="")
qqline(res)
## you will find that the red line is not completely flat in the plot of the top left plot so there might be heteroscedusticity in the model.
d> to check whether there is heteroscedustiity we will do the Breusch-Pagan test
install.packages("lmtest") #package lmtest is required
library(lmtest)
bptest(fit)
##BP = 1.4187, df = 1, p-value = 0.2336
we can see the p-value is much higher than .05 so we accept the null hypothesis and conclude thata there is no heteroscedusticty in the model
x2=data$X2
plot(x2,res)
x3=data$X3
plot(x3,res)
x2 has a positive correlation with the residuals so inluding x2 will improve the regression fit.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.