Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

x=c(-0.063114, -0.03538, -0.005977, 0.046451, 0.010618, -0.089884, -0.009908, 0.

ID: 3201583 • Letter: X

Question

x=c(-0.063114, -0.03538, -0.005977, 0.046451, 0.010618, -0.089884, -0.009908, 0.012117, -0.095181, -0.185636, -0.077798, 0.007791, -0.08955, -0.116457, 0.081953, 0.089772, 0.051721, 0.000196, 0.071522, 0.033009, 0.0351, -0.01996, 0.055779, 0.017615, -0.037675, 0.028115, 0.057133, 0.014651, -0.085532, -0.055388, 0.066516, -0.048612, 0.083928, 0.036193, -0.002293, 0.063257, 0.022393, 0.031457, -0.001048, 0.028097, -0.013593, -0.018426, -0.021708, -0.058467, -0.074467, 0.102307, -0.005071, 0.008497)
and
y=c(-0.192867, 0.370448, 0.040563, -0.053971, -0.024, -0.258709, -0.037982, -0.025975, -0.113535, -0.2997, -0.10779, 0.05822, -0.039286, 0.120337, -0.032261, 0.109334, 0.102978, -0.011429, -0.089453, 0.020049, 0.198054, -0.113441, -0.060271, 0.11414, -0.111471, 0.01979, 0.076671, 0, -0.074713, -0.102901, 0.002886, -0.057074, 0.077752, 0.151627, -0.041479, 0.049933, -0.031148, 0.017221, 0.016929, 0.059354, -0.067179, -0.095673, -0.138101, 0.038193, -0.032863, 0.17189, 0.004466, 0.026383)

Please provide answer and R code for part b and c

The variables are x SP500 market monthly log return and y monthly return of Yahoo for 48 months beginning in January 2008. For input into R, the data vectors for monthly market return and monthly stock return are x-c(-0.063114, -0.03538, -0.005977, 0.046451, 0.010618, -0.089884, -0.009908, 0.012117, -0.095181, -0.185636, -0.077798, 0.007791, 0.08955, -0.116457, 0.081953, 0.089772, 0.051721, 0.000196, 0.071522, 0.033009, 0.0351, -0.01996, 0.055779, 0.017615, -0.037675, 0.028115, 0.057133, 0.014651, -0.085532, -0.055388, 0.066516, -0.048612, 0.083928, 0.036193, -0.002293, 0.063257, 0.022393, 0.031457, -0.001048, 0.028097, -0.013593, -0.018426, -0.021708, -0.058467, -0.074467, 0.102307, -0.005071, 0.008497) and y c (-0.192867, 0.370448, 0.040563, -0.053971, -0.024, -0.258709, -0.037982, -0.025975, -0.113535, -0.2997, -0.10779, 0.05822, -0.039286, 0.120337, -0.032261, 0.109334, 0.102978, -0.011429, -0.089453, 0.020049, 0.198054, -0.113441, -0.060271, 0.11414, -0.111471, 0.01979, 0.076671, 0, -0.074713, -0.102901, 0.002886, -0.057074, 0.077752, 0.151627, -0.041479, 0.049933, -0.031148, 0.017221, 0.016929, 0.059354, -0.067179, -0.095673, -0.138101, 0.038193, -0.032863, 0.17189, 0.004466, 0.026383) For the questions below, use 3 decimal places. Part a The coefficients of the least square regression line are Part b Suppose we want to get a prediction interval for each of the next 10 months (beginning January 2012; when the SP500 returns are values in the following R vector xnext c (0.04266, 0.039787, 0.030852, -0.007526, -0.064699, 0.038793, 0.012519, 0.019571, 0.023947, -0.019988) The t critical value for the 95% prediction interval is Using the fitted regression equation for January 2008 to December 2011, the lower endpoint of the 95% prediction interval for January 2012 (SP500 return 0.04266) is The upper endpoint of this 95% prediction interval is The lower endpoint of the 95% prediction interval for October 2012 (SP500 return -0.019988 is The upper endpoint of this 95% prediction interval is

Explanation / Answer

part (b)

1. 3.853

2. -0.1715947

3. 0.2422511

4. -0.2291805

5. 0.1825508

part (c)

6 of the observed values are contained in corresponding prediction intervals

R code for part (b)

x=c(-0.063114, -0.03538, -0.005977, 0.046451, 0.010618, -0.089884, -0.009908, 0.012117, -0.095181, -0.185636, -0.077798, 0.007791, -0.08955, -0.116457, 0.081953, 0.089772, 0.051721, 0.000196, 0.071522, 0.033009, 0.0351, -0.01996, 0.055779, 0.017615, -0.037675, 0.028115, 0.057133, 0.014651, -0.085532, -0.055388, 0.066516, -0.048612, 0.083928, 0.036193, -0.002293, 0.063257, 0.022393, 0.031457, -0.001048, 0.028097, -0.013593, -0.018426, -0.021708, -0.058467, -0.074467, 0.102307, -0.005071, 0.008497)
y=c(-0.192867, 0.370448, 0.040563, -0.053971, -0.024, -0.258709, -0.037982, -0.025975, -0.113535, -0.2997, -0.10779, 0.05822, -0.039286, 0.120337, -0.032261, 0.109334, 0.102978, -0.011429, -0.089453, 0.020049, 0.198054, -0.113441, -0.060271, 0.11414, -0.111471, 0.01979, 0.076671, 0, -0.074713, -0.102901, 0.002886, -0.057074, 0.077752, 0.151627, -0.041479, 0.049933, -0.031148, 0.017221, 0.016929, 0.059354, -0.067179, -0.095673, -0.138101, 0.038193, -0.032863, 0.17189, 0.004466, 0.026383)
z=data.frame(x,y)
z
z.lm<-lm(y~x)
newdata=data.frame(x=c(0.04266,0.039787,0.030852,-0.007526,-0.064699,0.038793,0.012519,0.019571,0.023947,-0.019988))
predict(lm(y~x),newdata,interval="prediction")

the way we get t critical value :

x=c(-0.063114, -0.03538, -0.005977, 0.046451, 0.010618, -0.089884, -0.009908, 0.012117, -0.095181, -0.185636, -0.077798, 0.007791, -0.08955, -0.116457, 0.081953, 0.089772, 0.051721, 0.000196, 0.071522, 0.033009, 0.0351, -0.01996, 0.055779, 0.017615, -0.037675, 0.028115, 0.057133, 0.014651, -0.085532, -0.055388, 0.066516, -0.048612, 0.083928, 0.036193, -0.002293, 0.063257, 0.022393, 0.031457, -0.001048, 0.028097, -0.013593, -0.018426, -0.021708, -0.058467, -0.074467, 0.102307, -0.005071, 0.008497)
y=c(-0.192867, 0.370448, 0.040563, -0.053971, -0.024, -0.258709, -0.037982, -0.025975, -0.113535, -0.2997, -0.10779, 0.05822, -0.039286, 0.120337, -0.032261, 0.109334, 0.102978, -0.011429, -0.089453, 0.020049, 0.198054, -0.113441, -0.060271, 0.11414, -0.111471, 0.01979, 0.076671, 0, -0.074713, -0.102901, 0.002886, -0.057074, 0.077752, 0.151627, -0.041479, 0.049933, -0.031148, 0.017221, 0.016929, 0.059354, -0.067179, -0.095673, -0.138101, 0.038193, -0.032863, 0.17189, 0.004466, 0.026383)
z=data.frame(x,y)
z
z.lm<-lm(y~x)
summary(z.lm)