[Eventstudies-commits] r123 - pkg/inst/tests

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Aug 9 14:35:27 CEST 2013


Author: chiraganand
Date: 2013-08-09 14:35:27 +0200 (Fri, 09 Aug 2013)
New Revision: 123

Modified:
   pkg/inst/tests/test_marketresiduals.R
Log:
Modified market residuals test case because of new API

Modified: pkg/inst/tests/test_marketresiduals.R
===================================================================
--- pkg/inst/tests/test_marketresiduals.R	2013-08-09 11:13:42 UTC (rev 122)
+++ pkg/inst/tests/test_marketresiduals.R	2013-08-09 12:35:27 UTC (rev 123)
@@ -4,10 +4,12 @@
 library(eventstudies)
 
 load(system.file("data", "StockPriceReturns.rda", package = "eventstudies"))
+load(system.file("data", "nifty.index.rda", package = "eventstudies"))
 
-mm.result <- marketResidual(data.object=StockPriceReturns[,c("BHEL","nifty")],
-                            market.name="nifty")
-mm.result <- mm.result[complete.cases(mm.result),]
+mm.result <- marketResidual(firm.returns=StockPriceReturns[,c("BHEL")],
+                            market.returns=nifty.index)
+mm.result <- xts(mm.result[complete.cases(mm.result),])
+colnames(mm.result) <- "BHEL"
 
 # Calculating manually
 result <- lm(BHEL ~ nifty, data=StockPriceReturns)



More information about the Eventstudies-commits mailing list