py-econometrics / pyfixest

Fast High-Dimensional Fixed Effects Regression in Python following fixest-syntax
https://py-econometrics.github.io/pyfixest/
MIT License
152 stars 28 forks source link

Support for Randomization Inference #427

Closed s3alfisc closed 4 months ago

s3alfisc commented 5 months ago

Introduce an ritest() method for Feols using similar syntax as @grantmcdermott's ritest.

ritest(co_est, 'b_treat', strata='b_pair', cluster='b_block', reps=1e3, seed=1234)
#> 
#>           Call: feols(fml = dayscorab ~ b_treat + b_dayscorab + miss_b_dayscorab | b_pair + round2 + round3, data = colombia, vcov = ~b_block)
#>    Res. var(s): b_treat
#>             H0: b_treat=0
#>  Strata var(s): b_pair
#>         Strata: 31
#> Cluster var(s): b_block
#>       Clusters: 63
#>      Num. reps: 1000
#> ──────────────────────────────────────────────────────────────────────────────── 
#>   T(obs)         c         n     p=c/n     SE(p)   CI 2.5%  CI 97.5%  
#>  -0.1807       107      1000     0.107   0.01609   0.08054    0.1335  
#> ──────────────────────────────────────────────────────────────────────────────── 
#> Note: Confidence interval is with respect to p=c/n. 
#> Note: c = #{|T| >= |T(obs)|}
s3alfisc commented 5 months ago

Additionally, see the paper and Stata code by @simonheb for details.

Note: RI can also be used as input to the stepwise procedure for multiple-hypothesis correction by Romano and Wolf, as implemented in the rwolf function.

s3alfisc commented 4 months ago

Implemented in #431:

To be added: support for