Consider the annual number of cars sold (in millions) and the revenues (in Milli
ID: 3175430 • Letter: C
Question
Consider the annual number of cars sold (in millions) and the revenues (in Millions of Euros) of the 10 largest car companies: Test whether the number of cars sold is an important predictor variable (use significance level 0.05) Calculate a 95% confidence interval for the regression coefficient of number of cars sold. Calculate a 90% confidence interval for the regression coefficient of number of cars sold. Obtain the coefficient of determination. Determine the standard deviation of the revenue after factoring in the repressor variable and without considering the repressor variable.Explanation / Answer
a) The data is stored in data.txt file in the drive E;
Script:
datafile=read.table("E:/data.txt")
datafile
y=as.numeric(datafile$V2)
x=as.numeric(datafile$V1)
lineyonx=lm(y~x)
lineyonx
anova(lineyonx)
output:
> lineyonx
Call:
lm(formula = y ~ x)
Coefficients:
(Intercept) x
6.21818 -0.03636
> anova(lineyonx)
Analysis of Variance Table
Response: y
Df Sum Sq Mean Sq F value Pr(>F)
x 1 0.145 0.1455 0.0119 0.9155
Residuals 9 109.855 12.2061
Here P-value > alpha 0.05, we accept H0
Thus we conclude that the given data is not suitable for the regression line
b) 95% confidence interval of the population regression coefficient is
> confint(lineyonx,level=0.95)
2.5 % 97.5 %
(Intercept) 1.1073321 11.32903
x -0.7899173 0.71719
c) 90% confidence interval of the population regression coefficient is
> confint(lineyonx,level=0.90)
5 % 95 %
(Intercept) 2.0766638 10.3596998
x -0.6469972 0.5742699
d) Coefficient of determination:
> r=cor(x,y)
> r^2
[1] 0.001322314