Please I need help Question 3. (MCD vs DOW) [24 marks] Consider the daily percen
ID: 3316841 • Letter: P
Question
Please I need help Question 3. (MCD vs DOW) [24 marks] Consider the daily percent changes of McDonald’s stock price and those of the Dow Jones Industrial Average for trading days in the months of July and August 2012. The data are in the files Assign4 – Q3.mtw and Assign4.xls.
c) Find the correlation between these percent changes. Does this agree with your impression of the scatterplot?
d) Find the coefficient of determination from the Regression Analysis report. Interpret this number as “variation explained”. In financial terms, it represents the proportion of nondiversifiable risk in McDonald’s. For example, if it were 100%, McDonald’s stock would track the market perfectly, and diversification would introduce nothing new.
e) Find the regression equation to predict the percent change in McDonald's stock from the percent change in the Dow Jones Index. Identify the stock's so-called beta, a measure used by market analysts, which is equal to the slope of this line. According to the capital asset pricing model, stocks with large beta values tend to give larger expected returns (on average, over time) than stocks with smaller betas.
f) Find the 95% confidence interval for the slope coefficient b1.
g) Test at the 5% level to see whether or not the daily percent changes of McDonald's and of the Dow Jones Index are significantly associated.
h) Find the 95% prediction interval for the percent change in McDonald's stock on a day in which the Dow Jones Index is up 1.5%.
i) Find the 95% confidence interval for the mean percent change in McDonald's stock for the idealized population of all days in which the Dow Jones Index is up 1.5%.
MCD DJIA 1.12 0.47 -0.29 1.41 0.83 0.7 0.58 0.69 -0.52 -0.69 0.2 -1.38 -0.12 -2.34 1.16 1.44 0.1 -0.24 0.53 0.47 0.52 -1.18 -0.89 -1.19 -0.8 0.72 0.09 0.72 0.07 0.95 0.54 0.94 0.35 0.93 1.04 0.92 0.78 0.92 1.1 0.45 0.18 0.23 -0.58 -1.35 -0.41 -1.14 0.78 2.08 1.07 3.17 -0.09 -0.66 1.69 1.99 1.69 3.03 -0.42 -0.84 0.83 1.48 -0.23 -0.63 0.56 2.31 -1.7 -0.21 0.42 -2.06 1.54 0.84 0.1 0 -0.46 -2.08 0.94 2.34 0.76 -0.21 -0.99 -1.67 -1.33 -2.33 0.89 1.08Explanation / Answer
a) I am using R software to solve this problem.
First we can load the data into R environment using read.table() function as below:
#Import the data
Data <- read.table("Data.txt", header = T, sep=" ")
After loading the data we can fit a linear regression model in R using the lm() function as below:
#Fit a linear model
fit <- lm(MCD ~ DJIA, data = Data)
We can check the summary of the model using the summary() function as below
#Check the summary of the model
summary(fit)
Call:
lm(formula = MCD ~ DJIA, data = Data)
Residuals:
Min 1Q Median 3Q Max
-1.80986 -0.29564 -0.01577 0.42382 1.04037
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.18782 0.09442 1.989 0.0536 .
DJIA 0.37121 0.06608 5.618 1.63e-06 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.6032 on 40 degrees of freedom
Multiple R-squared: 0.441, Adjusted R-squared: 0.427
F-statistic: 31.56 on 1 and 40 DF, p-value: 1.629e-06
From the above summary we can see that the slope of the line is 0.37121
b) The 95% confidence interval can be found out using the confint() function in R as below:
confint(fit, level = 0.95)
2.5 % 97.5 %
(Intercept) -0.003018025 0.3786488
DJIA 0.237653537 0.5047578
So 95% confidence interval is (0.237653537,0.5047578)
c) Correlation between two vectors can be calculated using the cor() function in R as below:
cor(Data$MCD,Data$DJIA)
0.6640808
So correlation between these two vectors is 0.6640808
To test if the correlation is significant we can use the cor.test() function as below:
cor.test(Data$MCD,Data$DJIA)
Pearson's product-moment correlation
data: Data$MCD and Data$DJIA
t = 5.6175, df = 40, p-value = 1.629e-06
alternative hypothesis: true correlation is not equal to 0
95 percent confidence interval:
0.4512217 0.8054451
sample estimates:
cor
0.6640808
We can see that p value is very small indicating a significant correlation.
d) For predictions we can make use of predict() function in R as below and set the interval argument as "Prediction":
predict(fit, newdata = data.frame(DJIA=1.5), interval = "prediction")
fit lwr upr
1 0.7446239 -0.5004014 1.989649
So prediction interval is from -0.5004014 to 1.989649