[Eventstudies-commits] r168 - / pkg/R pkg/man pkg/vignettes

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Feb 13 12:53:23 CET 2014


Author: vikram
Date: 2014-02-13 12:53:23 +0100 (Thu, 13 Feb 2014)
New Revision: 168

Added:
   pkg/man/manyfirmssubperiod.lmAMM.Rd
Removed:
   pkg/man/subperiodmanyfirms.lmAMM.Rd
Modified:
   pkg/R/lmAmm.R
   pkg/vignettes/amm.Rnw
   todo.org
Log:
Done with AMM functions moving on to eventstudies

Modified: pkg/R/lmAmm.R
===================================================================
--- pkg/R/lmAmm.R	2014-02-13 10:18:35 UTC (rev 167)
+++ pkg/R/lmAmm.R	2014-02-13 11:53:23 UTC (rev 168)
@@ -64,7 +64,7 @@
 ########################
 # Many firms AMM
 ########################
-subperiodmanyfirms.lmAMM <-
+manyfirmssubperiod.lmAMM <-
 function(regressand,regressors,
                           lags,dates=NULL, periodnames=NULL,verbose=FALSE){
   require("doMC")

Copied: pkg/man/manyfirmssubperiod.lmAMM.Rd (from rev 165, pkg/man/subperiodmanyfirms.lmAMM.Rd)
===================================================================
--- pkg/man/manyfirmssubperiod.lmAMM.Rd	                        (rev 0)
+++ pkg/man/manyfirmssubperiod.lmAMM.Rd	2014-02-13 11:53:23 UTC (rev 168)
@@ -0,0 +1,61 @@
+\name{manyfirmssubperiod.lmAMM}
+\alias{manyfirmssubperiod.lmAMM}
+
+\title{A function to compute AMM for multiple firms across several
+periods}
+
+\description{
+  This function will compute AMM for multiple firms at once using the
+  matrix of data obtained from \code{makeX}, and a matrix of LHS variables}
+
+\usage{
+manyfirmssubperiod.lmAMM(regressand, regressors, lags, dates = NULL, periodnames = NULL, verbose = FALSE)
+}
+
+\arguments{
+  \item{regressand}{A zoo matrix of all firms for which AMM is to
+  be computed}
+
+  \item{regressors}{A zoo matrix containing at least two
+  regressors generally obtained after applying the makeX function }
+
+  \item{lags}{ Specifies the number of lags to be used in the
+  market model} 
+
+  \item{dates}{A set of dates that mark out subperiods of
+  interest. If dates is NULL then full period is considered.} 
+
+  \item{periodnames}{Name for each subperiod that has been marked
+  by the dates above.} 
+
+  \item{verbose}{Whether detailed print while running this
+  function is required} 
+}
+
+\section{Warning}{Do not have any space between names provided under 'periodnames'}
+
+\author{Ajay Shah, Vimal Balasubramaniam}
+
+\seealso{
+\code{\link{onefirmAMM}}
+}
+
+\examples{
+# Running manyfirmssubperiod.lmAMM() involves as many steps as working with onefirmAMM. 
+data("lmAMMData")
+regressand <- lmAMMData[,c("Infosys","TCS")]
+market.returns <- lmAMMData[,"index.nifty"]
+currency.returns <- lmAMMData[,"currency.inrusd"]
+## Creating regressors for AMM estimation using makeX function
+regressors <- makeX(market.returns, others=currency.returns, nlags=1,
+              switch.to.innov=FALSE, market.returns.purge=FALSE, verbose=FALSE,
+	      dates=as.Date(c("2012-02-01","2013-01-01","2014-01-31")))
+## Estimating exposure
+res <- manyfirmssubperiod.lmAMM(regressand,regressors,lags=1,
+                     dates=as.Date(c("2012-02-01","2013-01-01","2014-01-31")),
+		     periodnames=c("P1","P2"),
+                     verbose=FALSE)
+print(res)
+}
+
+\keyword{manyfirmssubperiod.lmAMM}
\ No newline at end of file

Deleted: pkg/man/subperiodmanyfirms.lmAMM.Rd
===================================================================
--- pkg/man/subperiodmanyfirms.lmAMM.Rd	2014-02-13 10:18:35 UTC (rev 167)
+++ pkg/man/subperiodmanyfirms.lmAMM.Rd	2014-02-13 11:53:23 UTC (rev 168)
@@ -1,61 +0,0 @@
-\name{subperiodmanyfirms.lmAMM}
-\alias{subperiodmanyfirms.lmAMM}
-
-\title{A function to compute AMM for multiple firms across several
-periods}
-
-\description{
-  This function will compute AMM for multiple firms at once using the
-  matrix of data obtained from \code{makeX}, and a matrix of LHS variables}
-
-\usage{
-subperiodmanyfirms.lmAMM(regressand, regressors, lags, dates = NULL, periodnames = NULL, verbose = FALSE)
-}
-
-\arguments{
-  \item{regressand}{A zoo matrix of all firms for which AMM is to
-  be computed}
-
-  \item{regressors}{A zoo matrix containing at least two
-  regressors generally obtained after applying the makeX function }
-
-  \item{lags}{ Specifies the number of lags to be used in the
-  market model} 
-
-  \item{dates}{A set of dates that mark out subperiods of
-  interest. If dates is NULL then full period is considered.} 
-
-  \item{periodnames}{Name for each subperiod that has been marked
-  by the dates above.} 
-
-  \item{verbose}{Whether detailed print while running this
-  function is required} 
-}
-
-\section{Warning}{Do not have any space between names provided under 'periodnames'}
-
-\author{Ajay Shah, Vimal Balasubramaniam}
-
-\seealso{
-\code{\link{onefirmAMM}}
-}
-
-\examples{
-# Running subperiodmanyfirms.lmAMM() involves as many steps as working with onefirmAMM. 
-data("lmAMMData")
-regressand <- lmAMMData[,c("Infosys","TCS")]
-market.returns <- lmAMMData[,"index.nifty"]
-currency.returns <- lmAMMData[,"currency.inrusd"]
-## Creating regressors for AMM estimation using makeX function
-regressors <- makeX(market.returns, others=currency.returns, nlags=1,
-              switch.to.innov=FALSE, market.returns.purge=FALSE, verbose=FALSE,
-	      dates=as.Date(c("2012-02-01","2013-01-01","2014-01-31")))
-## Estimating exposure
-res <- subperiodmanyfirms.lmAMM(regressand,regressors,lags=1,
-                     dates=as.Date(c("2012-02-01","2013-01-01","2014-01-31")),
-		     periodnames=c("P1","P2"),
-                     verbose=FALSE)
-print(res)
-}
-
-\keyword{subperiodmanyfirms.lmAMM}
\ No newline at end of file

Modified: pkg/vignettes/amm.Rnw
===================================================================
--- pkg/vignettes/amm.Rnw	2014-02-13 10:18:35 UTC (rev 167)
+++ pkg/vignettes/amm.Rnw	2014-02-13 11:53:23 UTC (rev 168)
@@ -138,16 +138,12 @@
 \textit{nifty.index} (market returns).  
 <<>>= 
 # Create RHS before running AMM() 
-data(StockPriceReturns)
-data(SplitDates)
-data(nifty.index)
-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
+data("lmAMMData")
+firm.returns <- lmAMMData[,"Infosys"]
+market.returns <- lmAMMData[,"index.nifty"]
+currency.returns <- lmAMMData[,"currency.inrusd"]
+regressors <- makeX(market.returns, others=currency.returns,
+           switch.to.innov=FALSE, market.returns.purge=FALSE, verbose=FALSE)
 @
 
 Inputs into the \texttt{AMM} model also include \texttt{firm.returns}
@@ -157,10 +153,8 @@
  
 <<>>=
 # 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)
+res.amm <- lmAMM(firm.returns=firm.returns, X=regressors,
+                 verbose=FALSE, nlags=1)
 @
 
  We can also perform event study analysis, directly on AMM residuals

Modified: todo.org
===================================================================
--- todo.org	2014-02-13 10:18:35 UTC (rev 167)
+++ todo.org	2014-02-13 11:53:23 UTC (rev 168)
@@ -27,6 +27,7 @@
   - citation for Corrado (2011) seems misplaced in the beginning. It
     seems as though we are replicating his work on stock-splits, which
     isn't the case
+  - change the naming lmAMM and there is no more AMM wrapper  
 
 * man pages
   - modify ess.Rd: put reference to Patnaik, Shah, and Singh (2013)



More information about the Eventstudies-commits mailing list