Skip to content

Commit

Permalink
fix #10'
Browse files Browse the repository at this point in the history
  • Loading branch information
s3alfisc committed Jan 14, 2024
1 parent d3adb73 commit b2f62c5
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 3 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: wildrwolf
Type: Package
Title: Fast Computation of Romano-Wolf Corrected p-Values for
Linear Regression Models
Version: 0.6.1
Version: 0.7.0
Authors@R:
c(
person(given = "Alexander",
Expand All @@ -19,7 +19,7 @@ Description: Fast Routines to Compute Romano-Wolf corrected p-Values
License: GPL (>= 3)
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.1
RoxygenNote: 7.2.3
Imports:
fixest,
fwildclusterboot,
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# wildrwolf 0.7.0

* Fixes a bug when the cluster in `feols()` was specified as character.
See [#10](https://github.com/s3alfisc/wildrwolf/issues/10) for details.
Thanks to [@SebKrantz](https://github.com/SebKrantz) for reporting!

# wildrwolf 0.6.1

* Hot-Fix release to address ATLAS test failures. Failing
Expand Down
6 changes: 5 additions & 1 deletion R/rwolf.R
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ rwolf <- function(
)

if(!is.null(clustid)){
boottest_quote$clustid <- formula(clustid)
if(is.character(clustid)){
boottest_quote$clustid <- formula(paste0("~", clustid))
} else {
boottest_quote$clustid <- formula(clustid)
}
}

if(!is.null(bootstrap_type)){
Expand Down
20 changes: 20 additions & 0 deletions tests/testthat/test_misc.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
test_that("test cluster input", {

# test that wildrwolf accepts formulas and characters
# as fixest cluster input

library(fixest)
library(wildrwolf)

dqrng::dqset.seed(123)
models1 = feols(c(vs, am) ~ mpg | cyl, mtcars, cluster = "carb")
rwolf1 = rwolf(models = models, param = "mpg", B = 9999)

dqrng::dqset.seed(123)
models2 = feols(c(vs, am) ~ mpg | cyl, mtcars, cluster = ~carb)
rwolf2 = rwolf(models = models, param = "mpg", B = 9999)

expect_equal(rwolf1, rwolf2)


})

0 comments on commit b2f62c5

Please sign in to comment.