knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
source(here::here("vignettes/setup_sims.R"))
devtools::load_all()
# remotes::install_github("pedrohcgs/DRDID")
library(BMisc)
library(ggplot2)
library(gridExtra)

ncl <- 10
biters <- 200

Slow Sims

```r

-----------------------------------------------------------------------------

panel with no covariates

-----------------------------------------------------------------------------

time.periods <- 3 reset.sim() te <- 0 nt <- 500 nu <- 500

cond_pretest <- function() { this_data <- build_sim_dataset() res <- conditional_did_pretest(yname="Y", xformla=~X, data=this_data, tname="period", idname="id", gname="G") res$CvMpval }

bout <- pbapply::pbsapply(1:biters, function(b) { cat(paste0("\niter:",b,"\n")) cond_pretest() }, cl=ncl)

mean( bout < .05 )

expect to reject about 5% of the time

-----------------------------------------------------------------------------

panel with covariates

-----------------------------------------------------------------------------

-----------------------------------------------------------------------------

repeated cross sections with no covariates

-----------------------------------------------------------------------------

TODO

-----------------------------------------------------------------------------

repeated cross sections with covariates

-----------------------------------------------------------------------------

TODO

-----------------------------------------------------------------------------

conditional pre-test

-----------------------------------------------------------------------------

still need to only consider some periods



bcallaway11/did documentation built on Nov. 15, 2024, 7:31 p.m.