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
Graph modification: How to modify a line to a "bracket-line", change text to italic and insert character ?Attempting to modify the following graph- 3 questions: 1) Would like to change some of graph text t…
Initial Values Problem with melogit and xtmelogitHello, I am fitting an HLM model using a complex survey (DHS) data . My data does not have Level 2 w…
How can I select more than one minimum for each respondentHello Statalist. I have a dataset that looks like this: pid value number 1 0.12 2 1 0.4 2 …
Problem in running loop for regression-industry-yearDear all I'm calculating a variable, that is the residuals from a regression calculated for every i…
Equation has been stored but it is not found to perform testCould anyone explain to me how to solve this issue? I have run a regression and stored it but I can…
Subscribe to:
Post Comments (Atom)
0 Response to Why cant I reproduce results after sorting
Post a Comment