[Eventstudies-commits] r89 - in pkg: R inst/tests
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Tue Jul 16 12:51:59 CEST 2013
Author: chiraganand
Date: 2013-07-16 12:51:59 +0200 (Tue, 16 Jul 2013)
New Revision: 89
Modified:
pkg/R/AMM.R
pkg/inst/tests/test_AMM.R
pkg/inst/tests/test_eventstudy.R
Log:
Did some cleanup on the testing output
Modified: pkg/R/AMM.R
===================================================================
--- pkg/R/AMM.R 2013-07-16 10:33:53 UTC (rev 88)
+++ pkg/R/AMM.R 2013-07-16 10:51:59 UTC (rev 89)
@@ -163,7 +163,6 @@
s.exposures=rep(NA,ncol(regressors)))
for(i in 1:ncol(regressand)){
- cat("Doing",colnames(regressand)[i])
if (verbose) {cat ("Doing", colnames(regressand)[i])}
rj <- regressand[,i]
dataset <- cbind(rj, regressors) # This is the full time-series
@@ -283,7 +282,6 @@
# The workhorse called by makeX to return a nice matrix of RHS
# variables to be used in an analysis.
do.one.piece <- function(rM1, others, switch.to.innov, rM1purge, nlags, verbose=FALSE) {
- cat(" do.one.piece invocation\n")
thedates <- index(rM1)
if (verbose) {
cat(" Doing work for period from ",
Modified: pkg/inst/tests/test_AMM.R
===================================================================
--- pkg/inst/tests/test_AMM.R 2013-07-16 10:33:53 UTC (rev 88)
+++ pkg/inst/tests/test_AMM.R 2013-07-16 10:51:59 UTC (rev 89)
@@ -1,4 +1,4 @@
-context("Models")
+context("AMM")
test_that("test.AMM", {
library(sandwich)
@@ -10,7 +10,7 @@
rM2 <- firmExposures$usdinr
rM3 <- firmExposures$baa
- cat("Doing Testcase P2:\n")
+ cat("\nDoing Testcase P2")
X <- makeX(rM1, others=rM2,
switch.to.innov=FALSE, rM1purge=FALSE, verbose=FALSE)
a <- firmExposures(rj, X, nlags=0, verbose=FALSE)
@@ -19,7 +19,7 @@
0.152101606133946,1.02143820457251),
.Names = c("rM1", "z", "rM1", "z")), tolerance=1e-1))
- cat("Doing Testcase P3:\n")
+ cat("\nDoing Testcase P3")
X <- makeX(rM1, others=rM2,
switch.to.innov=TRUE, rM1purge=FALSE, verbose=FALSE)
a <- firmExposures(rj, X, nlags=0, verbose=FALSE)
@@ -28,7 +28,7 @@
0.152100337597009,1.02146106755333),
.Names = c("rM1", "z", "rM1", "z")), tolerance=1e-1))
- cat("Doing Testcase P4:\n")
+ cat("\nDoing Testcase P4")
a <- firmExposures(rj, X, nlags=1, verbose=FALSE)
expect_that(c(a$exposures, a$s.exposures),
equals(structure(c( 0.736264286484902, -1.450805,
@@ -36,7 +36,7 @@
.Names = c("rM1","z", "rM1", "z")),tolerance=1e-1))
- cat("Doing Testcase P5:\n")
+ cat("\nDoing Testcase P5")
X <- makeX(rM1, others=rM2,
switch.to.innov=TRUE, rM1purge=TRUE, nlags=1, verbose=FALSE)
a <- firmExposures(rj, X, nlags=1, verbose=FALSE)
@@ -45,7 +45,7 @@
0.1653025, 1.1436666),
.Names = c("rM1", "z", "rM1", "z")),tolerance=1e-1))
- cat("Doing Testcase P6:\n")
+ cat("\nDoing Testcase P6")
X <- makeX(rM1, others=cbind(rM2, rM3),
switch.to.innov=c(FALSE, FALSE), rM1purge=FALSE, verbose=FALSE)
a <- firmExposures(rj, X, nlags=0, verbose=FALSE)
@@ -55,7 +55,7 @@
1.01806122963342,0.467821650129292),
.Names = c("rM1", "rM2", "rM3", "rM1", "rM2", "rM3")),tolerance=1e-1))
- cat("Doing Testcase P7:\n")
+ cat("\nDoing Testcase P7")
X <- makeX(rM1, others=cbind(rM2, rM3),
switch.to.innov=c(TRUE, TRUE), rM1purge=TRUE, nlags=1, verbose=FALSE)
a <- firmExposures(rj, X, nlags=1, verbose=FALSE)
@@ -71,7 +71,7 @@
################################################################################
- cat("Doing Testcases P8:\n")
+ cat("\nDoing Testcases P8")
load(system.file("data", "y3c3.rda", package = "eventstudies"))
NIFTY_INDEX <- y3c3$NIFTY_INDEX
Modified: pkg/inst/tests/test_eventstudy.R
===================================================================
--- pkg/inst/tests/test_eventstudy.R 2013-07-16 10:33:53 UTC (rev 88)
+++ pkg/inst/tests/test_eventstudy.R 2013-07-16 10:51:59 UTC (rev 89)
@@ -1,4 +1,4 @@
-context("Event study")
+context("phys2eventtime")
test_that("test.eventstudy", {
@@ -34,16 +34,17 @@
"unitmissing", "wrongspan" ), class = "factor")), .Names = c("z.e",
"outcomes"))
-# Check without the width handling --
+cat("\nCheck without width handling ")
a <- phys2eventtime(p, eventslist,width=0)
expect_that(a, equals(rawres))
-# Check with width of 1 --
+cat("\nCheck with width of 1 ")
a <- phys2eventtime(p, eventslist,width=1)
expect_that(a, equals(rawres))
# But when we go to width=2, column 1 and 3 drop off because they have
# only 1 obs before & after the event date respectively.
+cat("\nCheck with width of 2 ")
a <- phys2eventtime(p, eventslist,width=2)
expect_that(a, equals(structure(list(z.e = structure(c(NA, NA, NA, NA, 285.325,
292.6, 290.025, 286.2, 290.075, 295.05,
More information about the Eventstudies-commits
mailing list