Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
s3alfisc committed Mar 2, 2023
1 parent a9424f0 commit d3adb73
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
7 changes: 5 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ knitr::opts_chunk$set(

<!-- badges: start -->
[![R-CMD-check](https://github.com/s3alfisc/wildrwolf/workflows/R-CMD-check/badge.svg)](https://github.com/s3alfisc/wildrwolf/actions)
[![pkgcheck](https://github.com/s3alfisc/wildrwolf/workflows/pkgcheck/badge.svg)](https://github.com/s3alfisc/wildrwolf/actions?query=workflow%3Apkgcheck)
[![](http://cranlogs.r-pkg.org/badges/last-month/wildrwolf)](https://cran.r-project.org/package=wildrwolf)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![](https://www.r-pkg.org/badges/version/wildrwolf)](https://cran.r-project.org/package=wildrwolf)
![runiverse-package](https://s3alfisc.r-universe.dev/badges/wildrwolf)
[![Codecov test coverage](https://codecov.io/gh/s3alfisc/wildrwolf/branch/main/graph/badge.svg)](https://app.codecov.io/gh/s3alfisc/wildrwolf?branch=main)
<!-- badges: end -->
Expand All @@ -34,9 +35,11 @@ Adding support for multi-way clustering is work in progress.

## Installation

You can install the development version from [GitHub](https://github.com/) with:
You can install the package from CRAN and the development version from [GitHub](https://github.com/) with:

``` r
install.packages("wildrwolf")

# install.packages("devtools")
devtools::install_github("s3alfisc/wildrwolf")

Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
<!-- badges: start -->

[![R-CMD-check](https://github.com/s3alfisc/wildrwolf/workflows/R-CMD-check/badge.svg)](https://github.com/s3alfisc/wildrwolf/actions)
[![pkgcheck](https://github.com/s3alfisc/wildrwolf/workflows/pkgcheck/badge.svg)](https://github.com/s3alfisc/wildrwolf/actions?query=workflow%3Apkgcheck)
[![](http://cranlogs.r-pkg.org/badges/last-month/wildrwolf)](https://cran.r-project.org/package=wildrwolf)
[![Lifecycle:
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![](https://www.r-pkg.org/badges/version/wildrwolf)](https://cran.r-project.org/package=wildrwolf)
![runiverse-package](https://s3alfisc.r-universe.dev/badges/wildrwolf)
[![Codecov test
coverage](https://codecov.io/gh/s3alfisc/wildrwolf/branch/main/graph/badge.svg)](https://app.codecov.io/gh/s3alfisc/wildrwolf?branch=main)
Expand All @@ -31,10 +32,12 @@ Adding support for multi-way clustering is work in progress.

## Installation

You can install the development version from
You can install the package from CRAN and the development version from
[GitHub](https://github.com/) with:

``` r
install.packages("wildrwolf")

# install.packages("devtools")
devtools::install_github("s3alfisc/wildrwolf")

Expand Down Expand Up @@ -149,7 +152,7 @@ if(requireNamespace("microbenchmark")){
#> | | | 0% | |========= | 12% | |================== | 25% | |========================== | 38% | |=================================== | 50% | |============================================ | 62% | |==================================================== | 75% | |============================================================= | 88% | |======================================================================| 100%
#> Unit: seconds
#> expr min lq mean median uq max neval
#> Romano-Wolf 5.041018 5.041018 5.041018 5.041018 5.041018 5.041018 1
#> Romano-Wolf 3.604916 3.604916 3.604916 3.604916 3.604916 3.604916 1
```

## But does it work? Monte Carlo Experiments
Expand Down
29 changes: 19 additions & 10 deletions vignettes/articles/Non-Standard-Families-of-Tests.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,23 @@ and
$$
Y = \beta_0 + \beta_3 X_3 + u
$$
and wanted to correct the family of hypotheses
and wanted to correct the following family of hypotheses for multiple testing:

$$H_0: \beta_1 = 0 \text{ vs } H_1: \beta_1 \neq 0$$,
$$H_0: \beta_2 = 0 \text{ vs } H_1: \beta_2 \neq 0$$,
$$H_0: \beta_1 + \beta_2 = 0 \text{ vs } H_1: \beta_1 + \beta_2\neq 0$$ and
$$H_0: \beta_3 = 0 \text{ vs } H_1: \beta_3 \neq 0.$$
$$
H_{0,A}: \beta_1 = 0 \text{ vs } H_{1,A}: \beta_1 \neq 0
$$
$$
H_{0,B}: \beta_2 = 0 \text{ vs } H_{1,B}: \beta_2 \neq 0
$$

$$
H_{0,C}: \beta_1 + \beta_2 = 0 \text{ vs } H_{1,C}: \beta_1 + \beta_2\neq 0
$$
$$
H_{0,D}: \beta_3 = 0 \text{ vs } H_{1,D}: \beta_3 \neq 0.
$$

The current API of `rwolf()` does not support such a family of tests. To apply the Romano Wolf corrections for the family of tests, you would have to follow the three steps below. But first, let's simulate some data.
Unfortunately, the current API of `rwolf()` does not yet support such a family of tests. To apply the Romano Wolf corrections for this family, you would have to follow three steps outlined below. But first, let's simulate some data.

```{r}
N <- 1000
Expand All @@ -42,7 +51,7 @@ cluster <- sample(1:20, N, TRUE)
df <- data.frame(Y = Y, X1 = X1, X2 = X2, X3 = X3, cluster)
```

+ Step 1: Estimate two regression models via `fixest`
### Step 1: Estimate two regression models via `fixest`

```{r}
library(fixest)
Expand All @@ -51,7 +60,7 @@ fit1 <- feols(Y ~ X1 + X2, data = df, cluster = ~cluster)
fit2 <- feols(Y ~ X3, data = df, cluster = ~cluster)
```

+ Step 2: Create bootstrapped t-statistics via `fwildclusterboot::boottest()`. Make sure to reset the random seeds, so that all calls to `boottest()` use the same bootstrap weights
### Step 2: Create bootstrapped t-statistics via `fwildclusterboot::boottest()`. Make sure to reset the random seeds, so that all calls to `boottest()` use the same bootstrap weights

```{r}
library(fwildclusterboot)
Expand All @@ -77,12 +86,12 @@ t_stat <- Reduce("cbind",t_stat)
```

+ Step 3: feed the bootstrapped and non-bootstrapped t-statistics into the `get_rwolf_pval()` function
### Step 3: feed the bootstrapped and non-bootstrapped t-statistics into the `get_rwolf_pval()` function

```{r}
get_rwolf_pval(t_stats = t_stat, boot_t_stats = t_boot)
```

This returns a vector of pvalues for all hypotheses.
This returns a vector of multiple-testing adjusted pvalues for all hypotheses.


0 comments on commit d3adb73

Please sign in to comment.