[Eventstudies-commits] r409 - in pkg: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Mar 13 12:33:00 CET 2015


Author: chiraganand
Date: 2015-03-13 12:33:00 +0100 (Fri, 13 Mar 2015)
New Revision: 409

Modified:
   pkg/R/eventstudy.R
   pkg/man/eventstudy.Rd
Log:
Updated documentation. Added explanation of estimation data missing, event period, and the whole event study process.

Modified: pkg/R/eventstudy.R
===================================================================
--- pkg/R/eventstudy.R	2015-03-13 10:46:56 UTC (rev 408)
+++ pkg/R/eventstudy.R	2015-03-13 11:33:00 UTC (rev 409)
@@ -33,7 +33,7 @@
   stopifnot(!is.null(remap))
 
                                         # compute estimation and event period
-  ## :DOC: event period starts from event time + 1
+                                        # event period starts from event time + 1
   event.period <- as.character((-event.window + 1):event.window)
 
 ### Run models
@@ -109,7 +109,7 @@
       null.values <- sapply(outputModel, is.null)
       if (length(which(null.values)) > 0) {
         outputModel <- outputModel[names(which(!null.values))]
-        outcomes[names(which(null.values))] <- "edatamissing" #:DOC: edatamissing: estimation data missing
+        outcomes[names(which(null.values))] <- "edatamissing" # estimation data missing
       }
 
       if (length(outputModel) == 0) {
@@ -253,7 +253,7 @@
   } ## end None
 
 
-  if (is.null(outputModel)) {           #:DOC
+  if (is.null(outputModel)) {
     final.result <- list(result = NULL,
                          outcomes = as.character(outcomes))
     class(final.result) <- "es"
@@ -298,7 +298,7 @@
   final.result <- list(result = outputModel,
                        outcomes = as.character(outcomes))
 
-  if (exists("outputResiduals")) {      # :DOC
+  if (exists("outputResiduals")) {
     attr(final.result, which = "model.residuals") <- outputResiduals
   }
   attr(final.result, which = "event.window") <- event.window
@@ -324,7 +324,7 @@
   returns.zoo <- lapply(1:nrow(event.list), function(i) {
     cat("i:", i, "\n")
     firm.name <- event.list[i, "name"]
-      ## :DOC:to pick out the common dates of data. can't work on
+      ## to pick out the common dates of data. can't work on
       ## event time if the dates of data do not match before
       ## converting to event time.
                                         # all = FALSE: pick up dates

Modified: pkg/man/eventstudy.Rd
===================================================================
--- pkg/man/eventstudy.Rd	2015-03-13 10:46:56 UTC (rev 408)
+++ pkg/man/eventstudy.Rd	2015-03-13 11:33:00 UTC (rev 409)
@@ -36,7 +36,8 @@
   }
 
   \item{event.window}{an \sQuote{integer} of length 1 that specifies a
-    symmetric event window around the event date.
+    symmetric event window around the event time as specified in the
+    \code{index} of \dQuote{firm.returns}.
   }
 
   \item{type}{
@@ -82,9 +83,44 @@
   }
 }
 
-\details{
-  \dQuote{firm.returns} can contain only one series. To study a single
-  series, use \sQuote{[} with \code{drop = FALSE} for subsetting the
+\details{ This function is used to conduct event study analysis acting
+  as a wrapper over the functionality provided in the \pkg{eventstudies}
+  package. It provides an interface to select and control the process of
+  event study analysis. It includes choice of the statistical model for
+  doing in-sample estimation and computing coefficients, choice of
+  cumulative returns, and selection of inference procedure. Process used
+  to conduct a study is detailed below:
+
+  \enumerate{
+    \item{event.period: is defined as (-event.window, event.window].}
+
+    \item{estimation.period: If \dQuote{type} is specified, then
+      estimation.period is calculated for each firm-event in
+      \dQuote{event.list}, starting from the start of the data span till
+      the start of event period (inclusive).}
+
+    \item{For each firm-event, firm returns and other returns (as
+      applicable) are converted to event time using
+      \sQuote{phys2eventtime}. Data is merged using \sQuote{merge.zoo}
+      to make sure the indexes are consistent before conversion to event
+      time.}
+
+    \item{The selected model \dQuote{type} is run on the series indexed
+      by event time and abnormal returns are computed.}
+
+    \item{NULL values because of estimation data missing are removed
+      from the output and \dQuote{outcomes} object is updated with
+      \dQuote{edatamissing}.}
+
+    \item{Remapping is done if \dQuote{to.remap} is TRUE using
+      value of \dQuote{remap} argument.}
+
+    \item{Inference is done if \dQuote{inference} is TRUE using the
+      technique mentioned in \dQuote{inference.strategy}.}
+  }
+
+  \dQuote{firm.returns} can contain a single series also. To study a single
+  series, use \sQuote{[} with \code{drop = FALSE} to subset the
   data set. See \code{\link{phys2eventtime}} for more details.
 
   \sQuote{NA} values in the returns data are converted to \code{0}.
@@ -179,18 +215,30 @@
           event. This will not appear when this function is used since the
           argument \sQuote{width} in \code{\link{phys2eventtime}} is set to 0.}
         \item{wrongspan: if event date falls outside the range of physical date.}
-        \item{unitmissing: when the unit (firm name) is missing in the event list.}
+        \item{unitmissing: when the unit (firm name) is missing in the
+          event list.}
+        \item{edatamissing: when there is insufficient data to do model
+        estimation.}
       }
     }
   }
 
   The returned object contains input information in other attributes:
   \itemize{
+    \item{\dQuote{model.residuals}:}{
+      a \sQuote{list} of residual series as returned by the selected
+      model. For models which do not compute residuals, this attribute is
+      not returned.}
+
     \item{\dQuote{inference}:}{
       a \sQuote{character} providing information about which inference
       strategy was utilised to estimate the confidence intervals.
     }
 
+    \item{\dQuote{inference.strategy}:}{
+      a \sQuote{character} providing the name of the selected model.
+    }
+
     \item{\dQuote{event.window}:}{
       a \sQuote{numeric} specifying the window width for event study output.
     }
@@ -267,7 +315,7 @@
                         others = OtherReturns[, "USDINR"],
                         market.returns.purge = TRUE,
                         nlag.makeX = 5,
-                        nlag.lmAMM = NULL
+                        nlag.lmAMM = 5
                         )
                  )
 str(es)



More information about the Eventstudies-commits mailing list