Skip to content

Commit 1901846

Browse files
committed
#33 drop beta0; add deprecation warning;
1 parent 339fcb4 commit 1901846

18 files changed

+39
-39
lines changed

.Rbuildignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
^pkgdown$
1313
^CRAN-RELEASE$
1414
^vignettes/articles$
15+
^CRAN-SUBMISSION$

CRAN-SUBMISSION

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Version: 0.8
2+
Date: 2022-04-18 10:43:54 UTC
3+
SHA:
4+
339fcb4e2811e4bd58e518d7254a82b96763a64c

DESCRIPTION

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Description: Implementation of the fast algorithm for wild cluster bootstrap
4646
bootstrap.
4747
Further, the package provides an R binding to 'WildBootTests.jl',
4848
which provides additional speed gains and functionality,
49-
including the WRE bootstrap for instrumental variable models
49+
including the 'WRE' bootstrap for instrumental variable models
5050
(based on models of type 'ivreg()' from package 'ivreg')
5151
and hypotheses with q > 1.
5252
URL: https://s3alfisc.github.io/fwildclusterboot/

NEWS.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ summary(boot_hc1)
7575

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

78-
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.
78+
For consistency with `WildBootTests.jl`, the `boottest()` function argument `beta0` is now replaced by a new function argument, `r`.
7979

8080
### Frühjahrsputz
8181

R/boottest_felm.R

+5-6
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#' @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.
3838
#' @param r A numeric. Shifts the null hypothesis
3939
#' H0: param = r vs H1: param != r
40-
#' @param beta0 Superseded function argument, replaced by function argument 'r'
40+
#' @param beta0 Deprecated function argument. Replaced by function argument 'r'.
4141
#' @param type character or function. The character string specifies the type
4242
#' of boostrap to use: One of "rademacher", "mammen", "norm"
4343
#' and "webb". Alternatively, type can be a function(n) for drawing
@@ -202,7 +202,7 @@ boottest.felm <- function(object,
202202
seed = NULL,
203203
R = NULL,
204204
r = 0,
205-
beta0 = r,
205+
beta0 = NULL,
206206
sign_level = 0.05,
207207
type = "rademacher",
208208
impose_null = TRUE,
@@ -242,7 +242,6 @@ boottest.felm <- function(object,
242242
check_arg(internal_seed, "scalar logical")
243243
check_arg(R, "NULL| scalar numeric | numeric vector")
244244
check_arg(r, "numeric scalar | NULL")
245-
check_arg(beta0, "numeric scalar | NULL")
246245
check_arg(fe, "character scalar | NULL")
247246
check_arg(bootcluster, "character vector")
248247
check_arg(tol, "numeric scalar GT{0}")
@@ -254,10 +253,10 @@ boottest.felm <- function(object,
254253
check_arg(maxmatsize, "scalar integer | NULL")
255254
check_arg(bootstrapc, "scalar logical")
256255

257-
if (missing(r) & !missing(beta0)) {
258-
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'.")
256+
if(!is.null(beta0)){
257+
stop("The function argument 'beta0' is deprecated. Please use the function argument 'r' instead, by which it is replaced.")
259258
}
260-
259+
261260
internal_seed <- set_seed(
262261
seed = seed,
263262
boot_algo = boot_algo,

R/boottest_fixest.R

+4-6
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#' @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.
3838
#' @param r A numeric. Shifts the null hypothesis
3939
#' H0: param = r vs H1: param != r
40-
#' @param beta0 Superseded function argument, replaced by function argument 'r'
40+
#' @param beta0 Deprecated function argument. Replaced by function argument 'r'.
4141
#' @param type character or function. The character string specifies the type
4242
#' of boostrap to use: One of "rademacher", "mammen", "norm"
4343
#' and "webb". Alternatively, type can be a function(n) for drawing
@@ -197,7 +197,7 @@ boottest.fixest <- function(object,
197197
seed = NULL,
198198
R = NULL,
199199
r = 0,
200-
beta0 = r,
200+
beta0 = NULL,
201201
type = "rademacher",
202202
impose_null = TRUE,
203203
p_val_type = "two-tailed",
@@ -235,7 +235,6 @@ boottest.fixest <- function(object,
235235
check_arg(seed, "scalar integer | NULL")
236236
check_arg(R, "NULL| scalar numeric | numeric vector")
237237
check_arg(r, "numeric scalar | NULL")
238-
check_arg(beta0, "numeric scalar | NULL")
239238
check_arg(fe, "character scalar | NULL")
240239
check_arg(bootcluster, "character vector")
241240
check_arg(tol, "numeric scalar GT{0}")
@@ -247,10 +246,9 @@ boottest.fixest <- function(object,
247246
check_arg(maxmatsize, "scalar integer | NULL")
248247
check_arg(bootstrapc, "scalar logical")
249248

250-
if (missing(r) & !missing(beta0)) {
251-
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'.")
249+
if(!is.null(beta0)){
250+
stop("The function argument 'beta0' is deprecated. Please use the function argument 'r' instead, by which it is replaced.")
252251
}
253-
254252

255253
internal_seed <- set_seed(
256254
seed = seed,

R/boottest_ivreg.R

-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
#' @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.
2828
#' @param r A numeric. Shifts the null hypothesis
2929
#' H0: param = r vs H1: param != r
30-
#' @param beta0 Superseded function argument, replaced by function argument 'r'
3130
#' @param type character or function. The character string specifies the type
3231
#' of boostrap to use: One of "rademacher", "mammen", "norm", "gamma"
3332
#' and "webb". Alternatively, type can be a function(n) for drawing
@@ -142,7 +141,6 @@ boottest.ivreg <- function(object,
142141
seed = NULL,
143142
R = NULL,
144143
r = 0,
145-
beta0 = r,
146144
sign_level = 0.05,
147145
type = "rademacher",
148146
impose_null = TRUE,

R/boottest_lm.R

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#' @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.
3535
#' @param r A numeric. Shifts the null hypothesis
3636
#' H0: param = r vs H1: param != r
37-
#' @param beta0 Superseded function argument, replaced by function argument 'r'
37+
#' @param beta0 Deprecated function argument. Replaced by function argument 'r'.
3838
#' @param type character or function. The character string specifies the type
3939
#' of boostrap to use: One of "rademacher", "mammen", "norm"
4040
#' and "webb". Alternatively, type can be a function(n) for drawing
@@ -182,7 +182,7 @@ boottest.lm <- function(object,
182182
seed = NULL,
183183
R = NULL,
184184
r = 0,
185-
beta0 = r,
185+
beta0 = NULL,
186186
sign_level = 0.05,
187187
type = "rademacher",
188188
impose_null = TRUE,
@@ -218,7 +218,6 @@ boottest.lm <- function(object,
218218
check_arg(seed, "scalar integer | NULL")
219219
check_arg(R, "NULL| scalar numeric | numeric vector")
220220
check_arg(r, "numeric scalar | NULL")
221-
check_arg(beta0, "numeric scalar | NULL")
222221
check_arg(bootcluster, "character vector")
223222
check_arg(tol, "numeric scalar GT{0}")
224223
check_arg(maxiter, "scalar integer GT{5}")
@@ -228,16 +227,17 @@ boottest.lm <- function(object,
228227
check_arg(maxmatsize, "scalar integer | NULL")
229228
check_arg(bootstrapc, "scalar logical")
230229

231-
if (missing(r) & !missing(beta0)) {
232-
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'.")
230+
if(!is.null(beta0)){
231+
stop("The function argument 'beta0' is deprecated. Please use the function argument 'r' instead, by which it is replaced.")
233232
}
234-
233+
235234
internal_seed <- set_seed(
236235
seed = seed,
237236
boot_algo = boot_algo,
238237
type = type
239238
)
240239

240+
241241
# check appropriateness of nthreads
242242
nthreads <- check_set_nthreads(nthreads)
243243

R/mboottest_felm.R

-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#' of joint hypotheses and k the number of estimated coefficients.
2424
#' @param r A vector of length q, where q is the number of tested hypotheses. Shifts the null hypothesis
2525
#' H0: param = r vs H1: param != r. If not provided, a vector of zeros of length q.
26-
#' @param beta0 Superseded function argument, replaced by function argument 'r'
2726
#' @param type character or function. The character string specifies the type
2827
#' of boostrap to use: One of "rademacher", "mammen", "norm", "gamma"
2928
#' and "webb". Alternatively, type can be a function(n) for drawing
@@ -117,7 +116,6 @@ mboottest.felm <- function(object,
117116
B,
118117
R,
119118
r = rep(0, nrow(R)),
120-
beta0 = r,
121119
bootcluster = "max",
122120
fe = NULL,
123121
seed = NULL,

cran-comments.md

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## Re-submission of 0.8
2+
3+
+ "Found the following (possibly) invalid file URI:
4+
URI: WildBootTests.html
5+
From: inst/doc/fwildclusterboot.html"
6+
-> replaced 'internal' reference with proper URL
7+
8+
19
## Submission of 0.8
210

311
+ checked on github actions (mac, windows, linux)

docs/articles/fwildclusterboot.html

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/news/index.html

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/boottest.felm.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/boottest.fixest.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/boottest.ivreg.Rd

-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/boottest.lm.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/mboottest.felm.Rd

-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/fwildclusterboot.Rmd

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ boot_lm <- boottest(lm_fit,
280280

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

283-
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.
283+
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.
284284

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

0 commit comments

Comments
 (0)