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*
How relevant are stochastic trends in a panel with T<<N?The panel dimensions are N=170 and T=21 and the estimated model is a dynamic panel estimated using x…
Testing equality of Poisson regression coefficients in two groups using ppmlhdfeDear all, How do you test Poisson coefficients in two groups? Because I have multi-way fixed effect…
Error "Option not allowed" when creating coefHey guys, my goal is to regress the natural logarithm of total industry sales and an index variable…
Can factor variables and factorial interactions be used in "parmby"? If not, what is the alternative?Dear all, I wish to make a dataset of estimates - the treatment coefficient by year and its 95% con…
Problem with generating new variable-- Need help pleaseHello everyone, I need help in generating a new variable based on an existing one. The existed vari…
Subscribe to:
Post Comments (Atom)
0 Response to diff command (rcs and bootstrap option) - results replication issue*
Post a Comment