From 31e477ae03a04a6d7c58e7b95b17974b690761fe Mon Sep 17 00:00:00 2001 From: Graeme Blair Date: Fri, 29 Mar 2024 19:30:42 -0700 Subject: [PATCH] version up --- CRAN-SUBMISSION | 3 --- DESCRIPTION | 4 ++-- NEWS.md | 4 ++++ cran-comments.md | 2 +- man/estimatr.Rd | 2 +- man/horvitz_thompson.Rd | 5 ++--- tests/testthat/helper-lm-robust-se.R | 1 + tests/testthat/test-lm-cluster.R | 2 +- tests/testthat/test-modelsummary.R | 12 +++++++----- tests/testthat/test-zzzbroom.R | 13 ------------- 10 files changed, 19 insertions(+), 29 deletions(-) delete mode 100644 CRAN-SUBMISSION diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION deleted file mode 100644 index 0080f95a..00000000 --- a/CRAN-SUBMISSION +++ /dev/null @@ -1,3 +0,0 @@ -Version: 1.0.2 -Date: 2024-01-17 06:28:29 UTC -SHA: 70b42698119d523bbacc9294c9238b7014715e7a diff --git a/DESCRIPTION b/DESCRIPTION index 99957251..aa06c275 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: estimatr Type: Package Title: Fast Estimators for Design-Based Inference -Version: 1.0.2 +Version: 1.0.4 Authors@R: c(person("Graeme", "Blair", email = "graeme.blair@gmail.com", role = c("aut", "cre")), person("Jasper", "Cooper", email = "jjc2247@columbia.edu", role = c("aut")), person("Alexander", "Coppock", email = "alex.coppock@yale.edu", role = c("aut")), @@ -23,7 +23,7 @@ Imports: rlang (>= 0.2.0) LinkingTo: Rcpp, RcppEigen Encoding: UTF-8 -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.1 LazyData: true Suggests: fabricatr (>= 0.10.0), diff --git a/NEWS.md b/NEWS.md index c91ef9c6..f7283b6d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# estimatr 1.0.4 + +* Test suite changes for M1 mac stay current on CRAN. + # estimatr 1.0.2 * Minor documentation changes to stay current on CRAN. diff --git a/cran-comments.md b/cran-comments.md index ca838632..0214e442 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -1,6 +1,6 @@ ## Submission -Small changes to update based on Kurt's 8/19/23 email and also address C++ warning in R CMD CHECK. +Fixes M1 Mac errors. There are no changes to worse in reverse depends. diff --git a/man/estimatr.Rd b/man/estimatr.Rd index 2c51407c..a7aedcdf 100644 --- a/man/estimatr.Rd +++ b/man/estimatr.Rd @@ -2,8 +2,8 @@ % Please edit documentation in R/estimatr.R \docType{package} \name{estimatr} -\alias{estimatr} \alias{estimatr-package} +\alias{estimatr} \title{estimatr} \description{ Fast procedures for small set of commonly-used, design-appropriate estimators with robust standard errors and confidence intervals. Includes estimators for linear regression, instrumental variables regression, difference-in-means, Horvitz-Thompson estimation, and regression improving precision of experimental estimates by interacting treatment with centered pre-treatment covariates introduced by Lin (2013) . diff --git a/man/horvitz_thompson.Rd b/man/horvitz_thompson.Rd index abab3036..14cdb2f3 100644 --- a/man/horvitz_thompson.Rd +++ b/man/horvitz_thompson.Rd @@ -123,9 +123,8 @@ In short, the Horvitz-Thompson estimator essentially reweights each unit by the probability of it being in its observed condition. Pivotal to the estimation of treatment effects using this estimator are the marginal condition probabilities (i.e., the probability that any one unit is in -a particular treatment condition). Pivotal to the estimating the variance -variance whenever the design is more complicated than simple randomization, -are the +a particular treatment condition). Pivotal to estimating the variance +whenever the design is more complicated than simple randomization are the joint condition probabilities (i.e., the probabilities that any two units have a particular set of treatment conditions, either the same or different). The estimator we provide here considers the case with two diff --git a/tests/testthat/helper-lm-robust-se.R b/tests/testthat/helper-lm-robust-se.R index 4eb98d06..53e63071 100644 --- a/tests/testthat/helper-lm-robust-se.R +++ b/tests/testthat/helper-lm-robust-se.R @@ -164,3 +164,4 @@ BMlmSE <- function(model, clustervar=NULL, ell=NULL, IK=TRUE) { se = se, se.Stata = se.Stata ) } + diff --git a/tests/testthat/test-lm-cluster.R b/tests/testthat/test-lm-cluster.R index 2f1a432b..65109664 100644 --- a/tests/testthat/test-lm-cluster.R +++ b/tests/testthat/test-lm-cluster.R @@ -121,7 +121,7 @@ test_that("lm cluster se", { for (se_type in cr_se_types) { lmr_rd <- lm_robust(Y ~ X + Z + X2, data = dat, clusters = J, se_type = se_type) lmr_full <- lm_robust(Y ~ X + Z, data = dat, clusters = J, se_type = se_type) - expect_identical( + expect_equal( tidy(lmr_rd)[1:3, ], tidy(lmr_full) ) diff --git a/tests/testthat/test-modelsummary.R b/tests/testthat/test-modelsummary.R index 451f4574..ada05531 100644 --- a/tests/testthat/test-modelsummary.R +++ b/tests/testthat/test-modelsummary.R @@ -3,10 +3,12 @@ context("S3 - modelsummary works") test_that("modelsummary works with glance", { - # skip_if_not_installed("modelsummary") - skip("modelsummary non reproducible errors") + skip_if_not_installed("modelsummary") library(modelsummary) + + set.seed(5) + model1 <- lm_robust(mpg ~ am, mtcars) model2 <- lm_robust(mpg ~ am, mtcars, clusters = cyl) model3 <- lm_lin(mpg ~ am, ~ cyl, mtcars) @@ -14,9 +16,9 @@ test_that("modelsummary works with glance", { mso <- modelsummary(list(model1, model2, model3), output = "data.frame") expect_equal(colnames(mso), c("part", "term", "statistic", - "Model 1", "Model 2", "Model 3")) + "(1)", "(2)", "(3)")) - expect_equal(nrow(mso), 12L) + expect_equal(nrow(mso), 15L) expect_equal(ncol(mso), 6L) @@ -28,7 +30,7 @@ test_that("modelsummary works with glance", { gof_omit = c("N|[sS]tatistic|p.value|p{1}"), output = "data.frame") - expect_equal(nrow(mso), 6) + expect_equal(nrow(mso), 10) expect_equal(ncol(mso), 5) diff --git a/tests/testthat/test-zzzbroom.R b/tests/testthat/test-zzzbroom.R index 07fa9702..05431c30 100644 --- a/tests/testthat/test-zzzbroom.R +++ b/tests/testthat/test-zzzbroom.R @@ -2,19 +2,6 @@ # isn't a SUGGESTed package context("zzzbroom.R - .onAttach") - -test_that(".onLoad does not message if new version of 'broom' is loaded", { - skip_if_not_installed("broom", minimum_version = "0.5.0.9000") - library(broom) - expect_silent(.onLoad("estimatr", "estimatr")) - - expect_is( - tidy(lm_robust(mpg ~ hp, mtcars)), - "data.frame" - ) -}) - - test_that(".onLoad message if old version of 'broom' is installed", { skip_if_not_installed("broom") skip_if(packageVersion("broom") > "0.5.0")