The variables are x=SP500 market monthly log return and y = monthly return of Ap
ID: 3352733 • Letter: T
Question
The variables are x=SP500 market monthly log return and y = monthly return of Apple for 48 months beginning in January 2009.
For input into R, the data vectors for monthly market return and monthly stock return are
x=c(-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, 0.04266, 0.039787, 0.030852, -0.007526, -0.064699, 0.038793, 0.012519, 0.019571, 0.023947, -0.019988, 0.002843, 0.007043)
and
y=c(0.054521, -0.009844, 0.163178, 0.180219, 0.075986, 0.047628, 0.1374, 0.028859, 0.097099, 0.016933, 0.058762, 0.05271, -0.09252, 0.063101, 0.13851, 0.105141, -0.0162, -0.020846, 0.022278, -0.056502, 0.15454, 0.058929, 0.033429, 0.036004, 0.050494, 0.04018, -0.013426, 0.004635, -0.006538, -0.035537, 0.151108, -0.01443, -0.009222, 0.05975, -0.057437, 0.057982, 0.119578, 0.172546, 0.100109, -0.02637, -0.010644, 0.01077, 0.044731, 0.089729, 0.00286, -0.113904, -0.012387, -0.095123)
For the questions below, use 3 decimal places.
Explanation / Answer
a)
> x=c(-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, 0.04266, 0.039787, 0.030852, -0.007526, -0.064699, 0.038793, 0.012519, 0.019571, 0.023947, -0.019988, 0.002843, 0.007043)
> y=c(0.054521, -0.009844, 0.163178, 0.180219, 0.075986, 0.047628, 0.1374, 0.028859, 0.097099, 0.016933, 0.058762, 0.05271, -0.09252, 0.063101, 0.13851, 0.105141, -0.0162, -0.020846, 0.022278, -0.056502, 0.15454, 0.058929, 0.033429, 0.036004, 0.050494, 0.04018, -0.013426, 0.004635, -0.006538, -0.035537, 0.151108, -0.01443, -0.009222, 0.05975, -0.057437, 0.057982, 0.119578, 0.172546, 0.100109, -0.02637, -0.010644, 0.01077, 0.044731, 0.089729, 0.00286, -0.113904, -0.012387, -0.095123)
> model=lm(y~x) #fitting linear regression model
> coefficients(model)
(Intercept) x
0.03025609 0.84611481
Estimated Beta0 = 0.03025609
Estimated Beta1 = 0.84611481
b)
>newdata=data.frame(x=c(0.049198,0.011,0.035355,0.017924,0.02055,-0.015113,0.048272,-0.031798,0.029316,0.04363) )
> predict(model,newdata,interval="predict")
fit lwr upr
1 0.071883251 -0.04728894 0.1910554
2 0.039563357 -0.07882298 0.1579497
3 0.060170483 -0.05854906 0.1788900
4 0.045421856 -0.07299882 0.1638425
5 0.047643754 -0.07080251 0.1660900
6 0.017468761 -0.10122024 0.1361578
7 0.071099748 -0.04803626 0.1902358
8 0.003351336 -0.11588667 0.1225893
9 0.055060796 -0.06352085 0.1736424
10 0.067172083 -0.05179526 0.1861394
c) 8 ( Except the 1st and 6th observation in ynext, all other observations fall into the prediction interval.)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.