From d3adb73e542bd884416d997d3d207fa45c253b57 Mon Sep 17 00:00:00 2001 From: Alexander Fischer Date: Thu, 2 Mar 2023 18:36:31 +0100 Subject: [PATCH] update docs --- README.Rmd | 7 +++-- README.md | 9 ++++-- .../Non-Standard-Families-of-Tests.Rmd | 29 ++++++++++++------- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/README.Rmd b/README.Rmd index ed36d1d..308ce9b 100644 --- a/README.Rmd +++ b/README.Rmd @@ -18,8 +18,9 @@ knitr::opts_chunk$set( [![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) @@ -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") diff --git a/README.md b/README.md index 0a5cba0..83c8e60 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,10 @@ [![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) @@ -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") @@ -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 diff --git a/vignettes/articles/Non-Standard-Families-of-Tests.Rmd b/vignettes/articles/Non-Standard-Families-of-Tests.Rmd index 7c1ffb6..60794a5 100644 --- a/vignettes/articles/Non-Standard-Families-of-Tests.Rmd +++ b/vignettes/articles/Non-Standard-Families-of-Tests.Rmd @@ -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 @@ -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) @@ -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) @@ -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.