Date,Return,total change,surprise,expected,Scheduled 5-Jun-89, XXXXXXXXXX,-25,-4,-21,0 7-Jul-89, XXXXXXXXXX,-25,-3,-22,1 26-Jul-89, XXXXXXXXXX,-25,-6,-19,0 23-Aug-89, XXXXXXXXXX,0,0,0,1 4-Oct-89,...

1 answer below »
The questions are attachrd


Date,Return,total change,surprise,expected,Scheduled 5-Jun-89,-0.8013085,-25,-4,-21,0 7-Jul-89,0.9160443,-25,-3,-22,1 26-Jul-89,1.014705,-25,-6,-19,0 23-Aug-89,0.8831354,0,0,0,1 4-Oct-89,0.5455061,0,3,-3,1 16-Oct-89,1.6131947,-25,-21,-4,0 6-Nov-89,-1.2811919,-25,4,-29,0 15-Nov-89,0.6037842,0,-2,2,1 20-Dec-89,0.1387364,-25,-17,-8,1 8-Feb-90,-0.0554865,0,-1,1,1 28-Mar-90,0.1338923,0,0,0,1 16-May-90,-0.074651,0,0,0,1 5-Jul-90,-0.9792082,0,0,0,1 13-Jul-90,0.4700337,-25,-14,-11,0 22-Aug-90,-1.4789924,0,0,0,1 3-Oct-90,-1.0338965,0,2,-2,1 29-Oct-90,-0.8941581,-25,-2,-23,0 14-Nov-90,0.7986066,-25,4,-29,1 7-Dec-90,-0.3235148,-25,-27,2,0 18-Dec-90,1.1516451,-25,-21,-4,1 8-Jan-91,-0.2727092,-25,-18,-7,0 1-Feb-91,0.0270763,-50,-25,-25,0 7-Feb-91,-0.3432706,0,0,0,1 8-Mar-91,-0.1836292,-25,-16,-9,0 27-Mar-91,4.90E-03,0,0,0,1 30-Apr-91,0.22113,-25,-17,-8,0 15-May-91,-0.9834635,0,2,-2,1 5-Jul-91,0.1917226,0,0,0,1 6-Aug-91,1.1971072,-25,-15,-10,0 21-Aug-91,2.7106689,0,12,-12,1 13-Sep-91,-0.8551061,-25,-5,-20,0 2-Oct-91,-0.2353065,0,-1,1,1 31-Oct-91,0.1287734,-25,-5,-20,0 6-Nov-91,0.2808011,-25,-12,-13,1 6-Dec-91,0.3775118,-25,-9,-16,0 18-Dec-91,0.1106974,0,5,-5,1 20-Dec-91,0.9691076,-50,-28,-22,0 6-Feb-92,0.0530051,0,-1,1,1 1-Apr-92,0.0199319,0,1,-1,1 9-Apr-92,1.5969248,-25,-24,-1,0 20-May-92,-0.0580164,0,0,0,1 2-Jul-92,-0.2414523,-50,-36,-14,1 19-Aug-92,-0.6125391,0,3,-3,1 4-Sep-92,-0.1882048,-25,-22,-3,0 7-Oct-92,-0.5363799,0,5,-5,1 18-Nov-92,0.7960392,0,-10,10,1 23-Dec-92,-0.1197834,0,4,-4,1 4-Feb-93,0.5605165,0,-1,1,1 24-Mar-93,-0.147393,0,-4,4,1 19-May-93,1.3576837,0,-3,3,1 8-Jul-93,0.9441496,0,3,-3,1 18-Aug-93,0.5702519,0,0,0,1 22-Sep-93,0.8293238,0,0,0,1 17-Nov-93,-0.5255699,0,2,-2,1 22-Dec-93,0.3116554,0,0,0,1 4-Feb-94,-2.2835571,25,12,13,1 22-Mar-94,0.076165,25,-3,28,1 18-Apr-94,-0.8180157,25,10,15,0 17-May-94,0.8063356,50,13,37,1 6-Jul-94,-0.0264791,0,-5,5,1 16-Aug-94,0.5960961,50,14,36,1 27-Sep-94,0.1822072,0,-20,20,1 15-Nov-94,-0.0833505,75,14,61,1 20-Dec-94,-0.0475327,0,-17,17,1 1-Feb-95,0.184404,50,5,45,1 28-Mar-95,0.1579513,0,10,-10,1 23-May-95,0.8515926,0,0,0,1 6-Jul-95,1.1194304,-25,-1,-24,1 22-Aug-95,0.1726761,0,0,0,1 26-Sep-95,-0.0913365,0,0,0,1 15-Nov-95,0.5203628,0,6,-6,1 19-Dec-95,0.9832206,-25,-10,-15,1 31-Jan-96,0.8001558,-25,-7,-18,1 26-Mar-96,0.309291,0,-3,3,1 21-May-96,-0.0339411,0,0,0,1 3-Jul-96,-0.3110325,0,-5,5,1 20-Aug-96,-0.1044119,0,-4,4,1 24-Sep-96,7.27E-03,0,-13,13,1 13-Nov-96,0.1912308,0,0,0,1 17-Dec-96,0.4569685,0,1,-1,1 5-Feb-97,-1.2220608,0,-3,3,1 25-Mar-97,-0.0314033,25,3,22,1 20-May-97,0.8915761,0,-11,11,1 2-Jul-97,1.1725048,0,-2,2,1 19-Aug-97,1.3949793,0,-1,1,1 30-Sep-97,-0.3274419,0,0,0,1 12-Nov-97,-1.9453725,0,-4,4,1 16-Dec-97,0.607809,0,-1,1,1 4-Feb-98,0.2710266,0,0,0,1 31-Mar-98,0.7678537,0,0,0,1 19-May-98,0.4003308,0,-3,3,1 1-Jul-98,1.0831402,0,-1,1,1 18-Aug-98,1.6335243,0,1,-1,1 29-Sep-98,-0.1589199,-25,6,-31,1 15-Oct-98,4.0647678,-25,-26,1,0 17-Nov-98,0.3119592,-25,-6,-19,1 22-Dec-98,3.57E-03,0,-2,2,1 3-Feb-99,0.904111,0,0,0,1 30-Mar-99,-0.6305492,0,0,0,1 18-May-99,-0.3230743,0,-4,4,1 30-Jun-99,1.6011866,25,-4,29,1 24-Aug-99,0.1842634,25,2,23,1 5-Oct-99,-0.0889229,0,-4,4,1 16-Nov-99,1.8111737,25,9,16,1 21-Dec-99,1.5057072,0,2,-2,1 2-Feb-00,0.3109823,25,-5,30,1 21-Mar-00,1.9049345,25,-3,28,1 16-May-00,1.3752958,50,5,45,1 28-Jun-00,0.7616008,0,-2,2,1 22-Aug-00,0.0521189,0,-2,2,1 3-Oct-00,-1.2145943,0,0,0,1 15-Nov-00,0.5508853,0,0,0,1 19-Dec-00,-1.5867252,0,5,-5,1 3-Jan-01,5.2930601,-50,-38,-12,0 31-Jan-01,-0.6669808,-50,0,-50,1 20-Mar-01,-2.306629,-50,6,-56,1 18-Apr-01,3.968532,-50,-42,-8,0 15-May-01,0.1440137,-50,-8,-42,1 27-Jun-01,-0.2063983,-25,5,-30,1 21-Aug-01,-1.1467646,-25,2,-27,1 2-Oct-01,1.1564895,-50,-7,-43,1 6-Nov-01,1.4142182,-50,-10,-40,1 11-Dec-01,-0.1748701,-25,0,-25,1 30-Jan-02,1.0246871,0,1,-1,1 19-Mar-02,0.3374788,0,-3,3,1 7-May-02,-0.3725411,0,0,0,1 26-Jun-02,-0.326021,0,0,0,1 13-Aug-02,-2.0223524,0,3,-3,1 24-Sep-02,-1.5065626,0,2,-2,1 6-Nov-02,0.9797037,-50,-19,-31,1 10-Dec-02,1.4143966,0,0,0,1 29-Jan-03,0.6295343,0,0,0,1 18-Mar-03,0.4913896,0,5,-5,1 6-May-03,0.8635149,0,4,-4,1 25-Jun-03,-0.5036013,-25,15,-40,1 12-Aug-03,1.0296226,0,0,0,1 16-Sep-03,1.3474756,0,0,0,1 28-Oct-03,1.5102932,0,0,0,1 9-Dec-03,-0.8966436,0,0,0,1 28-Jan-04,-1.4186728,0,0,0,1 16-Mar-04,0.4605535,0,0,0,1 4-May-04,0.3547686,0,-1,1,1 30-Jun-04,0.5474709,25,-1,26,1 10-Aug-04,1.3189177,25,2,23,1 21-Sep-04,0.7506317,25,2,23,1 10-Nov-04,0.052467,25,0,25,1 14-Dec-04,0.4297883,25,0,25,1 2-Feb-05,0.3882712,25,0,25,1 22-Mar-05,-0.8718666,25,0,25,1 3-May-05,-0.0987221,25,0,25,1 30-Jun-05,-0.5904119,25,0,25,1 9-Aug-05,0.5453911,25,0,25,1 20-Sep-05,-0.7396397,25,1,24,1 1-Nov-05,-0.2201116,25,0,25,1 13-Dec-05,0.4147405,25,0,25,1 31-Jan-06,-0.1519072,25,0,25,1 28-Mar-06,-0.5285362,25,0,25,1 10-May-06,-0.147287,25,-1,26,1 29-Jun-06,2.3606595,25,-2,27,1 8-Aug-06,-0.3913575,0,-4,4,1 20-Sep-06,0.5186731,0,0,0,1 25-Oct-06,0.4353194,0,0,0,1 12-Dec-06,-0.201156,0,0,0,1 31-Jan-07,0.6322469,0,0,0,1 21-Mar-07,1.676289,0,0,0,1 9-May-07,0.3684624,0,0,0,1 28-Jun-07,0.0732106,0,0,0,1 7-Aug-07,0.6574552,0,3,-3,1 18-Sep-07,2.9311806,-50,-15,-35,1 31-Oct-07,1.3203584,-25,-2,-23,1 11-Dec-07,-2.5482312,-25,1,-26,1 Date,GOOG,MMM,AMZN 3/01/2012,331.462585,68.414352,179.029999 4/01/2012,332.892242,68.979744,177.509995 5/01/2012,328.274536,68.668343,177.610001 6/01/2012,323.796326,68.315994,182.610001 9/01/2012,310.06778,68.725723,178.559998 10/01/2012,310.406525,69.078056,179.339996 11/01/2012,311.811249,68.643753,178.899994 12/01/2012,313.644379,69.061676,175.929993 13/01/2012,311.328064,68.504448,178.419998 17/01/2012,313.116364,69.020729,181.660004 18/01/2012,315.273285,69.709015,189.440002 19/01/2012,318.590851,70.307251,194.449997 20/01/2012,291.900879,70.184319,190.929993 23/01/2012,291.666748,70.151527,186.089996 24/01/2012,289.380341,70.41375,187 25/01/2012,283.681702,70.864426,187.800003 26/01/2012,282.989288,71.765823,193.320007 27/01/2012,288.907104,71.667473,195.369995 30/01/2012,287.766388,71.569153,192.149994 31/01/2012,288.971863,71.052902,194.440002 1/02/2012,289.330505,71.577332,179.460007 2/02/2012,291.462524,71.642891,181.720001 3/02/2012,297.051575,71.888733,187.679993 6/02/2012,303.407745,71.749413,183.139999 7/02/2012,302.252075,72.019852,184.190002 8/02/2012,303.786346,72.085381,185.479996 9/02/2012,304.588318,72.12635,184.979996 10/02/2012,301.8237,71.405243,185.539993 13/02/2012,304.95694,72.134537,191.589996 14/02/2012,303.741516,72.101761,191.300003 15/02/2012,301.649353,71.780045,184.470001 16/02/2012,302.127563,72.308014,179.929993 17/02/2012,301.191071,72.233757,182.5 21/02/2012,305.853577,72.266762,182.259995 22/02/2012,302.8349,72.398758,180.580002 23/02/2012,301.923309,72.514252,178.889999 24/02/2012,303.811249,72.761726,179.130005 27/02/2012,303.517334,72.654495,178.529999 28/02/2012,308.040375,72.406998,183.800003 29/02/2012,307.970642,72.266762,179.690002 1/03/2012,310.037903,72.176018,180.039993 2/03/2012,309.465057,72.200768,179.300003 5/03/2012,305.978119,71.821289,180.259995 6/03/2012,301.350464,70.080612,181.089996 7/03/2012,302.267029,70.509605,183.770004 8/03/2012,302.436401,71.532547,187.639999 9/03/2012,299.004272,71.606781,184.320007 12/03/2012,301.445099,72.21727,183.389999 13/03/2012,307.736542,73.215454,184.589996 14/03/2012,306.844879,73.314491,182.259995 15/03/2012,309.405273,74.246689,184.429993 16/03/2012,311.352966,73.883713,185.050003 19/03/2012,315.806274,74.032196,185.520004 20/03/2012,315.562195,73.710442,192.330002 21/03/2012,318.795074,73.347443,191.729996 22/03/2012,321.818756,73.066978,192.399994 23/03/2012,320.095215,72.976227,195.039993 26/03/2012,323.452606,73.520721,202.869995 27/03/2012,322.301941,73.537216,205.440002 28/03/2012,326.655609,72.967964,201.160004 29/03/2012,322.994324,73.231972,204.610001 30/03/2012,319.422729,73.594963,202.509995 2/04/2012,322.252106,73.611458,198.050003 3/04/2012,320.110138,73.248459,199.660004 4/04/2012,316.389099,72.464752,193.990005 5/04/2012,314.97937,71.994537,194.389999 9/04/2012,314.242157,71.219055,191.869995 10/04/2012,312.259583,69.775375,186.979996 11/04/2012,316.792572,70.410591,187.970001 12/04/2012,324.28949,71.656296,190.690002 13/04/2012,311.133789,70.691086,188.460007 16/04/2012,301.903381,71.27681,185.5 17/04/2012,303.646851,72.143005,188.389999 18/04/2012,302.59082,71.879013,191.070007 19/04/2012,298.531036,71.606781,191.100006 20/04/2012,296.917084,72.16777,189.979996 23/04/2012,297.684204,71.879013,188.240005 24/04/2012,299.51236,73.000969,190.330002 25/04/2012,303.721588,73.256729,194.419998 26/04/2012,306.585846,73.685684,195.990005 27/04/2012,306.341766,73.718697,226.850006 30/04/2012,301.295685,73.718697,231.899994 1/05/2012,301.086456,73.916679,230.039993 2/05/2012,302.496185,73.850693,230.25 3/05/2012,304.369141,73.743446,229.449997 4/05/2012,297.370392,73.149483,223.990005 7/05/2012,302.640625,72.605003,225.160004 8/05/2012,305.250854,72.233757,223.899994 9/05/2012,303.437653,71.994537,222.979996 10/05/2012,305.684235,71.879013,226.690002 11/05/2012,301.484955,71.549034,227.679993 14/05/2012,300.872253,70.80658,222.929993 15/05/2012,304.413971,70.765312,224.389999 16/05/2012,313.29071,70.898232,224.059998 17/05/2012,310.361694,70.059242,218.360001 18/05/2012,299.078979,69.369804,213.850006 21/05/2012,305.908386,70.158951,218.110001 22/05/2012,299.278229,69.884834,215.330002 23/05/2012,303.592072,70.441368,217.279999 24/05/2012,300.702881,70.590904,215.240005 25/05/2012,294.660553,70.424751,212.889999 29/05/2012,296.060303,71.213905,214.75 30/05/2012,293.016693,70.150627,209.229996 31/05/2012,289.345459,70.117416,212.910004 1/06/2012,284.42392,68.821564,208.220001 4/06/2012,288.214691,68.630493,214.570007 5/06/2012,284.139984,68.539124,213.210007 6/06/2012,289.200989,70.30014,217.639999 7/06/2012,288.03537,71.02285,218.800003 8/06/2012,289.141235,71.438179,218.479996 11/06/2012,283.188538,70.757019,216.5 12/06/2012,281.494873,72.044586,216.419998 13/06/2012,279.497375,71.546181,214
Answered Same DayApr 28, 2021

Answer To: Date,Return,total change,surprise,expected,Scheduled 5-Jun-89, XXXXXXXXXX,-25,-4,-21,0 7-Jul-89,...

Naveen answered on Apr 28 2021
138 Votes
Data Analysis Project [15 marks]
Due date: 5pm, 29April 2020
Requirement: Pls finish the tasks according to the requirements. All the tasks need to be finished by using R. Pls present your results in the word file, copy all your R code in the end of this word file, and then submit your word file via the Turnitin link in iLearn.
Task 1: Stock Return and Portfolio Analysis
In the file named as “Stock.csv”, you have been provided with the daily prices of three stocks from 2012 to 2018.
a. Plot and present the stock prices in time series with appropriate labels.
[1 mark]
b. Calculate the log returns of all the three stocks and express them in percentages.
Pls report the descriptive statistics of log returns of three stocks in Table 1. Pls change the names in Table 1 to the stock names in your file. [1 mark]
Table 1: Summary Statistics
    Variable
    GOOG
    MMM
    AMZN
    Min
    -0.0875
    -0.0708
    -0.1165
    Max
    0.1489
    0.0574
    0.1462
    Mean
    0.0006
    0.0006
    0.0012
    Median
    0.0004
    0.0008
    0.0009
    SD
    0.0145
    0.0104
    0.0191
    Skewness
    0.6827
    -0.6662
    0.4093
    Kurtosis
    12.5296
    5.3061
    9.0696
    N
    1759
    1759
    1759
c. Pls report the correlation matrix of log returns of three stocks in Table 1. Pls change the names in Table 1 to the stock names in your file. [1 mark]
Table 2: Correlation Matrix
    Variable
    GOOG
    MMM
    AMZN
    GOOG
    1
    0.437571
    0.55568
    MMM
    0.437571
    1
    0.348167
    AMZN
    0.55568
    0.348167
    1
d. There is a file named as “FF3factors.csv” in your folder. Merge your stock data with the Fama French three factors data, which are all in percentages. Pls create a new variable Stock.Rf for all the three stocks, which equals to the difference between log return of each stock and RF (available in the FF3factors.csv), and run a regression of :
.
Report the regression results for all the three stocks in tables (you can use only one table to summarize all the results or three separate tables). [1 mark]
Call:
lm(formula = Stock.Rf ~ Mkt.RF, data = Stock_FF3)
Residuals:
Min 1Q Median 3Q Max
-0.04115 -0.00351 -0.00008 0.00349 0.06424
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.000276 0.000182 1.52 0.13
Mkt.RF 0.010948 0.000218 50.16<2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.0076 on 1756 degrees of freedom
Multiple R-squared: 0.589,    Adjusted R-squared: 0.589
F-statistic: 2.52e+03 on 1 and 1756 DF, p-value: <2e-16
Call:
lm(formula = Stock.Rf ~ GOOG + MMM + AMZN, data = Stock_FF3)
Residuals:
Min 1Q Median 3Q Max
-1.07e-16 -6.00e-19 -2.00e-19 3.00e-19 3.78e-16
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) -8.27e-19 2.33e-19 -3.55e+00 4e-04 ***
GOOG 3.33e-01 2.04e-17 1.64e+16<2e-16 ***
MMM 3.33e-01 2.50e-17 1.33e+16<2e-16 ***
AMZN 3.33e-01 1.48e-17 2.25e+16<2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 9.76e-18 on 1754 degrees of freedom
Multiple R-squared: 1,    Adjusted R-squared: 1
F-statistic: 8.63e+32 on 3 and 1754 DF, p-value: <2e-16
e. Pls run regressionsof:
.
Report the regression results for all the three stocks in tables (you can use only one table to summarize all the results or three separate tables). [1 mark]
Call:
lm(formula = Stock.Rf ~ Mkt.RF + SMB + HML, data = Stock_FF3)
Residuals:
Min 1Q Median 3Q Max
-0.03812 -0.00350 -0.00032 0.00329 0.06262
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.000245 0.000169 1.45 0.15
Mkt.RF 0.011055 0.000207 53.39< 2e-16 ***
SMB -0.002542 0.000354 -7.19 9.9e-13 ***
HML -0.005677 0.000358 -15.84< 2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.00707 on 1754 degrees of freedom
Multiple R-squared: 0.645,    Adjusted R-squared: 0.644
F-statistic: 1.06e+03 on 3 and 1754 DF, p-value: <2e-16
f. Pls make your comments by comparing the results in d and e [1 mark].
Ans: From D and E we comparing the results, The probability values of all independent variables are significant on dependent variable Stock.Rf. Coming to accuracy values, accuracy tells how much performance of the model. Here Stock.Rf on GOOG,MMM,AMZN is better than the model Stock.Rf on Mkt.RF, AMB and HML.
g. If an investor would like to form a portfolio with a targeted expected return of 0.11% and achieve the minimized standard deviation by investing in these three stocks in the “Stock.csv” file. If the daily risk free rate is 0.02%, what is the Sharpe ratio of this optimal portfolio, given there is no short sale constraint? [1 mark] [hint: can use the library of “quadprog”] [pls provide your R code used to form the optimal portfolio in the end of the word file].
> mean
GOOG MMM AMZN
671.4 140.8 661.9
> covar
GOOG MMM AMZN
GOOG 68306 11272 118477
MMM 11272 2048 18540
AMZN 118477 18540 227942
> var
GOOG MMM AMZN
68306 2048 227942
> stdev
GOOG MMM AMZN
261.35 45.26 477.43
> mean.n
GOOG MMM AMZN
100.71 21.12 99.29
> cov.n
GOOG MMM AMZN
GOOG 10246 1690.7 17772
MMM 1691 307.2 2781
AMZN 17772 2781.0 34191
> print(weights.n)
stock weight
1 GOOG 0
2 MMM 1
3 AMZN 0
> print(final)
stock weight
2 MMM 1
> print(risk)
[1] 307.2
h. If an investor would like to form a portfolio with a targeted expected return of 0.11% and...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here