[Eventstudies-commits] r363 - in pkg: R inst/tests man vignettes
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri May 23 19:19:46 CEST 2014
Author: chiraganand
Date: 2014-05-23 19:19:46 +0200 (Fri, 23 May 2014)
New Revision: 363
Modified:
pkg/R/eesInference.R
pkg/R/eventstudy.R
pkg/inst/tests/test_interfaces.R
pkg/man/eventstudy.Rd
pkg/vignettes/eventstudies.Rnw
Log:
Changed the width argument to event.window, its more intuitive.
Modified: pkg/R/eesInference.R
===================================================================
--- pkg/R/eesInference.R 2014-05-16 20:49:54 UTC (rev 362)
+++ pkg/R/eesInference.R 2014-05-23 17:19:46 UTC (rev 363)
@@ -729,23 +729,23 @@
# Good days
inf$good.normal <- eventstudy(input, eventList=eventLists$events.good.normal,
type="None", to.remap=to.remap,
- remap=remap, width=width, inference=inference,
+ remap=remap, event.window=width, inference=inference,
inference.strategy=inference.strategy)
# Bad days
inf$bad.normal <- eventstudy(input, eventList=eventLists$events.bad.normal,
type="None", to.remap=to.remap,
- remap=remap, width=width, inference=inference,
+ remap=remap, event.window=width, inference=inference,
inference.strategy=inference.strategy)
## Purged
# Good days
inf$good.purged <- eventstudy(input, eventList=eventLists$events.good.purged,
type="None", to.remap=to.remap,
- remap=remap, width=width, inference=inference,
+ remap=remap, event.window=width, inference=inference,
inference.strategy=inference.strategy)
# Bad days
inf$bad.purged <- eventstudy(input, eventList=eventLists$events.bad.purged,
type="None", to.remap=to.remap,
- remap=remap, width=width, inference=inference,
+ remap=remap, event.window=width, inference=inference,
inference.strategy=inference.strategy)
class(inf) <- "ees"
Modified: pkg/R/eventstudy.R
===================================================================
--- pkg/R/eventstudy.R 2014-05-16 20:49:54 UTC (rev 362)
+++ pkg/R/eventstudy.R 2014-05-23 17:19:46 UTC (rev 363)
@@ -1,6 +1,6 @@
eventstudy <- function(firm.returns,
eventList,
- width = 10,
+ event.window = 10,
is.levels = FALSE,
type = "marketResidual",
to.remap = TRUE,
@@ -104,7 +104,7 @@
es.w <- NULL
cn.names <- character(length = 0)
} else {
- es.w <- window(es$z.e, start = -width, end = width)
+ es.w <- window(es$z.e, start = -event.window, end = event.window)
# Adding column names to event output
cn.names <- eventList[which(es$outcomes=="success"),1]
}
@@ -156,7 +156,7 @@
outcomes = as.character(es$outcomes))
attr(final.result, which = "inference") <- inference.strategy
- attr(final.result, which = "width") <- width
+ attr(final.result, which = "event.window") <- event.window
attr(final.result, which = "remap") <- remapping
class(final.result) <- "es"
Modified: pkg/inst/tests/test_interfaces.R
===================================================================
--- pkg/inst/tests/test_interfaces.R 2014-05-16 20:49:54 UTC (rev 362)
+++ pkg/inst/tests/test_interfaces.R 2014-05-23 17:19:46 UTC (rev 363)
@@ -20,7 +20,7 @@
drop = FALSE]
test_es <- eventstudy(firm.returns = test_returns,
eventList = test_events,
- width = 3,
+ event.window = 3,
model.args = list(market.returns = NiftyIndex))
expect_that(expected_mean, equals(test_es$eventstudy.output[, "Mean"]))
@@ -41,7 +41,7 @@
drop = FALSE]
test_es <- eventstudy(firm.returns = test_returns,
eventList = test_events,
- width = 3,
+ event.window = 3,
type = "None")
expect_that(expected_mean, equals(test_es$eventstudy.output[, "Mean"]))
@@ -63,7 +63,7 @@
test_others <- USDINR
test_es <- eventstudy(firm.returns = test_returns,
eventList = test_events,
- width = 3,
+ event.window = 3,
type = "lmAMM",
model.args = list(market.returns = NiftyIndex[index(USDINR)],
others = test_others))
@@ -86,7 +86,7 @@
test_es <- eventstudy(firm.returns = test_returns,
eventList = test_events,
- width = 3,
+ event.window = 3,
type = "excessReturn",
model.args = list(market.returns = NiftyIndex))
@@ -105,14 +105,14 @@
## cumsum
test_es <- eventstudy(firm.returns = test_returns,
eventList = test_events,
- width = 3,
+ event.window = 3,
type = "None",
to.remap = FALSE,
remap = "cumsum")
test_es_remap <- eventstudy(firm.returns = test_returns,
eventList = test_events,
- width = 3,
+ event.window = 3,
type = "None",
to.remap = TRUE,
remap = "cumsum")
@@ -122,14 +122,14 @@
## cumprod
test_es <- eventstudy(firm.returns = test_returns,
eventList = test_events,
- width = 3,
+ event.window = 3,
type = "None",
to.remap = FALSE,
remap = "cumprod")
test_es_remap <- eventstudy(firm.returns = test_returns,
eventList = test_events,
- width = 3,
+ event.window = 3,
type = "None",
to.remap = TRUE,
remap = "cumprod")
@@ -141,14 +141,14 @@
## bootstrap
test_es_inference <- eventstudy(firm.returns = test_returns,
eventList = test_events,
- width = 3,
+ event.window = 3,
type = "None",
inference = TRUE,
inference.strategy = "bootstrap")
test_es <- eventstudy(firm.returns = test_returns,
eventList = test_events,
- width = 3,
+ event.window = 3,
type = "None",
inference = FALSE,
inference.strategy = "bootstrap")
@@ -158,14 +158,14 @@
## wilcoxon
test_es_inference <- eventstudy(firm.returns = test_returns,
eventList = test_events,
- width = 3,
+ event.window = 3,
type = "None",
inference = TRUE,
inference.strategy = "wilcoxon")
test_es <- eventstudy(firm.returns = test_returns,
eventList = test_events,
- width = 3,
+ event.window = 3,
type = "None",
inference = FALSE,
inference.strategy = "wilcoxon")
@@ -184,6 +184,6 @@
test_returns<- StockPriceReturns$ONGC
expect_error(eventstudy(firm.returns = test_returns,
eventList = test_events,
- width = 3,
+ event.window = 3,
type = "None"))
})
Modified: pkg/man/eventstudy.Rd
===================================================================
--- pkg/man/eventstudy.Rd 2014-05-16 20:49:54 UTC (rev 362)
+++ pkg/man/eventstudy.Rd 2014-05-23 17:19:46 UTC (rev 363)
@@ -14,7 +14,7 @@
\usage{
eventstudy(firm.returns,
eventList,
- width = 10,
+ event.window = 10,
is.levels = FALSE,
type = "marketResidual",
to.remap = TRUE,
@@ -35,7 +35,7 @@
series from \sQuote{firm.returns} (colname \dQuote{name}).
}
- \item{width}{an \sQuote{integer} of length 1 that specifies a
+ \item{event.window}{an \sQuote{integer} of length 1 that specifies a
symmetric event window around the event date.
}
@@ -190,7 +190,7 @@
strategy was utilised to estimate the confidence intervals.
}
- \item{\dQuote{width}:}{
+ \item{\dQuote{event.window}:}{
a \sQuote{numeric} specifying the window width for event study output.
}
@@ -226,7 +226,7 @@
# Event study without adjustment
es <- eventstudy(firm.returns = StockPriceReturns,
eventList = SplitDates,
- width = 10,
+ event.window = 10,
type = "None",
to.remap = TRUE,
remap = "cumsum",
@@ -238,7 +238,7 @@
# Event study using Market Model
es <- eventstudy(firm.returns = StockPriceReturns,
eventList = SplitDates,
- width = 10,
+ event.window = 10,
type = "marketResidual",
to.remap = TRUE,
remap = "cumsum",
@@ -258,7 +258,7 @@
es <- eventstudy(firm.returns = StockPriceReturns,
eventList = events,
- width = 10,
+ event.window = 10,
type = "lmAMM",
to.remap = TRUE,
remap = "cumsum",
Modified: pkg/vignettes/eventstudies.Rnw
===================================================================
--- pkg/vignettes/eventstudies.Rnw 2014-05-16 20:49:54 UTC (rev 362)
+++ pkg/vignettes/eventstudies.Rnw 2014-05-23 17:19:46 UTC (rev 363)
@@ -81,7 +81,7 @@
<<no-adjustment>>=
es <- eventstudy(firm.returns = StockPriceReturns,
eventList = SplitDates,
- width = 10,
+ event.window = 10,
type = "None",
to.remap = TRUE,
remap = "cumsum",
@@ -172,7 +172,7 @@
data(OtherReturns)
es.mm <- eventstudy(firm.returns = StockPriceReturns,
eventList = SplitDates,
- width = 10,
+ event.window = 10,
type = "marketResidual",
to.remap = TRUE,
remap = "cumsum",
@@ -230,7 +230,7 @@
<<amm-adjustment>>=
es.amm <- eventstudy(firm.returns = StockPriceReturns,
eventList = SplitDates,
- width = 10,
+ event.window = 10,
type = "lmAMM",
to.remap = TRUE,
remap = "cumsum",
More information about the Eventstudies-commits
mailing list