[Eventstudies-commits] r61 - in pkg: . R man vignettes
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Apr 29 23:04:41 CEST 2013
Author: vikram
Date: 2013-04-29 23:04:41 +0200 (Mon, 29 Apr 2013)
New Revision: 61
Added:
pkg/man/eesPlot.Rd
Modified:
pkg/NAMESPACE
pkg/R/ees.R
pkg/vignettes/ees.Rnw
Log:
Added eesPlot, ees functionality together in ess.R
Modified: pkg/NAMESPACE
===================================================================
--- pkg/NAMESPACE 2013-04-29 20:46:01 UTC (rev 60)
+++ pkg/NAMESPACE 2013-04-29 21:04:41 UTC (rev 61)
@@ -1,3 +1,3 @@
-export(inference.Ecar, phys2eventtime, remap.cumsum, remap.cumprod, remap.event.reindex, ees, eesPlot, deprintize)
+export(inference.Ecar, phys2eventtime, remap.cumsum, remap.cumprod, remap.event.reindex, ees, eesPlot)
Modified: pkg/R/ees.R
===================================================================
--- pkg/R/ees.R 2013-04-29 20:46:01 UTC (rev 60)
+++ pkg/R/ees.R 2013-04-29 21:04:41 UTC (rev 61)
@@ -62,6 +62,7 @@
probvalue=prob.value,
event.value="nonreturns",
response.value="nonreturns")
+
tail.events <- tmp[which(tmp$left.tail==1 | tmp$right.tail==1),]
clustered.tail.events <- tmp[which(tmp$cluster.pattern>1),]
unclustered.tail.events <- tmp[-which(tmp$cluster.pattern>1),]
@@ -765,8 +766,8 @@
response.series=r.s,
probvalue=prob.value,
event.value="nonreturns",
- response.value="nonreturns",
- result="series")
+ response.value="nonreturns")
+
# Get only unclustered data
data.frmt <- data.use[which(data.use$cluster.pattern==1),]
data.frmt2 <- data.use[which(data.use$cluster.pattern!=0),]
Added: pkg/man/eesPlot.Rd
===================================================================
--- pkg/man/eesPlot.Rd (rev 0)
+++ pkg/man/eesPlot.Rd 2013-04-29 21:04:41 UTC (rev 61)
@@ -0,0 +1,35 @@
+\name{eesPlot}
+\alias{eesPlot}
+
+\title{
+Plotting clustered and unclustered extreme event study plot.
+}
+
+\description{
+This function generates an extreme event study plot by marking extreme events and fusing clustered events together. It plots event study plot for lower tail and upper tail events. Tail events are defined as per given probability value. The value of the event series and response series should be in returns.
+ }
+
+\usage{
+eesPlot(z, response.series.name, event.series.name, titlestring, ylab, width, prob.value)
+}
+
+\arguments{
+ \item{z}{Data object with both response and event series on which event study is to be performed}
+ \item{response.series.name}{Column name of the series in 'z' on which response is to be observed }
+ \item{event.series.name}{Column name of the series in 'z' on which event is to be observed }
+ \item{titlestring}{Title for event study plot: Preferred to be response series name}
+ \item{ylab}{Y-axis label}
+ \item{width}{Width for event study plot}
+ \item{prob.value}{It is the tail value on the basis of which the
+ extreme event are defined. For eg: prob.value of 5 will consider 5\% tail on both sides.}
+}
+
+\value{
+ It gives an extreme event study plot for very bad (lower tail) and very good (upper tail) events on event series.
+}
+
+\examples{
+library(eventstudies)
+data(eesData)
+eesPlot(z=eesData, response.series.name="nifty", event.series.name="sp500",titlestring="S&P500", ylab="(Cum.) change in NIFTY")
+}
Modified: pkg/vignettes/ees.Rnw
===================================================================
--- pkg/vignettes/ees.Rnw 2013-04-29 20:46:01 UTC (rev 60)
+++ pkg/vignettes/ees.Rnw 2013-04-29 21:04:41 UTC (rev 61)
@@ -152,7 +152,11 @@
\setkeys{Gin}{height=0.8\linewidth}
<<label=fig12,fig=TRUE,echo=FALSE>>=
<<fig12plot>>
-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=15
+# Suppress the messages
+ deprintize<-function(f){
+ return(function(...) {capture.output(w<-f(...));return(w);});
+ }
+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}
More information about the Eventstudies-commits
mailing list