[Eventstudies-commits] r160 - pkg/vignettes
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu Jan 16 12:09:57 CET 2014
Author: vikram
Date: 2014-01-16 12:09:57 +0100 (Thu, 16 Jan 2014)
New Revision: 160
Modified:
pkg/vignettes/ees.Rnw
pkg/vignettes/eventstudies.Rnw
Log:
Corrected errors in the vignette
Modified: pkg/vignettes/ees.Rnw
===================================================================
--- pkg/vignettes/ees.Rnw 2014-01-15 08:54:03 UTC (rev 159)
+++ pkg/vignettes/ees.Rnw 2014-01-16 11:09:57 UTC (rev 160)
@@ -123,7 +123,8 @@
The overall dataset looks as follows:
<<>>==
-head(output$lower.tail$data) str(output$lower.tail$data)
+head(output$lower.tail$data)
+str(output$lower.tail$data)
@
\subsection{Distribution of clustered and unclustered events}
@@ -210,9 +211,7 @@
days before and after the event.
<<>>=
-eesPlot(z=eesData, response.series.name="nifty",
-event.series.name="sp500", titlestring="S&P500", ylab="(Cum.) change
-in NIFTY", prob.value=5, width=5)
+eesPlot(z=eesData, response.series.name="nifty", event.series.name="sp500", titlestring="S&P500", ylab="(Cum.) change in NIFTY", prob.value=5, width=5)
@
\begin{figure}[t]
@@ -221,11 +220,11 @@
\setkeys{Gin}{width=1\linewidth}
\setkeys{Gin}{height=0.8\linewidth}
<<fig=TRUE,echo=FALSE>>=
- res <- deprintize(eesPlot)(z=eesData, response.series.name="nifty",
- event.series.name="sp500",
- titlestring="S&P500",
- ylab="(Cum.) change in NIFTY",
- prob.value=5, width=5)
+res <- deprintize(eesPlot)(z=eesData, response.series.name="nifty",
+ event.series.name="sp500",
+ titlestring="S&P500",
+ ylab="(Cum.) change in NIFTY",
+ prob.value=5, width=5)
@
\end{center}
\label{fig:one}
Modified: pkg/vignettes/eventstudies.Rnw
===================================================================
--- pkg/vignettes/eventstudies.Rnw 2014-01-15 08:54:03 UTC (rev 159)
+++ pkg/vignettes/eventstudies.Rnw 2014-01-16 11:09:57 UTC (rev 160)
@@ -171,18 +171,15 @@
and \texttt{mm.result} respectively. These are the standard
idiosyncratic return estimation that is possible with this package.
-<<>>= # Excess return er.result <- excessReturn(firm.returns =
-StockPriceReturns, market.returns = nifty.index)
-
+<<>>= # Excess return
+er.result <- excessReturn(firm.returns = StockPriceReturns, market.returns = nifty.index)
er.result <- er.result[rowSums(is.na(er.result))!=NCOL(er.result),]
head(er.result[,1:3])
@
-<<>>= # Extracting market residual mm.result <-
-marketResidual(firm.returns = StockPriceReturns, market.returns =
-nifty.index)
-
+<<>>= # Extracting market residual
+mm.result <- marketResidual(firm.returns = StockPriceReturns, market.returns = nifty.index)
mm.result <- mm.result[rowSums(is.na(mm.result))!=NCOL(mm.result),]
head(mm.result[,1:3])
@@ -206,16 +203,16 @@
regression appropriately.
% AMM model
-<<>>= # Create RHS before running AMM() data(inr) inrusd <-
-diff(log(inr))*100 all.data <-
-merge(StockPriceReturns,nifty.index,inrusd,all=TRUE) StockPriceReturns
-<- all.data[,-which(colnames(all.data)%in%c("nifty.index",
-"inr"))] nifty.index <- all.data$nifty.index inrusd <- all.data$inr
+<<>>= # Create RHS before running AMM()
+data(inr)
+inrusd <- diff(log(inr))*100
+all.data <- merge(StockPriceReturns,nifty.index,inrusd,all=TRUE)
+StockPriceReturns <- all.data[,-which(colnames(all.data)%in%c("nifty.index", "inr"))]
+nifty.index <- all.data$nifty.index
+inrusd <- all.data$inr
-## AMM output ## amm.residual <-
-AMM(firm.returns=StockPriceReturns[,1:3], verbose=FALSE,
-market.returns=nifty.index, others=inrusd, switch.to.innov=TRUE,
-market.returns.purge=TRUE, nlags=1)
+## AMM output ##
+amm.residual <- AMM(firm.returns=StockPriceReturns[,1:3], verbose=FALSE, market.returns=nifty.index, others=inrusd, switch.to.innov=TRUE, market.returns.purge=TRUE, nlags=1)
@
@@ -225,7 +222,7 @@
<<>>=
es <- phys2eventtime(z=StockPriceReturns, events=SplitDates,
-width=10)
+ width=10)
str(es)
es$outcomes
es.w <- window(es$z.e, start=-10,end=10)
More information about the Eventstudies-commits
mailing list