diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION deleted file mode 100644 index 12f4563..0000000 --- a/CRAN-SUBMISSION +++ /dev/null @@ -1,3 +0,0 @@ -Version: 0.30.6 -Date: 2022-01-27 21:30:54 UTC -SHA: 18fa6916d7804cb23097227adb02b0c2882ec924 diff --git a/DESCRIPTION b/DESCRIPTION index 04bcb76..91157e6 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -23,7 +23,7 @@ Imports: rlang (>= 0.2.0) LinkingTo: Rcpp, RcppEigen Encoding: UTF-8 -RoxygenNote: 7.1.1 +RoxygenNote: 7.2.0 LazyData: true Suggests: fabricatr (>= 0.10.0), @@ -32,7 +32,6 @@ Suggests: clubSandwich, emmeans (>= 1.4), estimability, - ivpack, margins, modelsummary, prediction, diff --git a/NEWS.md b/NEWS.md index eb68971..7e4dec0 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,8 @@ +# estimatr 1.0.0 + +* Version bump to coincide with DeclareDesign package version 1.0.0 +* Tests edited + # estimatr 0.30.6 * Fix tests to address CRAN failures diff --git a/R/estimatr_lm_lin.R b/R/estimatr_lm_lin.R index 9789e57..602b88b 100644 --- a/R/estimatr_lm_lin.R +++ b/R/estimatr_lm_lin.R @@ -175,7 +175,7 @@ lm_lin <- function(formula, ) } - if (class(covariates) != "formula") { + if (!inherits(covariates, "formula")) { stop( "The `covariates` argument must be specified as a formula:\n", "You passed an object of class ", class(covariates) diff --git a/R/estimatr_lm_robust.R b/R/estimatr_lm_robust.R index 0b53348..9fe1c79 100644 --- a/R/estimatr_lm_robust.R +++ b/R/estimatr_lm_robust.R @@ -123,7 +123,7 @@ #' #' Bell, Robert M, and Daniel F McCaffrey. 2002. "Bias Reduction in Standard Errors for Linear Regression with Multi-Stage Samples." Survey Methodology 28 (2): 169-82. #' -#' Gaure, Simon. 2013. "OLS with multiple high dimensional category variables." Computational Statistics \& Data Analysis 66: 8-1. \doi{10.1016/j.csda.2013.03.024} +#' Gaure, Simon. 2013. "OLS with multiple high dimensional category variables." Computational Statistics & Data Analysis 66: 8-1. \doi{10.1016/j.csda.2013.03.024} #' #' Halperin, I. 1962. "The product of projection operators." Acta Scientiarum Mathematicarum (Szeged) 23(1-2): 96-99. #' diff --git a/cran-comments.md b/cran-comments.md index a678a7f..ebb8f3c 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,9 +1,8 @@ ## Submission -Thank you for reviewing this minor patch, which addresses failures on CRAN due to changes in all.equal in r-devel per email from Prof. Ripley. +Thank you for reviewing this minor patch, which addresses failures on CRAN due to ivpack being archived. The version is also bumped and the email address of the maintainer changed. There are no changes to worse in reverse depends. We have checked this in win builder and on OS X, linux, and Windows in release, oldrel, and devel on Github Actions with no issues. - diff --git a/man/lm_robust.Rd b/man/lm_robust.Rd index 4c781d5..860e7cf 100644 --- a/man/lm_robust.Rd +++ b/man/lm_robust.Rd @@ -243,7 +243,7 @@ Abadie, Alberto, Susan Athey, Guido W Imbens, and Jeffrey Wooldridge. 2017. "A C Bell, Robert M, and Daniel F McCaffrey. 2002. "Bias Reduction in Standard Errors for Linear Regression with Multi-Stage Samples." Survey Methodology 28 (2): 169-82. -Gaure, Simon. 2013. "OLS with multiple high dimensional category variables." Computational Statistics \& Data Analysis 66: 8-1. \doi{10.1016/j.csda.2013.03.024} +Gaure, Simon. 2013. "OLS with multiple high dimensional category variables." Computational Statistics & Data Analysis 66: 8-1. \doi{10.1016/j.csda.2013.03.024} Halperin, I. 1962. "The product of projection operators." Acta Scientiarum Mathematicarum (Szeged) 23(1-2): 96-99. diff --git a/tests/testthat/test-condition-pr-matrix.R b/tests/testthat/test-condition-pr-matrix.R index efe6c62..01cb9d3 100644 --- a/tests/testthat/test-condition-pr-matrix.R +++ b/tests/testthat/test-condition-pr-matrix.R @@ -12,6 +12,8 @@ test_that("Checks class", { test_that("Complete randomization", { + skip_if_not_installed("randomizr") + prs <- rep(0.4, times = n) comp_ra <- randomizr::declare_ra(N = n, prob = prs[1]) perms <- randomizr::obtain_permutation_matrix(comp_ra) diff --git a/tests/testthat/test-iv-robust.R b/tests/testthat/test-iv-robust.R index b1d74f2..1bc0dde 100644 --- a/tests/testthat/test-iv-robust.R +++ b/tests/testthat/test-iv-robust.R @@ -28,6 +28,8 @@ test_that("iv_robust matches AER + ivpack", { skip_if_not_installed("AER") skip_if_not_installed("ivpack") + skip("ivpack is not available") + ivco <- iv_robust(y ~ x | z, data = dat, se_type = "classical") ivfit <- AER::ivreg(y ~ x | z, data = dat) ivo <- summary(ivfit) @@ -323,6 +325,8 @@ test_that("iv_robust matches AER + clubSandwich", { test_that("iv_robust different specifications work", { skip_if_not_installed("AER") + skip_if_not_installed("ivpack") + skip("ivpack not available") # More instruments than endog. regressors ivro <- iv_robust(mpg ~ wt | hp + cyl, data = mtcars, se_type = "HC0") @@ -439,6 +443,8 @@ test_that("S3 methods", { test_that("IV diagnostics", { + skip_if_not_installed("AER") + # Load stata diagnostics stata_diags <- read.table( "stata-iv-diagnostics.txt", diff --git a/tests/testthat/test-lh-robust.R b/tests/testthat/test-lh-robust.R index 6cc0ca7..c2c9baf 100644 --- a/tests/testthat/test-lh-robust.R +++ b/tests/testthat/test-lh-robust.R @@ -13,6 +13,7 @@ dat <- data.frame( # se tests test_that("lh_robust works with all se types", { + skip_if_not_installed("car") for (se_type in se_types) { lhro <- tidy( @@ -34,6 +35,7 @@ test_that("lh_robust works with all se types", { }) test_that("lh_robust with clusters works for all se_types ", { + skip_if_not_installed("car") for (se_type in cr_se_types) { lhro <- tidy( @@ -58,6 +60,8 @@ test_that("lh_robust with clusters works for all se_types ", { }) test_that("lh_robust matches lm_robust with fixed effects", { + skip_if_not_installed("car") + lhro <- lh_robust( Y ~ Z * X, @@ -76,6 +80,8 @@ test_that("lh_robust matches lm_robust with fixed effects", { }) test_that("lh_robust matches lm_robust with weights", { + skip_if_not_installed("car") + lhro <- lh_robust( Y ~ Z * X, @@ -95,6 +101,8 @@ test_that("lh_robust matches lm_robust with weights", { }) test_that("lh_robust matches lm_robust with subsetted data.frame", { + skip_if_not_installed("car") + lhro <- lh_robust(Y ~ Z * X, data = dat, @@ -112,6 +120,8 @@ test_that("lh_robust matches lm_robust with subsetted data.frame", { }) test_that("lh_robust matches lm_robust with subsetted data.frame", { + skip_if_not_installed("car") + lhro <- lh_robust(Y ~ Z * X, data = dat, diff --git a/tests/testthat/test-s3-methods.R b/tests/testthat/test-s3-methods.R index 7fa7176..49b2a97 100644 --- a/tests/testthat/test-s3-methods.R +++ b/tests/testthat/test-s3-methods.R @@ -336,6 +336,8 @@ test_that("tidy, glance, summary, and print work", { test_that("vcov works", { + skip_if_not_installed("AER") + # not identical due to < 1e-15 diffs expect_equal( vcov(lm_robust(y ~ x, data = dat, se_type = "classical")), @@ -841,6 +843,8 @@ test_that("predict works with fixed effects", { test_that("predict.iv_robust works with fixed effects", { + skip_if_not_installed("AER") + ro <- iv_robust(mpg ~ hp + factor(cyl) | vs + factor(cyl), data = mtcars) rfo <- iv_robust(mpg ~ hp | vs, fixed_effects = ~ cyl, data = mtcars) io <- AER::ivreg(mpg ~ hp + factor(cyl) | vs + factor(cyl), data = mtcars) diff --git a/tests/testthat/test-stata-output.R b/tests/testthat/test-stata-output.R index 3152d9a..5a93e2a 100644 --- a/tests/testthat/test-stata-output.R +++ b/tests/testthat/test-stata-output.R @@ -54,6 +54,8 @@ test_that("lm_robust matches stata", { test_that("iv_robust matches stata", { + skip_if_not_installed("AER") + # write.csv(mtcars, # file = 'tests/testthat/mtcars.csv', # row.names = F)