Dear Statlisters,
Why can't I reproduce the results after this lines of code. I am working with longitudinal data in long format. uuid is the unique identifier
bysort uuid -dispensing_date : egen max_duration = max(duration)
gen startdate = dispensing_date
sort uuid -dispensing_date
by uuid: gen stopdate = dispensing_date[_n+1]
noisily: sum duration
replace stopdate = date("1/7/2020", "DMY", 2009) if stopdate == .
gen time = stopdate - startdate
drop if duration != max_duration
noisily: sum duration
drop if time == 0
noisily: sum duration // this line does not produce consistent results.
Regards
Related Posts with Why cant I reproduce results after sorting
Which stata command can I use to conduct a randomization check?Hi all. As part of my dissertation, I conducted a between-subjects factorial experiment with two fac…
Survival analysis help, parametricHi there, I need help with my research on the duration of a strategy adopted by private equity firm…
3SLS and heteroskedasticityHi, I'm running a system of equations model using reg3. Code: Code: reg3 (dlrgdp L.dlrgdp dzsly …
Multilevel data managementHello everyone, Im working with a dataset that includes 2 levels of data: individual level data and…
Regression using variable given in decimal changeI'm doing ARIMA with several variables on a time series. Arima value decimalvar1 decimalvar2, ar(1) …
Subscribe to:
Post Comments (Atom)
0 Response to Why cant I reproduce results after sorting
Post a Comment