Hi Michael: abnormal returns in a term used in finance to describe the "residual return" after estimating a return model ( either capm or apt or whatever ) so the needs to build a return model ( capm is the easiest ) and then just calculate the residuals. these are termed the residual returns and can be negative or positive.
drsenne: you should send that to R-Sig-Finance or look around on the net. It's an interesting exercise but you need to understand R pretty well and install quantmod and be able to get the prices for all the stocks and run regression models. I don't know where an R example of it is but Eric Zivot has a nice example in his S+Finmetrics book. If you can get your hands on that, it will show all the details. But, if you send your question to R-Sig-Finance, I bet someone over there will know where a good R example lies. Mark P.S: also checkout the website of "systematic investor". I don't know if he does exactly the above but it does a lot of related things and provides R code. On Sat, Mar 10, 2012 at 7:03 PM, R. Michael Weylandt < michael.weyla...@gmail.com> wrote: > Well, it's not hard to write the code for it, but if you know the > secret way to accurately model "abnormal returns," you'll be a far > richer man than I quite soon. > > Less snidely, one needs to say quite a bit more about a distribution > to specify it than "not Gaussian." > > Michael > > On Sat, Mar 10, 2012 at 12:46 PM, drsenne <dr_se...@pandora.be> wrote: > > Hello > > > > This is my first post on this forum and I hope someone can help me out. > > I have a datafile (weeklyR) with returns of +- 100 companies. > > I acquired this computing the following code: > > > > library("tseries"); > > tickers = c("GSPC" , "BP" , "TOT" , "ENI.MI" , "VOW.BE" , "CS.PA" > , > > "DAI.DE" , "ALV.DE" , "EOAN.DE" , "CA.PA" , "G.MI" > , "DE" , "EXR.MI" , > > "MUV2.BE" , "UG.PA" , "PRU.L", "VOD.L" , "DPB.BE" , "REP.MC" , "RWE.BE" > , > > "AGN.AS" , "FTE.PA" , "EAD" , "LGEN.L" , "CNP.PA" , "ULVR.L" , "TKA.BE" > , > > "RIO.L" , "NOK" , "SGO.PA" , "RNO.PA" , "VIE.PA" , "BAYN.DE" , "SAN.PA" > , > > "DG.PA" , "SSE.L" , "GSK.L" , "EN.PA" , "LYB" , "MLSNP.PA" , "IBE.MC" , > > "EURS.PA" , "AH.AS" , "VIV.PA" , "TIT.MI" , "VOLV-B.ST" , "ABI.BR" , > > "LHA.DE" , "OML.L" , "CNA.L" , "CON.DE" , "PHG" , "AZN.L" , "SBRY.L" , > > "BA.L" , "BT-A.L" , "AF.PA" , "430021.VI" , "SL.L" , "ERIC-A.ST" , " > CDI.PA" > > , "AAL.L" , "ALO.PA" , "DELB.BR" , "HOT.BE" , "GAS.MC" , "SU.PA" , " > OR.PA" , > > "FNC.MI" , "MRW.L" , "MAP.MC" , "ML.PA" , "IMT.L" , "EBK.DE" , "PP.PA" , > > "ACN" , "BTI" , "CRG.IR" , "CPG.L" , "BN.PA" , "NG.L" , "T7L.BE" , " > HEIA.AS" > > , "ACS.MC" , "LG.PA" , "STAN.L" , "ALU.PA" , "FRE.MU" , "SW.PA" , > "WOS.L" , > > "AKZA.AS" , "HEN.MU") > > for( series in tickers ){ > > print(series) > > close <- > > > get.hist.quote(instrument=series,retclass="zoo",quote="AdjClose",compression="d", > > start="2000-1-1", end="2011-12-31",quiet=TRUE) > > if(series==tickers[1]){ pricedata = close }else{ pricedata = merge( > > pricedata , close ) } > > } > > colnames(pricedata) = tickers > > # Avoid a missing because of trade halt for that stock > > pricedata = na.approx(pricedata) > > weeklyR = diff(log(pricedata)) > > time(weeklyR) = as.Date(time(weeklyR)) > > print(weeklyR) > > save(weeklyR , file = "weeklyR.Rdata") > > write.zoo(weeklyR,file="weeklyR.csv",quote=T,sep=",", na = "NA", dec = > "." , > > row.names = F,col.names = T) > > > > Now I need to make a market model in R so i can generate abnormal returns > > from these stocks. As market index I would like to use the GSPC. I also > need > > to consider abnormal returns calculated over a sixty-trading-day window. > > Can this be done in R? Is it difficult to write this code? > > > > Any help would be much appreciated! > > > > thanks > > > > drsenne > > > > > > -- > > View this message in context: > http://r.789695.n4.nabble.com/Generating-abnormal-returns-in-R-tp4462541p4462541.html > > Sent from the R help mailing list archive at Nabble.com. > > > > ______________________________________________ > > R-help@r-project.org mailing list > > https://stat.ethz.ch/mailman/listinfo/r-help > > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > > and provide commented, minimal, self-contained, reproducible code. > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.