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 to create a connected graph for paired mean outcomes at different times with CI whiskersHi everyone. I have tried to search for a way to make a learning curve graph with connected lines b…
Label with sysmiss value labeled.Hi, I have a dataset where it appears that there's a label with sysmiss labelled. When I type lab…
Plotting trajectories from a growth curve analysis model (mixed effects model with linear splines) using marginsplotHi All I'm running a mixed-effects model (or multilevel model or growth curve analysis) to estimate…
How to run regression within selected industriesDear Sir/Madam A quick question. I have 11 industries (i1 - i11) and I want to run a regression th…
Faster fisher exact testHello guys, I want to use the fisher exact test to two independant samples. My problem is with that …
Subscribe to:
Post Comments (Atom)
0 Response to diff command (rcs and bootstrap option) - results replication issue*
Post a Comment