[Eventstudies-commits] r114 - pkg/vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Aug 6 13:08:14 CEST 2013


Author: vikram
Date: 2013-08-06 13:08:14 +0200 (Tue, 06 Aug 2013)
New Revision: 114

Modified:
   pkg/vignettes/eventstudies.Rnw
Log:
Added some code in vignette and minor modifications

Modified: pkg/vignettes/eventstudies.Rnw
===================================================================
--- pkg/vignettes/eventstudies.Rnw	2013-08-06 08:58:42 UTC (rev 113)
+++ pkg/vignettes/eventstudies.Rnw	2013-08-06 11:08:14 UTC (rev 114)
@@ -115,7 +115,7 @@
 \section{Software approach} \label{s:approach}
 The package offers the following functionalities:
 
- \item Models for calculating returns. These include:
+ Models for calculating returns. These include:
    \begin{itemize}
    \item Excess returns model  
    \item Market residual model
@@ -189,14 +189,22 @@
 regressand <- cbind(Company_A,Company_B,Company_C)
 
 ## AMM output
-of <- AMM(amm.type="all",rj=Company_A,
-          nlags=NA,
-          verbose=TRUE,
-          dates= as.Date(c("2005-01-15","2006-01-07","2007-01-06",
-            "2008-01-05","2009-01-03")),
-          rM1=NIFTY_INDEX, others=INRUSD,
-          switch.to.innov=TRUE, rM1purge=TRUE, nlags=1)
+## With no structural break dates: dates=NULL
+result1 <- AMM(amm.type="all",rj=y3c3$Company_A,
+           verbose=TRUE,
+           dates= NULL,
+           rM1=y3c3$NIFTY_INDEX, others=y3c3$INRUSD,
+           switch.to.innov=TRUE, rM1purge=TRUE, nlags=1)
 
+## With AMM different structural periods  
+result2 <- AMM(amm.type="all",rj=Company_A,
+               nlags=NA,
+               verbose=TRUE,
+               dates= as.Date(c("2005-01-15","2006-01-07","2007-01-06",
+                 "2008-01-05","2009-01-03")),
+               rM1=NIFTY_INDEX, others=INRUSD,
+               switch.to.innov=TRUE, rM1purge=TRUE, nlags=1)
+
 @ 
 \subsection{Converting physical dates to event frame}
 The first step towards event study analysis is to convert the physical
@@ -230,7 +238,7 @@
 
 In this example, es.w contains the returns in event-time form for all
 the stocks. In this you only get variables for whom all data is
-avaialable. 
+available. 
 
 \subsection{Remapping event frame}
 In event study analysis the variable of interest is cumulative
@@ -274,7 +282,7 @@
 \subsubsection{Wilcoxon signed rank tests}
 It is a non-parametric inference test to compute confidence interval.
 <<>>=
-result <- inference.bootstrap(es.w=es.cs, to.plot=TRUE)
+result <- inference.wilcox(es.w=es.cs, to.plot=TRUE)
 @ 
 \begin{figure}[t]
   \begin{center}
@@ -327,24 +335,6 @@
 cn.names <- which(colnames(all.data)%in%c("nifty","inr"))
 stock.data <- all.data[,-cn.names]
 
-of <- AMM(amm.type="residual",rj=y3c3$Company_A,
-            verbose=TRUE,
-            dates= as.Date(c("2005-01-15","2006-01-07","2007-01-06",
-                       "2008-01-05","2009-01-03")),
-           rM1=y3c3$NIFTY_INDEX, others=y3c3$INRUSD,
-           switch.to.innov=TRUE, rM1purge=TRUE, nlags=1)
-
-of1 <- AMM(amm.type="all",rj=y3c3$Company_A,
-           verbose=TRUE,
-           dates= NULL,
-           rM1=y3c3$NIFTY_INDEX, others=y3c3$INRUSD,
-           switch.to.innov=TRUE, rM1purge=TRUE, nlags=1)
-
-
-of.r <- AMM(amm.type="residual", rj=stock.data[,1:5],verbose=TRUE, dates=NULL, 
-            rM1=all.data$nifty, others=all.data$inr, switch.to.innov=TRUE,
-            rM1purge=TRUE, nlags=1)
-
 es.amm <- eventstudy(inputData = stock.data, 
                      eventList = SplitDates, 
                      width = 10, to.remap = TRUE, remap = "cumsum", 



More information about the Eventstudies-commits mailing list