I am trying to run the user-created command allsynth (from Justin Wiltshire, Beta version 0.0.9) with multiple treated units and a single treatment timing. I have district-level data from 1993 until 2011. I provide a data excerpt at the bottom of my post.
When I run the code:
allsynth Y literacy(1993(1)2000) Y(1993(1)2000), bcorrect(merge) keep(results, replace) stacked(trunits(daughter) trperiods(treatment), clear figure(classic bcorrect))
Stata first seems to successfully create the synthetic controls for the specified treated units. However, afterwards, when calculating the average treatment effect, I get the following error:
Stacking the estimates...
Calculating the estimated average treatment effect for treated units
file C:\Users\myusername\AppData\Local\Temp\ST_3e10_000 00d.tmp not found
I have attempted the following:
-My Stata can successfully reproduce the stacked allsynth example from the help file. I have also successfully used allsynth in a different dataset, with the stacked option.
-I reduced the number of treated districts from 60 to 2 in an attempt to simplify the command, but this does not matter.
-As I said, Stata seems to successfully create the synthetic controls for the specified treated units. However, it excludes Y(1993(1)2000) from the Predictor Balance.
-If I try the option "transform(Y, normalize)" I get the error "transform(Y, normalize) is specified but Y does not exist as a variable in the data set. Specified at least one variable in the data set".
-If I reduce the number of donor districts to 7, I no longer get the problem that Y(1993(1)2000) is excluded, nor do I get the warning that "Y does not exist as a variable" if I try to use "transform(Y, normalize)". However, I still get the ".tmp not found" error.
-I concluded that the problem must be in the Y variable. However, if I run the command with a different dependent variable and leave Y out of the command entirely, I still get the ".tmp" not found error.
-As such, I conclude that the problem must lie somewhere in the dataset. Where, however, I do not understand.
I would appreciate any help.
When I run the code:
allsynth Y literacy(1993(1)2000) Y(1993(1)2000), bcorrect(merge) keep(results, replace) stacked(trunits(daughter) trperiods(treatment), clear figure(classic bcorrect))
Stata first seems to successfully create the synthetic controls for the specified treated units. However, afterwards, when calculating the average treatment effect, I get the following error:
Stacking the estimates...
Calculating the estimated average treatment effect for treated units
file C:\Users\myusername\AppData\Local\Temp\ST_3e10_000 00d.tmp not found
I have attempted the following:
-My Stata can successfully reproduce the stacked allsynth example from the help file. I have also successfully used allsynth in a different dataset, with the stacked option.
-I reduced the number of treated districts from 60 to 2 in an attempt to simplify the command, but this does not matter.
-As I said, Stata seems to successfully create the synthetic controls for the specified treated units. However, it excludes Y(1993(1)2000) from the Predictor Balance.
-If I try the option "transform(Y, normalize)" I get the error "transform(Y, normalize) is specified but Y does not exist as a variable in the data set. Specified at least one variable in the data set".
-If I reduce the number of donor districts to 7, I no longer get the problem that Y(1993(1)2000) is excluded, nor do I get the warning that "Y does not exist as a variable" if I try to use "transform(Y, normalize)". However, I still get the ".tmp not found" error.
-I concluded that the problem must be in the Y variable. However, if I run the command with a different dependent variable and leave Y out of the command entirely, I still get the ".tmp" not found error.
-As such, I conclude that the problem must lie somewhere in the dataset. Where, however, I do not understand.
I would appreciate any help.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input float year double AreaTotal float ForestDensity long ID_2 float(Soil literacy Y daughter treatment) 1997 3229 .1570752 106 1.031746 .275191 .06507374 0 . 1998 3229 .1570752 106 1.031746 .275191 .022517383 0 . 1999 3229 .1570752 106 1.031746 .275191 -.20059435 0 . 2000 3229 .1570752 106 1.031746 .275191 .37709555 0 . 2001 3229 .1570752 106 1.031746 .275191 -.06750825 0 . 2002 3229 .1570752 106 1.031746 .4081107 .233417 0 . 2003 3229 .1570752 106 1.031746 .4081107 -.6471402 0 . 2004 3229 .1570752 106 1.031746 .4081107 .27758738 0 . 2005 3229 .1570752 106 1.031746 .4081107 -.12879132 0 . 2006 3229 .1570752 106 1.031746 .4081107 .12414443 0 . 2007 3229 .1570752 106 1.031746 .4081107 .4403561 0 . 2008 3229 .1570752 106 1.031746 .4081107 .25279105 0 . 2009 3229 .1570752 106 1.031746 .4081107 -.555305 0 . 2010 3229 .1570752 106 1.031746 .4081107 .6239394 0 . 2011 3229 .1570752 106 1.031746 .4081107 -.08596063 0 . 1993 19077 4.2234097 107 1.3573903 .5181735 -.008481395 0 . 1994 19077 4.2234097 107 1.3573903 .5181735 .3281367 0 . 1995 19077 4.2234097 107 1.3573903 .5181735 .3516888 0 . 1996 19077 4.2234097 107 1.3573903 .5181735 -.13460565 0 . 1997 19077 4.2234097 107 1.3573903 .5181735 -.27492568 0 . 1998 19077 4.2234097 107 1.3573903 .5181735 .3595104 0 . 1999 19077 4.2234097 107 1.3573903 .5181735 .01871425 0 . 2000 19077 4.2234097 107 1.3573903 .5181735 .12801498 0 . 2001 19077 4.2234097 107 1.3573903 .5181735 -.1606701 0 . 2002 19077 4.2234097 107 1.3573903 .5785219 -.016816258 0 . 2003 19077 4.2234097 107 1.3573903 .5785219 -.56596684 0 . 2004 19077 4.2234097 107 1.3573903 .5785219 .417922 0 . 2005 19077 4.2234097 107 1.3573903 .5785219 -.11410606 0 . 2006 19077 4.2234097 107 1.3573903 .5785219 -.06028071 0 . 2007 19077 4.2234097 107 1.3573903 .5785219 .10512254 0 . 2008 19077 4.2234097 107 1.3573903 .5785219 .21751446 0 . 2009 19077 4.2234097 107 1.3573903 .5785219 -.07351655 0 . 2010 19077 4.2234097 107 1.3573903 .5785219 .4994103 0 . 2011 19077 4.2234097 107 1.3573903 .5785219 -.08752358 0 . 1993 21257 6.612158 108 1.0864522 .5760336 -.1382008 1 2001 1994 21257 6.612158 108 1.0864522 .5760336 .3448446 1 2001 1995 21257 6.612158 108 1.0864522 .5760336 .3477485 1 2001 1996 21257 6.612158 108 1.0864522 .5760336 -.04370278 1 2001 1997 21257 6.612158 108 1.0864522 .5760336 -.15648526 1 2001 1998 21257 6.612158 108 1.0864522 .5760336 .11069566 1 2001 1999 21257 6.612158 108 1.0864522 .5760336 -.1952595 1 2001 2000 21257 6.612158 108 1.0864522 .5760336 .14629906 1 2001 2001 21257 6.612158 108 1.0864522 .5760336 -.04422414 1 2001 2002 21257 6.612158 108 1.0864522 .646927 .2859437 1 2001 2003 21257 6.612158 108 1.0864522 .646927 -.42999035 1 2001 2004 21257 6.612158 108 1.0864522 .646927 .4305195 1 2001 2005 21257 6.612158 108 1.0864522 .646927 -.06155586 1 2001 2006 21257 6.612158 108 1.0864522 .646927 -.14271265 1 2001 2007 21257 6.612158 108 1.0864522 .646927 .28778797 1 2001 2008 21257 6.612158 108 1.0864522 .646927 .2589848 1 2001 2009 21257 6.612158 108 1.0864522 .646927 .02300179 1 2001 2010 21257 6.612158 108 1.0864522 .646927 .3876184 1 2001 2011 21257 6.612158 108 1.0864522 .646927 -.07782114 1 2001 1993 8466 2.3730063 109 1.4888598 .5854354 .3048894 0 . 1994 8466 2.3730063 109 1.4888598 .5854354 .21332344 0 . 1995 8466 2.3730063 109 1.4888598 .5854354 .3642433 0 . 1996 8466 2.3730063 109 1.4888598 .5854354 .01354301 0 . 1997 8466 2.3730063 109 1.4888598 .5854354 -.3939877 0 . 1998 8466 2.3730063 109 1.4888598 .5854354 .15150565 0 . 1999 8466 2.3730063 109 1.4888598 .5854354 -.05472958 0 . 2000 8466 2.3730063 109 1.4888598 .5854354 .06617284 0 . 2001 8466 2.3730063 109 1.4888598 .5854354 -.29799435 0 . 2002 8466 2.3730063 109 1.4888598 .6159672 .14989516 0 . 2003 8466 2.3730063 109 1.4888598 .6159672 -.4936667 0 . 2004 8466 2.3730063 109 1.4888598 .6159672 .26636022 0 . 2005 8466 2.3730063 109 1.4888598 .6159672 -.05927211 0 . 2006 8466 2.3730063 109 1.4888598 .6159672 -.002982259 0 . 2007 8466 2.3730063 109 1.4888598 .6159672 .11584735 0 . 2008 8466 2.3730063 109 1.4888598 .6159672 .14008597 0 . 2009 8466 2.3730063 109 1.4888598 .6159672 -.57640606 0 . 2010 8466 2.3730063 109 1.4888598 .6159672 .53387964 0 . 2011 8466 2.3730063 109 1.4888598 .6159672 .1992212 0 . 1993 2367 .835816 110 1.1302521 .3073967 -.19048584 0 . 1994 2367 .835816 110 1.1302521 .3073967 .4461459 0 . 1995 2367 .835816 110 1.1302521 .3073967 .05103827 0 . 1996 2367 .835816 110 1.1302521 .3073967 .12355268 0 . 1997 2367 .835816 110 1.1302521 .3073967 -.3791602 0 . 1998 2367 .835816 110 1.1302521 .3073967 .11177385 0 . 1999 2367 .835816 110 1.1302521 .3073967 -.20608747 0 . 2000 2367 .835816 110 1.1302521 .3073967 .08271122 0 . 2001 2367 .835816 110 1.1302521 .3073967 .13367844 0 . 2002 2367 .835816 110 1.1302521 .4468094 -.2177663 0 . 2003 2367 .835816 110 1.1302521 .4468094 -.28805935 0 . 2004 2367 .835816 110 1.1302521 .4468094 .18409187 0 . 2005 2367 .835816 110 1.1302521 .4468094 -.15850008 0 . 2006 2367 .835816 110 1.1302521 .4468094 .3475953 0 . 2007 2367 .835816 110 1.1302521 .4468094 .16530073 0 . 2008 2367 .835816 110 1.1302521 .4468094 .05900788 0 . 2009 2367 .835816 110 1.1302521 .4468094 -.26038313 0 . 2010 2367 .835816 110 1.1302521 .4468094 .7479821 0 . 2011 2367 .835816 110 1.1302521 .4468094 -.2089857 0 . 1993 7632 2.636113 111 1.213534 .5387815 .08119074 0 . 1994 7632 2.636113 111 1.213534 .5387815 .12352344 0 . 1995 7632 2.636113 111 1.213534 .5387815 .26066232 0 . 1996 7632 2.636113 111 1.213534 .5387815 -.02912012 0 . 1997 7632 2.636113 111 1.213534 .5387815 -.1915751 0 . 1998 7632 2.636113 111 1.213534 .5387815 .16835415 0 . 1999 7632 2.636113 111 1.213534 .5387815 .016789556 0 . 2000 7632 2.636113 111 1.213534 .5387815 .117783 0 . 2001 7632 2.636113 111 1.213534 .5387815 -.07801765 0 . end label values ID_2 ID_2 label def ID_2 106 "Purnia", modify label def ID_2 107 "Raigarh", modify label def ID_2 108 "Raipur", modify label def ID_2 109 "Raisen", modify label def ID_2 110 "Rampur", modify label def ID_2 111 "Ranchi", modify
Comment