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*
Help with instrumental variable regressionHello everybody, I need your help please. I have a dummy variable which is potentially endogenous. …
Interpretation of interaction effect with -margins-I'm currently researching the effect of gender on the performance of microfinance institutions (MFI)…
nesting cond()hi All, I was reading the stata journal version: The Stata Journal (2005) 5, Number 3, pp. 413–420 …
Parsing a user-given command to add an "if touse"I've recently had occasion to write a program using the colon operator, where as is typical, an esti…
Dropping observations based on multiple conditionsHi, My data consists of multiple rows for each person. I want to keep the rows if the followup=0 or…
Subscribe to:
Post Comments (Atom)
0 Response to diff command (rcs and bootstrap option) - results replication issue*
Post a Comment