Skip to content

Commit

Permalink
slightly clean up docs
Browse files Browse the repository at this point in the history
  • Loading branch information
s3alfisc committed Jul 2, 2023
1 parent 1a26b89 commit 7e70aa3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ install_github("s3alfisc/fwildclusterboot")

For a longer introduction to `{fwildclusterboot}`, take a look at the [vignette](https://s3alfisc.github.io/fwildclusterboot/articles/fwildclusterboot.html).

```{r}
```{r, warning = FALSE, message = FALSE}
library(fwildclusterboot)
# set seed via dqset.seed for engine = "R" & Rademacher, Webb & Normal weights
Expand Down
16 changes: 1 addition & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,20 +111,6 @@ data(voters)
lm_fit <- lm(proposition_vote ~ treatment + log_income + as.factor(Q1_immigration) + as.factor(Q2_defense), data = voters)
# bootstrap inference via boottest()
lm_boot <- boottest(lm_fit, clustid = c("group_id1"), B = 9999, param = "treatment")
#> Warning: Please note that the seeding behavior for random number generation for
#> `boottest()` has changed with `fwildclusterboot` version 0.13.
#>
#> It will no longer be possible to exactly reproduce results produced by versions
#> lower than 0.13.
#>
#> If your prior results were produced under sufficiently many bootstrap
#> iterations, none of your conclusions will change. For more details about this
#> change, please read the notes in
#> [news.md](https://cran.r-project.org/web/packages/fwildclusterboot/news/news.html).
#> This warning is displayed once per session.
#> Too guarantee reproducibility, don't forget to set a global random seed
#> **both** via `set.seed()` and `dqrng::dqset.seed()`.
#> This message is displayed once every 8 hours.
summary(lm_boot)
#> boottest.lm(object = lm_fit, param = "treatment", B = 9999, clustid = c("group_id1"))
#>
Expand Down Expand Up @@ -156,7 +142,7 @@ citation("fwildclusterboot")
#> A BibTeX entry for LaTeX users is
#>
#> @Misc{,
#> title = {fwildclusterboot: Fast Wild Cluster Bootstrap Inference for Linear Regression Models (Version 0.13.0)},
#> title = {fwildclusterboot: Fast Wild Cluster Bootstrap Inference for Linear Regression Models (Version 0.14.0)},
#> author = {Alexander Fischer and David Roodman},
#> year = {2021},
#> url = {https://cran.r-project.org/package=fwildclusterboot},
Expand Down
14 changes: 8 additions & 6 deletions vignettes/fwildclusterboot.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The `boottest()` function has 4 required and several optional arguments. The req
+ param: a character vector of length one - the model parameter to be tested
+ B: the number of bootstrap iterations

```{r}
```{r, warning = FALSE, message = FALSE}
# boottest on an object of type lm
boot_lm <- boottest(
lm_fit,
Expand Down Expand Up @@ -158,7 +158,7 @@ boot_lm$engine

## Choice of Bootstrap Weights

Furthermore, the user can choose among four different weighting distribution via the `type` argument: Rademacher, Mammen, Normal and Webb. By default, `boottest()` uses the Rademacher distribution.
Furthermore, you can choose among four different weighting distribution via the `type` argument: Rademacher, Mammen, Normal and Webb. By default, `boottest()` uses the Rademacher distribution.


```{r}
Expand Down Expand Up @@ -186,7 +186,7 @@ if(requireNamespace("modelsummary")){

## Other function arguments

Via the function argument `sign_level`, the user can control the significance level of the test. The default value is sign_level = 0.05, which corresponds to a 95\% confindence interval.
Via the function argument `sign_level`, you can control the significance level of the test. The default value is sign_level = 0.05, which corresponds to a 95\% confindence interval.

```{r}
boot_lm_5 <- boottest(
Expand All @@ -210,7 +210,7 @@ if(requireNamespace("modelsummary")){
}
```

In the case of multiway clustering, the user might want to specify the bootstrap clustering level. By default, boottest chooses the clustering level with the highest number of clusters as `bootcluster = "max"`. Other choices are the minimum cluster, or independent clustering variables.
In the case of multiway clustering, one might want to specify the bootstrap clustering level. By default, boottest chooses the clustering level with the highest number of clusters as `bootcluster = "max"`. Other choices are the minimum cluster, or independent clustering variables.

```{r}
boot_lm1 <- boottest(
Expand Down Expand Up @@ -240,7 +240,9 @@ if(requireNamespace("modelsummary")){
## Fixed Effects

Last, `boottest()` supports out-projection of fixed effects in the estimation stage via `lfe::felm()` and `fixest::feols()`.
Within the bootstrap, the user can choose to project out *only one* fixed effect, which can be set via the `fe` function argument. All other fixed effects specified in either `felm()` or `feols()` are treated as sets of binary regressors.
Within the bootstrap, it is possible to project out *only one* fixed effect, which can be set via the `fe` function argument. All other fixed effects specified in either `felm()` or `feols()` are treated as sets of binary regressors. Note that
`boottest.fixest()` currently does not know how to properly handle advanced `fixest`
syntax for fixed effects, as e.g. varying slopes.

```{r}
Expand All @@ -266,7 +268,7 @@ if(requireNamespace("fixest")){

## The Subcluster Bootstrap

In the case of few treated clusters, [MacKinnon and Webb (2018)](https://academic.oup.com/ectj/article-abstract/21/2/114/5078969) suggest to use subclusters to form the bootstrap distribution. `boottest()` allows the user to specify subclusters via the `bootcluster` argument.
In the case of few treated clusters, [MacKinnon and Webb (2018)](https://academic.oup.com/ectj/article-abstract/21/2/114/5078969) suggest to use subclusters to form the bootstrap distribution. `boottest()` allows to specify subclusters via the `bootcluster` argument.

```{r}
boot_min <- boottest(
Expand Down

0 comments on commit 7e70aa3

Please sign in to comment.