R Under development (unstable) (2024-05-26 r86629 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(DIDmultiplegt) > library(wooldridge) > > df <- wagepan > Y = "lwage" > G = "nr" > T = "year" > D = "union" > controls = c("hours") > placebo = 2 > dynamic = 2 > > result = did_multiplegt(df, Y, G, T, D, controls, placebo = placebo, dynamic = dynamic, + brep = 2, cluster = "nr", covariance = TRUE, average_effect = "prop_number_switchers") To estimate event-study/dynamic effects, we strongly recommend using the much faster did_multiplegt_dyn command, available from the CRAN repository. In addition to that, did_multiplegt_dyn offers more options than did_multiplegt. Warning message: There was 1 warning in `summarize()`. ℹ In argument: `Tgroup = group_indices()`. ℹ In group 1: `T = 1980`. Caused by warning: ! `group_indices()` was deprecated in dplyr 1.0.0. ℹ Please use `cur_group_id()` instead. ℹ The deprecated feature was likely used in the DIDmultiplegt package. Please report the issue to the authors. > > assertthat::are_equal(result$placebo_2, -0.9930194) [1] FALSE > assertthat::are_equal(result$N_placebo_2, 2158) [1] FALSE > assertthat::are_equal(result$placebo_1, 0.08446127) [1] FALSE > assertthat::are_equal(result$N_placebo_1,2842) [1] FALSE > assertthat::are_equal(result$effect, 0.02147226) [1] FALSE > assertthat::are_equal(result$N_effect, 3815) [1] FALSE > assertthat::are_equal(result$N_switchers_effect, 508) [1] FALSE > > > cluster = NULL > recat_treatment = NULL > trends_nonparam = NULL > trends_lin = "nr" > result = did_multiplegt(df, Y, G, T, D, controls, placebo = placebo, dynamic = dynamic, + trends_lin = trends_lin, trends_nonparam = trends_nonparam) > > > cluster = NULL > recat_treatment = NULL > trends_nonparam = "black" > trends_lin = NULL > result = did_multiplegt(df, Y, G, T, D, controls, placebo = placebo, dynamic = dynamic, + trends_lin = trends_lin, trends_nonparam = trends_nonparam) > > proc.time() user system elapsed 34.62 0.51 35.12