Hi,
I am new user to Stata forum. I have been working with a two year repeated cross-sectional data for my study. I am trying to implement the kernel matching method using the diff command with rcs and kernel options. With these two options I am also trying to attain bootstrapped standard errors for several outcomes in a loop. I have faced two issues while using this command and would appreciate if someone could help with the same:
1. When I run the diff rcs kernel with bootstrap option, the command always gives an error "_weights not found". I was able to fix this when I removed "varabbrev off" - I figured that the program picks up the nearest names to _weight available but it would be good to have the command run even when the variable abbreviations are off.
2. I have been stuck to be able to replicate the same results when I run the command again and again with bootstrap option. I face this problem even when I set a random seed or stable sort my dataset (more specifically with rcs kernel options). As a solution to this, I tried using the weights generated by the diff command and ran my own pooled weighted regression with bootstrapped standard errors which I am able to replicate each time it (though not same standard errors as the diff command) is ran but it is also not the best solution. Would there be a way to do this using the diff command rather than running manual weighted regression?
The problem can be seen when it run on the example dataset as well:
use "https://ift.tt/29Ffn9K", clear
*Problem 1
set varabbrev off // short variable names unacceptable
diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs support logit bs reps(50)
**Solution
set varabbrev on // short variable names acceptable
diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs support logit bs reps(50)
use "https://ift.tt/29Ffn9K", clear
set varabbrev on // short variable names acceptable
*Problem 2
diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs support logit bs reps(50)
diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs support logit bs reps(50) // different results
**Solution
diff fte, t(treated) p(t) cov(bk kfc roys) kernel rcs support logit bs reps(50) // different results
sort id treated t, stable
bs, seed(12345678) reps(100): diffbs fte t treated _diff if fte!=. & _support==1 // try bootstrap with regression weights. diffbs is a program that diff command uses for weighted bs regression (the last weight "_weight_rcs" and "_support" created is used from the diff command ) - result replicates each time though not same as diff se's
Would appreciate any help.
Thanks,
Shivani
Related Posts with diff command (rcs and bootstrap option) - results replication issue*
Regression with Newey West Standard ErrorsHello, I am working on a time series project and I try to verify the Permanent Income Hypothesis wi…
Instrumental Variable approach with more than one endogenous binary variablesDear Stata users, This is my first post here and I hope I am doing it properly, according the forum…
weakivtest (TSLS versus LIML critical values )After Ivreg2 , i need to run the weak instrument test by weakivtest . My question : Can I refer onl…
reg3- Can the same exogenous variables appear more than once in the system?Hi all, I'm working on a 3SLS regression where I have three endogenous variables and a set of exoge…
Overlap weightingDear Statalists, I would like to use overlap weighting instead of conventional IPTW because baselin…
Subscribe to:
Post Comments (Atom)
0 Response to diff command (rcs and bootstrap option) - results replication issue*
Post a Comment