Skip to content

Commit

Permalink
#33 drop beta0; add deprecation warning;
Browse files Browse the repository at this point in the history
  • Loading branch information
s3alfisc committed Apr 18, 2022
1 parent 339fcb4 commit 1901846
Show file tree
Hide file tree
Showing 18 changed files with 39 additions and 39 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@
^pkgdown$
^CRAN-RELEASE$
^vignettes/articles$
^CRAN-SUBMISSION$
4 changes: 4 additions & 0 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Version: 0.8
Date: 2022-04-18 10:43:54 UTC
SHA:
339fcb4e2811e4bd58e518d7254a82b96763a64c
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Description: Implementation of the fast algorithm for wild cluster bootstrap
bootstrap.
Further, the package provides an R binding to 'WildBootTests.jl',
which provides additional speed gains and functionality,
including the WRE bootstrap for instrumental variable models
including the 'WRE' bootstrap for instrumental variable models
(based on models of type 'ivreg()' from package 'ivreg')
and hypotheses with q > 1.
URL: https://s3alfisc.github.io/fwildclusterboot/
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ summary(boot_hc1)

### `boottest()` function argument `beta0` deprecated

For consistency with `WildBootTests.jl`, it is now replaced by a new function argument, `r`. You can still use `beta0` for the forseeable future - `boottest()` will throw a warning.
For consistency with `WildBootTests.jl`, the `boottest()` function argument `beta0` is now replaced by a new function argument, `r`.

### Frühjahrsputz

Expand Down
11 changes: 5 additions & 6 deletions R/boottest_felm.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#' @param R Hypothesis Vector giving linear combinations of coefficients. Must be either NULL or a vector of the same length as `param`. If NULL, a vector of ones of length param.
#' @param r A numeric. Shifts the null hypothesis
#' H0: param = r vs H1: param != r
#' @param beta0 Superseded function argument, replaced by function argument 'r'
#' @param beta0 Deprecated function argument. Replaced by function argument 'r'.
#' @param type character or function. The character string specifies the type
#' of boostrap to use: One of "rademacher", "mammen", "norm"
#' and "webb". Alternatively, type can be a function(n) for drawing
Expand Down Expand Up @@ -202,7 +202,7 @@ boottest.felm <- function(object,
seed = NULL,
R = NULL,
r = 0,
beta0 = r,
beta0 = NULL,
sign_level = 0.05,
type = "rademacher",
impose_null = TRUE,
Expand Down Expand Up @@ -242,7 +242,6 @@ boottest.felm <- function(object,
check_arg(internal_seed, "scalar logical")
check_arg(R, "NULL| scalar numeric | numeric vector")
check_arg(r, "numeric scalar | NULL")
check_arg(beta0, "numeric scalar | NULL")
check_arg(fe, "character scalar | NULL")
check_arg(bootcluster, "character vector")
check_arg(tol, "numeric scalar GT{0}")
Expand All @@ -254,10 +253,10 @@ boottest.felm <- function(object,
check_arg(maxmatsize, "scalar integer | NULL")
check_arg(bootstrapc, "scalar logical")

if (missing(r) & !missing(beta0)) {
warning("Note that the 'beta0' function argument is superseded by a new argument, 'r'. Please specify your hypothesis via the new function argument instead of using 'beta0'.")
if(!is.null(beta0)){
stop("The function argument 'beta0' is deprecated. Please use the function argument 'r' instead, by which it is replaced.")
}

internal_seed <- set_seed(
seed = seed,
boot_algo = boot_algo,
Expand Down
10 changes: 4 additions & 6 deletions R/boottest_fixest.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#' @param R Hypothesis Vector giving linear combinations of coefficients. Must be either NULL or a vector of the same length as `param`. If NULL, a vector of ones of length param.
#' @param r A numeric. Shifts the null hypothesis
#' H0: param = r vs H1: param != r
#' @param beta0 Superseded function argument, replaced by function argument 'r'
#' @param beta0 Deprecated function argument. Replaced by function argument 'r'.
#' @param type character or function. The character string specifies the type
#' of boostrap to use: One of "rademacher", "mammen", "norm"
#' and "webb". Alternatively, type can be a function(n) for drawing
Expand Down Expand Up @@ -197,7 +197,7 @@ boottest.fixest <- function(object,
seed = NULL,
R = NULL,
r = 0,
beta0 = r,
beta0 = NULL,
type = "rademacher",
impose_null = TRUE,
p_val_type = "two-tailed",
Expand Down Expand Up @@ -235,7 +235,6 @@ boottest.fixest <- function(object,
check_arg(seed, "scalar integer | NULL")
check_arg(R, "NULL| scalar numeric | numeric vector")
check_arg(r, "numeric scalar | NULL")
check_arg(beta0, "numeric scalar | NULL")
check_arg(fe, "character scalar | NULL")
check_arg(bootcluster, "character vector")
check_arg(tol, "numeric scalar GT{0}")
Expand All @@ -247,10 +246,9 @@ boottest.fixest <- function(object,
check_arg(maxmatsize, "scalar integer | NULL")
check_arg(bootstrapc, "scalar logical")

if (missing(r) & !missing(beta0)) {
warning("Note that the 'beta0' function argument is superseded by a new argument, 'r'. Please specify your hypothesis via the new function argument instead of using 'beta0'.")
if(!is.null(beta0)){
stop("The function argument 'beta0' is deprecated. Please use the function argument 'r' instead, by which it is replaced.")
}


internal_seed <- set_seed(
seed = seed,
Expand Down
2 changes: 0 additions & 2 deletions R/boottest_ivreg.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#' @param R Hypothesis Vector giving linear combinations of coefficients. Must be either NULL or a vector of the same length as `param`. If NULL, a vector of ones of length param.
#' @param r A numeric. Shifts the null hypothesis
#' H0: param = r vs H1: param != r
#' @param beta0 Superseded function argument, replaced by function argument 'r'
#' @param type character or function. The character string specifies the type
#' of boostrap to use: One of "rademacher", "mammen", "norm", "gamma"
#' and "webb". Alternatively, type can be a function(n) for drawing
Expand Down Expand Up @@ -142,7 +141,6 @@ boottest.ivreg <- function(object,
seed = NULL,
R = NULL,
r = 0,
beta0 = r,
sign_level = 0.05,
type = "rademacher",
impose_null = TRUE,
Expand Down
12 changes: 6 additions & 6 deletions R/boottest_lm.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#' @param R Hypothesis Vector giving linear combinations of coefficients. Must be either NULL or a vector of the same length as `param`. If NULL, a vector of ones of length param.
#' @param r A numeric. Shifts the null hypothesis
#' H0: param = r vs H1: param != r
#' @param beta0 Superseded function argument, replaced by function argument 'r'
#' @param beta0 Deprecated function argument. Replaced by function argument 'r'.
#' @param type character or function. The character string specifies the type
#' of boostrap to use: One of "rademacher", "mammen", "norm"
#' and "webb". Alternatively, type can be a function(n) for drawing
Expand Down Expand Up @@ -182,7 +182,7 @@ boottest.lm <- function(object,
seed = NULL,
R = NULL,
r = 0,
beta0 = r,
beta0 = NULL,
sign_level = 0.05,
type = "rademacher",
impose_null = TRUE,
Expand Down Expand Up @@ -218,7 +218,6 @@ boottest.lm <- function(object,
check_arg(seed, "scalar integer | NULL")
check_arg(R, "NULL| scalar numeric | numeric vector")
check_arg(r, "numeric scalar | NULL")
check_arg(beta0, "numeric scalar | NULL")
check_arg(bootcluster, "character vector")
check_arg(tol, "numeric scalar GT{0}")
check_arg(maxiter, "scalar integer GT{5}")
Expand All @@ -228,16 +227,17 @@ boottest.lm <- function(object,
check_arg(maxmatsize, "scalar integer | NULL")
check_arg(bootstrapc, "scalar logical")

if (missing(r) & !missing(beta0)) {
warning("Note that the 'beta0' function argument is superseded by a new argument, 'r'. Please specify your hypothesis via the new function argument instead of using 'beta0'.")
if(!is.null(beta0)){
stop("The function argument 'beta0' is deprecated. Please use the function argument 'r' instead, by which it is replaced.")
}

internal_seed <- set_seed(
seed = seed,
boot_algo = boot_algo,
type = type
)


# check appropriateness of nthreads
nthreads <- check_set_nthreads(nthreads)

Expand Down
2 changes: 0 additions & 2 deletions R/mboottest_felm.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#' of joint hypotheses and k the number of estimated coefficients.
#' @param r A vector of length q, where q is the number of tested hypotheses. Shifts the null hypothesis
#' H0: param = r vs H1: param != r. If not provided, a vector of zeros of length q.
#' @param beta0 Superseded function argument, replaced by function argument 'r'
#' @param type character or function. The character string specifies the type
#' of boostrap to use: One of "rademacher", "mammen", "norm", "gamma"
#' and "webb". Alternatively, type can be a function(n) for drawing
Expand Down Expand Up @@ -117,7 +116,6 @@ mboottest.felm <- function(object,
B,
R,
r = rep(0, nrow(R)),
beta0 = r,
bootcluster = "max",
fe = NULL,
seed = NULL,
Expand Down
8 changes: 8 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Re-submission of 0.8

+ "Found the following (possibly) invalid file URI:
URI: WildBootTests.html
From: inst/doc/fwildclusterboot.html"
-> replaced 'internal' reference with proper URL


## Submission of 0.8

+ checked on github actions (mac, windows, linux)
Expand Down
2 changes: 1 addition & 1 deletion docs/articles/fwildclusterboot.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/news/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/boottest.felm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/boottest.fixest.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions man/boottest.ivreg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/boottest.lm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions man/mboottest.felm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion vignettes/fwildclusterboot.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ boot_lm <- boottest(lm_fit,

`fwildclusterboot` serves as an R port to [WildBootTests.jl](https://github.com/droodman/WildBootTests.jl) package.

For guidance on how to install `Julia` and `WildBootTests.jl` and how to connect R and Julia, please take a look at the [running WildBootTests.jl through fwildclusterboot](WildBootTests.html) vignette.
For guidance on how to install `Julia` and `WildBootTests.jl` and how to connect R and Julia, please take a look at the [running WildBootTests.jl through fwildclusterboot](https://s3alfisc.github.io/fwildclusterboot/articles/WildBootTests.html) vignette.

You can tell `boottest()` to run `WildBootTests.jl` by using the `boot_algo` function argument:

Expand Down

0 comments on commit 1901846

Please sign in to comment.