Run the following code.
# TSV[,3] date (mm/dd/yyyy) # In this case, 4/30/2015 in date TSV2 means monthly return of May (not April). # The following code extracts monthly date of May 2015. TSV2_2015_5 <- subset(TSV2[,],TSV2[,3]=="4/30/2015") # Extract data within each Alpha quartile 1, 2, 3, and 4. TSV2_2015_5_Alpha1 <- subset(TSV2_2015_5[,],TSV2_2015_5[,10]=="1") TSV2_2015_5_Alpha2 <- subset(TSV2_2015_5[,],TSV2_2015_5[,10]=="2") TSV2_2015_5_Alpha3 <- subset(TSV2_2015_5[,],TSV2_2015_5[,10]=="3") TSV2_2015_5_Alpha4 <- subset(TSV2_2015_5[,],TSV2_2015_5[,10]=="4") # average monthly total returns of each quartile mean(TSV2_2015_5_Alpha1[,6]) mean(TSV2_2015_5_Alpha2[,6]) mean(TSV2_2015_5_Alpha3[,6]) mean(TSV2_2015_5_Alpha4[,6]) |
[1] 4.950676 [1] 5.175095 [1] 4.85193 [1] 4.811 |
No comments:
Post a Comment