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
Advertising variablesDear All I have a Stata dataset with 200 observations. Each observation represents 1 order. The dat…
Technical Efficiency values between 1 and 6, is that possibleIf I use the command lines frontier costs labor capital , cost distribution(exponential) 'predict i…
Fixed effect modelHello everyone, I have a few question about the model. My data panel have n=15 and t=17. 1. I ran t…
Ordered probit / multinomial probit models, marginal effects differenceHello everyone, I'm working with National Longitudinal Survey of Youth (NLSY79 and NLSY97), which i…
Fixed-effect model: how to regress with 2 sample periodsDear Statalist, For my thesis I try to examine the effect when a firm generates more renewable ener…
Subscribe to:
Post Comments (Atom)
0 Response to Why cant I reproduce results after sorting
Post a Comment