CRAN Package Check Results for Package estimatr

Last updated on 2018-10-21 17:54:06 CEST.

Flavor Version Tinstall Tcheck Ttotal Status Flags
r-devel-linux-x86_64-debian-clang 0.12 77.46 79.59 157.05 OK
r-devel-linux-x86_64-debian-gcc 0.12 78.20 63.20 141.40 OK
r-devel-linux-x86_64-fedora-clang 0.12 214.52 NOTE
r-devel-linux-x86_64-fedora-gcc 0.12 211.71 OK
r-devel-windows-ix86+x86_64 0.12 180.00 189.00 369.00 OK
r-patched-linux-x86_64 0.12 93.19 75.04 168.23 OK
r-patched-solaris-x86 0.12 172.80 ERROR
r-release-linux-x86_64 0.12 90.81 74.67 165.48 OK
r-release-windows-ix86+x86_64 0.12 174.00 183.00 357.00 OK
r-release-osx-x86_64 0.12 NOTE
r-oldrel-windows-ix86+x86_64 0.12 127.00 203.00 330.00 OK
r-oldrel-osx-x86_64 0.12 NOTE

Check Details

Version: 0.12
Check: installed package size
Result: NOTE
     installed size is 27.6Mb
     sub-directories of 1Mb or more:
     libs 27.3Mb
Flavors: r-devel-linux-x86_64-fedora-clang, r-release-osx-x86_64, r-oldrel-osx-x86_64

Version: 0.12
Check: examples
Result: ERROR
    Running examples in ‘estimatr-Ex.R’ failed
    The error most likely occurred in:
    
    > ### Name: iv_robust
    > ### Title: Two-Stage Least Squares Instrumental Variables Regression
    > ### Aliases: iv_robust
    >
    > ### ** Examples
    >
    > library(fabricatr)
    > dat <- fabricate(
    + N = 40,
    + Y = rpois(N, lambda = 4),
    + Z = rbinom(N, 1, prob = 0.4),
    + D = Z * rbinom(N, 1, prob = 0.8),
    + X = rnorm(N),
    + G = sample(letters[1:4], N, replace = TRUE)
    + )
    >
    > # Instrument for treatment `D` with encouragement `Z`
    > tidy(iv_robust(Y ~ D + X | Z + X, data = dat))
     term estimate std.error statistic p.value conf.low conf.high
    1 (Intercept) 4.1844199 0.4737009 8.8334635 1.204381e-10 3.224611 5.1442292
    2 D -0.1806666 0.6563979 -0.2752394 7.846636e-01 -1.510655 1.1493219
    3 X -0.3353374 0.3159417 -1.0613901 2.953919e-01 -0.975496 0.3048213
     df outcome
    1 37 Y
    2 37 Y
    3 37 Y
    >
    > # Instrument with Stata's `ivregress 2sls , small rob` HC1 variance
    > tidy(iv_robust(Y ~ D | Z, data = dat, se_type = "stata"))
     term estimate std.error statistic p.value conf.low conf.high
    1 (Intercept) 4.1739130 0.4663684 8.9498203 6.786988e-11 3.229800 5.118026
    2 D -0.2472826 0.6576307 -0.3760205 7.089929e-01 -1.578586 1.084021
     df outcome
    1 38 Y
    2 38 Y
    >
    > # With clusters, we use CR2 errors by default
    > dat$cl <- rep(letters[1:5], length.out = nrow(dat))
    > tidy(iv_robust(Y ~ D | Z, data = dat, clusters = cl))
     term estimate std.error statistic p.value conf.low conf.high
    1 (Intercept) 4.1739130 0.3799258 10.9861279 0.0004679073 3.104427 5.243399
    2 D -0.2472826 0.8908011 -0.2775958 0.7951441307 -2.725386 2.230820
     df outcome
    1 3.865421 Y
    2 3.980269 Y
    >
    > # Again, easy to replicate Stata (again with `small` correction in Stata)
    > tidy(iv_robust(Y ~ D | Z, data = dat, clusters = cl, se_type = "stata"))
     term estimate std.error statistic p.value conf.low conf.high
    1 (Intercept) 4.1739130 0.3778202 11.0473522 0.0003817331 3.124916 5.222910
    2 D -0.2472826 0.8893636 -0.2780444 0.7947585341 -2.716552 2.221987
     df outcome
    1 4 Y
    2 4 Y
    >
    > # We can also specify fixed effects, that will be taken as exogenous regressors
    > # Speed gains with fixed effects are greatests with "stata" or "HC1" std.errors
    > tidy(iv_robust(Y ~ D | Z, data = dat, fixed_effects = ~ G, se_type = "HC1"))
    
     *** caught segfault ***
    address fd18bba9, cause 'memory not mapped'
    
    Traceback:
     1: demeanMat(Y = as.matrix(model_data[["outcome"]]), X = model_data[["design_matrix"]], Zmat = model_data[["instrument_matrix"]], fes = model_data[["fixed_effects"]], weights = if (is.numeric(model_data[["weights"]])) model_data[["weights"]] else rep(1, nrow(model_data[["design_matrix"]])), has_int = attr(model_data$terms, "intercept"), eps = 1e-08)
     2: demean_fes(model_data)
     3: iv_robust(Y ~ D | Z, data = dat, fixed_effects = ~G, se_type = "HC1")
     4: tidy(iv_robust(Y ~ D | Z, data = dat, fixed_effects = ~G, se_type = "HC1"))
    An irrecoverable exception occurred. R is aborting now ...
Flavor: r-patched-solaris-x86

Version: 0.12
Check: tests
Result: ERROR
     Running ‘sleep.R’
     Comparing ‘sleep.Rout’ to ‘sleep.Rout.save’ ... OK
     Running ‘testthat.R’ [20s/33s]
    Running the tests in ‘tests/testthat.R’ failed.
    Complete output:
     > library(testthat)
     > library(estimatr)
     >
     > test_check("estimatr")
    
     *** caught segfault ***
     address fcb7bba9, cause 'memory not mapped'
    
     Traceback:
     1: demeanMat(Y = as.matrix(model_data[["outcome"]]), X = model_data[["design_matrix"]], Zmat = model_data[["instrument_matrix"]], fes = model_data[["fixed_effects"]], weights = if (is.numeric(model_data[["weights"]])) model_data[["weights"]] else rep(1, nrow(model_data[["design_matrix"]])), has_int = attr(model_data$terms, "intercept"), eps = 1e-08)
     2: demean_fes(model_data)
     3: iv_robust(Y ~ X1 + X2 | Z + X2, fixed_effects = ~B + B2, data = dat, se_type = "classical")
     4: eval(code, test_env)
     5: eval(code, test_env)
     6: withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error)
     7: doTryCatch(return(expr), name, parentenv, handler)
     8: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     9: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     10: doTryCatch(return(expr), name, parentenv, handler)
     11: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]])
     12: tryCatchList(expr, classes, parentenv, handlers)
     13: tryCatch(withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) { })
     14: test_code(desc, code, env = parent.frame())
     15: test_that("FE matches with multiple FEs and covars", { ro <- iv_robust(Y ~ X1 + X2 + factor(B) + factor(B2) | Z + X2 + factor(B) + factor(B2), data = dat, se_type = "classical") rfo <- iv_robust(Y ~ X1 + X2 | Z + X2, fixed_effects = ~B + B2, data = dat, se_type = "classical") expect_equivalent(tidy(ro)[ro$term %in% c("X1", "X2"), ], tidy(rfo)[rfo$term %in% c("X1", "X2"), ]) expect_equivalent(ro$fitted.values, rfo$fitted.values) expect_equal(ro[c("r.squared", "adj.r.squared")], rfo[c("r.squared", "adj.r.squared")]) ro <- iv_robust(Y ~ X1 + X2 + factor(B) + factor(B2) | Z + X2 + factor(B) + factor(B2), data = dat, se_type = "HC0") rfo <- iv_robust(Y ~ X1 + X2 | Z + X2, fixed_effects = ~B + B2, data = dat, se_type = "HC0") expect_equivalent(tidy(ro)[ro$term %in% c("X1", "X2"), ], tidy(rfo)[rfo$term %in% c("X1", "X2"), ]) expect_equivalent(ro$fitted.values, rfo$fitted.values) expect_equal(ro[c("r.squared", "adj.r.squared")], rfo[c("r.squared", "adj.r.squared")]) ro <- iv_robust(Y ~ X1 + X2 + factor(B) + factor(B2) | Z + X2 + factor(B) + factor(B2), data = dat, se_type = "HC1") rfo <- iv_robust(Y ~ X1 + X2 | Z + X2, fixed_effects = ~B + B2, data = dat, se_type = "HC1") expect_equivalent(tidy(ro)[ro$term %in% c("X1", "X2"), ], tidy(rfo)[rfo$term %in% c("X1", "X2"), ]) expect_equivalent(ro$fitted.values, rfo$fitted.values) expect_equal(ro[c("r.squared", "adj.r.squared")], rfo[c("r.squared", "adj.r.squared")]) ro <- iv_robust(Y ~ X1 + X2 + factor(B) + factor(B2) | Z + X2 + factor(B) + factor(B2), data = dat, se_type = "HC2") rfo <- iv_robust(Y ~ X1 + X2 | Z + X2, fixed_effects = ~B + B2, data = dat, se_type = "HC2") expect_equivalent(tidy(ro)[ro$term %in% c("X1", "X2"), ], tidy(rfo)[rfo$term %in% c("X1", "X2"), ]) expect_equivalent(ro$fitted.values, rfo$fitted.values) expect_equal(ro[c("r.squared", "adj.r.squared")], rfo[c("r.squared", "adj.r.squared")]) ro <- iv_robust(Y ~ X1 + X2 + factor(B) + factor(B2) | Z + X2 + factor(B) + factor(B2), data = dat, se_type = "HC3") rfo <- iv_robust(Y ~ X1 + X2 | Z + X2, fixed_effects = ~B + B2, data = dat, se_type = "HC3") expect_equivalent(tidy(ro)[ro$term %in% c("X1", "X2"), ], tidy(rfo)[rfo$term %in% c("X1", "X2"), ]) expect_equivalent(ro$fitted.values, rfo$fitted.values) expect_equal(ro[c("r.squared", "adj.r.squared")], rfo[c("r.squared", "adj.r.squared")]) ro <- iv_robust(Y ~ X1 + X2 + factor(B) + factor(B2) | Z + X2 + factor(B) + factor(B2), clusters = cl, data = dat, se_type = "CR0") rfo <- iv_robust(Y ~ X1 + X2 | Z + X2, fixed_effects = ~B + B2, clusters = cl, data = dat, se_type = "CR0") expect_equivalent(tidy(ro)[ro$term %in% c("X1", "X2"), ], tidy(rfo)[rfo$term %in% c("X1", "X2"), ]) expect_equivalent(ro$fitted.values, rfo$fitted.values) expect_equal(ro[c("r.squared", "adj.r.squared")], rfo[c("r.squared", "adj.r.squared")]) ro <- iv_robust(Y ~ X1 + X2 + factor(B) + factor(B2) | Z + X2 + factor(B) + factor(B2), clusters = cl, data = dat, se_type = "stata") rfo <- iv_robust(Y ~ X1 + X2 | Z + X2, fixed_effects = ~B + B2, clusters = cl, data = dat, se_type = "stata") expect_equivalent(tidy(ro)[ro$term %in% c("X1", "X2"), ], tidy(rfo)[rfo$term %in% c("X1", "X2"), ]) expect_equivalent(ro$fitted.values, rfo$fitted.values) expect_equal(ro[c("r.squared", "adj.r.squared")], rfo[c("r.squared", "adj.r.squared")]) ro <- iv_robust(Y ~ X1 + X2 + factor(B) + factor(B2) | Z + X2 + factor(B) + factor(B2), clusters = cl, data = dat, se_type = "CR2") rfo <- iv_robust(Y ~ X1 + X2 | Z + X2, fixed_effects = ~B + B2, clusters = cl, data = dat, se_type = "CR2") expect_equivalent(tidy(ro)[ro$term %in% c("X1", "X2"), ], tidy(rfo)[rfo$term %in% c("X1", "X2"), ]) expect_equivalent(ro$fitted.values, rfo$fitted.values) expect_equal(ro[c("r.squared", "adj.r.squared")], rfo[c("r.squared", "adj.r.squared")])})
     16: eval(code, test_env)
     17: eval(code, test_env)
     18: withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error)
     19: doTryCatch(return(expr), name, parentenv, handler)
     20: tryCatchOne(expr, names, parentenv, handlers[[1L]])
     21: tryCatchList(expr, names[-nh], parentenv, handlers[-nh])
     22: doTryCatch(return(expr), name, parentenv, handler)
     23: tryCatchOne(tryCatchList(expr, names[-nh], parentenv, handlers[-nh]), names[nh], parentenv, handlers[[nh]])
     24: tryCatchList(expr, classes, parentenv, handlers)
     25: tryCatch(withCallingHandlers({ eval(code, test_env) if (!handled && !is.null(test)) { skip_empty() }}, expectation = handle_expectation, skip = handle_skip, warning = handle_warning, message = handle_message, error = handle_error), error = handle_fatal, skip = function(e) { })
     26: test_code(NULL, exprs, env)
     27: source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap)
     28: force(code)
     29: with_reporter(reporter = reporter, start_end_reporter = start_end_reporter, { lister$start_file(basename(path)) source_file(path, new.env(parent = env), chdir = TRUE, wrap = wrap) end_context() })
     30: FUN(X[[i]], ...)
     31: lapply(paths, test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap)
     32: force(code)
     33: with_reporter(reporter = current_reporter, results <- lapply(paths, test_file, env = env, reporter = current_reporter, start_end_reporter = FALSE, load_helpers = FALSE, wrap = wrap))
     34: test_files(paths, reporter = reporter, env = env, stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, wrap = wrap)
     35: test_dir(path = test_path, reporter = reporter, env = env, filter = filter, ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, wrap = wrap)
     36: test_package_dir(package = package, test_path = test_path, filter = filter, reporter = reporter, ..., stop_on_failure = stop_on_failure, stop_on_warning = stop_on_warning, wrap = wrap)
     37: test_check("estimatr")
     An irrecoverable exception occurred. R is aborting now ...
Flavor: r-patched-solaris-x86