I have a case where the treatment is binary and varies over time. I am trying to use the user-written tvdiff package to graph yearly point estimates and assess pre-and post-intervention effects. I am able to use the TVDIFF package just fine on the simulated data the TVDIFF authors offer in the help file for the package, but cannot seem to apply the code to my own data. I must be overlooking something obvious because my regression using TVDIFF is omitting the bulk of my variables due to collinearity, to the point that it cannot graph point estimates. I receive the follow error message when I try to graph results: "(.: no coefficients found, all dropped, or none kept) (nothing to plot)." Here is a sample of my data and my code:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float avwage int year byte(stateicp treated) 2.873321 2000 1 0 2.906454 2001 1 0 2.8970716 2002 1 0 2.910243 2003 1 0 2.939029 2004 1 0 2.916412 2005 1 0 2.7975974 2006 1 0 2.850051 2007 1 0 2.76693 2008 1 0 2.813594 2009 1 0 2.778715 2010 1 0 2.772232 2011 1 0 2.7611084 2012 1 0 2.7586176 2013 1 0 2.756499 2014 1 0 2.8030405 2015 1 0 2.812039 2016 1 0 2.8118865 2017 1 0 2.53458 2000 2 0 2.4963834 2001 2 0 2.522531 2002 2 0 2.581992 2003 2 0 2.567397 2004 2 0 2.5322225 2005 2 0 2.483552 2006 2 0 2.527404 2007 2 0 2.485879 2008 2 0 2.493756 2009 2 0 2.532219 2010 2 0 2.506098 2011 2 0 2.4884374 2012 2 0 2.530593 2013 2 0 2.482923 2014 2 0 2.547493 2015 2 0 2.5545595 2016 2 0 2.544646 2017 2 0 2.860155 2000 3 0 2.783714 2001 3 0 2.833305 2002 3 0 2.833461 2003 3 0 2.871049 2004 3 0 2.80536 2005 3 0 2.753864 2006 3 0 2.8007145 2007 3 0 2.753757 2008 3 0 2.768891 2009 3 0 2.773759 2010 3 0 2.75441 2011 3 0 2.733684 2012 3 0 2.7717085 2013 3 0 2.7847576 2014 3 0 2.8058865 2015 3 0 2.796455 2016 3 0 2.796318 2017 3 0 2.603551 2000 4 0 2.646386 2001 4 0 2.6457 2002 4 0 2.675682 2003 4 0 2.6556165 2004 4 0 2.6723726 2005 4 0 2.5957656 2006 4 0 2.627346 2007 4 0 2.6076865 2008 4 0 2.558137 2009 4 0 2.647178 2010 4 0 2.628184 2011 4 0 2.589999 2012 4 0 2.55986 2013 4 0 2.597595 2014 4 0 2.630276 2015 4 0 2.632135 2016 4 0 2.6449754 2017 4 0 2.818387 2000 5 0 2.852403 2001 5 0 2.908922 2002 5 0 2.887743 2003 5 0 2.81787 2004 5 0 2.871728 2005 5 0 2.745168 2006 5 0 2.855378 2007 5 0 2.856479 2008 5 0 2.802187 2009 5 0 2.829981 2010 5 0 2.764799 2011 5 0 2.76413 2012 5 0 2.774491 2013 5 0 2.733667 2014 5 0 2.811565 2015 5 0 2.7975366 2016 5 0 2.800904 2017 5 0 2.49169 2000 6 0 2.520899 2001 6 0 2.5482094 2002 6 0 2.577682 2003 6 0 2.60588 2004 6 0 2.5351386 2005 6 0 2.570901 2006 6 0 2.521078 2007 6 0 2.4912045 2008 6 0 2.5637755 2009 6 0 end
Code:
tsset stateicp year xi: tvdiff avwage treated i.stateicp ib11.year, model(fe) pre(2) post(4) test_tt graph save_graph(MIIN) vce(robust)
Many, many thanks,
Claire
0 Response to Help with TVDIFF/ plotting time-varying treatment effects?
Post a Comment