[Eventstudies-commits] r291 - pkg/man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Apr 22 07:22:17 CEST 2014
Author: vikram
Date: 2014-04-22 07:22:17 +0200 (Tue, 22 Apr 2014)
New Revision: 291
Modified:
pkg/man/ees.Rd
pkg/man/eesPlot.Rd
pkg/man/excessReturn.Rd
pkg/man/inference.bootstrap.Rd
pkg/man/inference.wilcox.Rd
pkg/man/lmAMM.Rd
pkg/man/makeX.Rd
pkg/man/marketResidual.Rd
pkg/man/phys2eventtime.Rd
pkg/man/remap.cumprod.Rd
pkg/man/remap.cumsum.Rd
pkg/man/remap.event.reindex.Rd
pkg/man/subperiod.lmAMM.Rd
Log:
Modified manual examples
Modified: pkg/man/ees.Rd
===================================================================
--- pkg/man/ees.Rd 2014-04-17 11:04:40 UTC (rev 290)
+++ pkg/man/ees.Rd 2014-04-22 05:22:17 UTC (rev 291)
@@ -89,11 +89,12 @@
\author{Vikram Bahure}
-
\examples{
library(eventstudies)
data(EESData)
-input <- EESData$sp500 ## Input S&P 500 as the univariate series
-output <- ees(input, prob.value = 5) ## Estimate 5\% tails.
+## Input S&P 500 as the univariate series
+input <- EESData$sp500
+## Constructing summary statistics for 5% tail values (5% on both sides)
+output <- ees(input, prob.value = 5)
str(output)
}
Modified: pkg/man/eesPlot.Rd
===================================================================
--- pkg/man/eesPlot.Rd 2014-04-17 11:04:40 UTC (rev 290)
+++ pkg/man/eesPlot.Rd 2014-04-22 05:22:17 UTC (rev 291)
@@ -69,6 +69,7 @@
\examples{
library(eventstudies)
data(EESData)
+## Generating event study plots (using modified event study methodology)
eesPlot(z = EESData,
response.series.name = "nifty",
event.series.name = "sp500",
Modified: pkg/man/excessReturn.Rd
===================================================================
--- pkg/man/excessReturn.Rd 2014-04-17 11:04:40 UTC (rev 290)
+++ pkg/man/excessReturn.Rd 2014-04-22 05:22:17 UTC (rev 291)
@@ -26,10 +26,14 @@
\examples{
data(StockPriceReturns)
data(NiftyIndex)
+
+## Excess return
er.result <- excessReturn(firm.returns = StockPriceReturns,
market.returns = NiftyIndex)
-output <- merge(er.result$Infosys,StockPriceReturns$Infosys,NiftyIndex,all=FALSE)
-colnames(output) <- c("excess.return","raw.returns","nifty.returns")
+
+## Checking output: Comparing excess return, raw returns, nifty returns
+output <- merge(er.result$Infosys, StockPriceReturns$Infosys, NiftyIndex,all=FALSE)
+colnames(output) <- c("excess.return", "raw.returns", "nifty.returns")
tail(output)
}
Modified: pkg/man/inference.bootstrap.Rd
===================================================================
--- pkg/man/inference.bootstrap.Rd 2014-04-17 11:04:40 UTC (rev 290)
+++ pkg/man/inference.bootstrap.Rd 2014-04-22 05:22:17 UTC (rev 291)
@@ -59,7 +59,7 @@
\examples{
data(StockPriceReturns)
data(SplitDates)
-
+## Converting physical dates to event time frame
es.results <- phys2eventtime(z = StockPriceReturns,
events = SplitDates,
width = 5)
@@ -67,8 +67,10 @@
start = -5,
end = +5)
+## Cumulating event window
eventtime <- remap.cumsum(es.w, is.pc = FALSE, base = 0)
+## Constructing confidence interval using bootstrap inference strategy
inference.bootstrap(es.w = eventtime,
to.plot = FALSE)
}
Modified: pkg/man/inference.wilcox.Rd
===================================================================
--- pkg/man/inference.wilcox.Rd 2014-04-17 11:04:40 UTC (rev 290)
+++ pkg/man/inference.wilcox.Rd 2014-04-22 05:22:17 UTC (rev 291)
@@ -55,10 +55,14 @@
\examples{
data(StockPriceReturns)
data(SplitDates)
+## Converting physical dates to event time frame
es.results <- phys2eventtime(z = StockPriceReturns,
events = SplitDates,
width = 5)
es.w <- window(es.results$z.e, start = -5, end = +5)
+
+## Cumulating event window
eventtime <- remap.cumsum(es.w, is.pc = FALSE, base = 0)
+## Constructing confidence interval using wilcoxon inference strategy
inference.wilcox(es.w = eventtime, to.plot = FALSE)
}
Modified: pkg/man/lmAMM.Rd
===================================================================
--- pkg/man/lmAMM.Rd 2014-04-17 11:04:40 UTC (rev 290)
+++ pkg/man/lmAMM.Rd 2014-04-22 05:22:17 UTC (rev 291)
@@ -90,13 +90,16 @@
market.returns.purge = FALSE,
verbose = FALSE)
+## Augmented market model residual
amm.result <- lmAMM(firm.returns, X, nlags = 0, verbose = FALSE)
names(amm.result)
amm.residual <- residuals(amm.result)
amm.result <- zoo(amm.residual,as.Date(names(amm.residual)))
-output <- merge(amm.result,StockPriceReturns$Infosys,NiftyIndex,all=FALSE)
-colnames(output) <- c("amm.residual","raw.returns","nifty.returns")
+## Checking output: Comparing augmented market model residual, raw returns, nifty returns
+output <- merge(amm.result, StockPriceReturns$Infosys, NiftyIndex,
+ all=FALSE)
+colnames(output) <- c("amm.residual", "raw.returns", "nifty.returns")
tail(output)
}
Modified: pkg/man/makeX.Rd
===================================================================
--- pkg/man/makeX.Rd 2014-04-17 11:04:40 UTC (rev 290)
+++ pkg/man/makeX.Rd 2014-04-22 05:22:17 UTC (rev 291)
@@ -76,10 +76,10 @@
\examples{
data("AMMData")
-
market.returns <- AMMData$index.nifty
currency.returns <- AMMData$currency.inrusd
+## Constructing regressors (independent variables) for AMM
X <- makeX(market.returns,
others = currency.returns,
switch.to.innov = FALSE,
Modified: pkg/man/marketResidual.Rd
===================================================================
--- pkg/man/marketResidual.Rd 2014-04-17 11:04:40 UTC (rev 290)
+++ pkg/man/marketResidual.Rd 2014-04-22 05:22:17 UTC (rev 291)
@@ -24,10 +24,14 @@
data(StockPriceReturns)
data(NiftyIndex)
+## Market model residual
mm.result <- marketResidual(firm.returns = StockPriceReturns,
market.returns = NiftyIndex)
-output <- merge(mm.result$Infosys,StockPriceReturns$Infosys,NiftyIndex,all=FALSE)
-colnames(output) <- c("market.residual","raw.returns","nifty.returns")
+
+## Checking output: Comparing market model residual, raw returns, nifty returns
+output <- merge(mm.result$Infosys, StockPriceReturns$Infosys, NiftyIndex,
+ all=FALSE)
+colnames(output) <- c("market.residual", "raw.returns", "nifty.returns")
tail(output)
}
Modified: pkg/man/phys2eventtime.Rd
===================================================================
--- pkg/man/phys2eventtime.Rd 2014-04-17 11:04:40 UTC (rev 290)
+++ pkg/man/phys2eventtime.Rd 2014-04-22 05:22:17 UTC (rev 291)
@@ -75,16 +75,19 @@
\examples{
data(StockPriceReturns)
data(SplitDates)
+
+## Converting physical dates to event time
result <- phys2eventtime(z = StockPriceReturns,
events = SplitDates,
width = 5)
+## Checking conversion to event time frame for first successful event date
c.no <- as.numeric(colnames(result$z.e))
cnames <- SplitDates[c.no[1],]
-phys.output <- as.numeric(result$z.e[as.character(c(-5:5)),as.character(c.no[1])])
-loc <- which(index(StockPriceReturns)%in%SplitDates[c.no[1],"event.when"])
-raw.data <- as.numeric(StockPriceReturns[c((loc-5):(loc+5)),SplitDates[c.no[1],"outcome.unit"]])
-check.output <- cbind(raw.data,phys.output)
+phys.output <- as.numeric(result$z.e[as.character(c(-5:5)), as.character(c.no[1])])
+loc <- which(index(StockPriceReturns)%in%SplitDates[c.no[1], "event.when"])
+raw.data <- as.numeric(StockPriceReturns[c((loc-5):(loc+5)), SplitDates[c.no[1], "outcome.unit"]])
+check.output <- cbind(raw.data, phys.output)
check.output
}
\keyword{phys2eventime}
Modified: pkg/man/remap.cumprod.Rd
===================================================================
--- pkg/man/remap.cumprod.Rd 2014-04-17 11:04:40 UTC (rev 290)
+++ pkg/man/remap.cumprod.Rd 2014-04-22 05:22:17 UTC (rev 291)
@@ -34,14 +34,23 @@
\examples{
data(StockPriceReturns)
data(SplitDates)
+
+## Converting to event time frame
es.results <- phys2eventtime(z = StockPriceReturns,
events = SplitDates,
width = 5)
es.w <- window(es.results$z.e, start = -5, end = +5)
+
+## Cumulating (geometric product) event window output
eventtime <- remap.cumprod(es.w,
is.pc = TRUE,
is.returns = TRUE,
base = 100)
+
+## Comparing abnormal returns (AR) and cumulative (geometric) abnormal returns (CAR)
+check.output <- cbind(es.w[,1], eventtime[,1])
+colnames(check.output) <- c("abnormal.returns", "cumulative.abnormal.returns")
+check.output
head(eventtime[,1:5])
}
Modified: pkg/man/remap.cumsum.Rd
===================================================================
--- pkg/man/remap.cumsum.Rd 2014-04-17 11:04:40 UTC (rev 290)
+++ pkg/man/remap.cumsum.Rd 2014-04-22 05:22:17 UTC (rev 291)
@@ -37,13 +37,18 @@
data(StockPriceReturns)
data(SplitDates)
+## Converting to event time frame
es.results <- phys2eventtime(z = StockPriceReturns,
events = SplitDates,
width = 5)
es.w <- window(es.results$z.e, start = -5, end = +5)
+
+## Cumulating (arithmetic) event window output
eventtime <- remap.cumsum(es.w, is.pc = FALSE, base = 0)
-check.output <- cbind(es.w[,1],eventtime[,1])
-colnames(check.output) <- c("abnormal.returns","cumulative.abnormal.returns")
+
+## Comparing abnormal returns (AR) and cumulative abnormal returns (CAR)
+check.output <- cbind(es.w[,1], eventtime[,1])
+colnames(check.output) <- c("abnormal.returns", "cumulative.abnormal.returns")
check.output
head(eventtime[,1:5])
}
Modified: pkg/man/remap.event.reindex.Rd
===================================================================
--- pkg/man/remap.event.reindex.Rd 2014-04-17 11:04:40 UTC (rev 290)
+++ pkg/man/remap.event.reindex.Rd 2014-04-22 05:22:17 UTC (rev 291)
@@ -26,10 +26,13 @@
data(StockPriceReturns)
data(SplitDates)
+## Converting to event time frame
es.results <- phys2eventtime(z = StockPriceReturns,
events = SplitDates,
width = 5)
es.w <- window(es.results$z.e, start = -5, end = +5)
+
+## Reindexing event time (t=0) to 100
eventtime <- remap.event.reindex(es.w)
head(eventtime[,1:5])
}
Modified: pkg/man/subperiod.lmAMM.Rd
===================================================================
--- pkg/man/subperiod.lmAMM.Rd 2014-04-17 11:04:40 UTC (rev 290)
+++ pkg/man/subperiod.lmAMM.Rd 2014-04-22 05:22:17 UTC (rev 291)
@@ -72,6 +72,7 @@
market.returns <- AMMData$index.nifty
currency.returns <- AMMData$currency.inrusd
+## Constructing regressors for AMM
regressors <- makeX(market.returns,
others = currency.returns,
switch.to.innov = TRUE,
More information about the Eventstudies-commits
mailing list