Can someone explain the last two commands: I understand that r(max) or r(min) is to be used after the summarize command, but what operation is being performed here?
bysort id: gen subid = _n
order id subid
bysort id: egen count_event_days = count(event_window_day)
bysort id: gen max_days_in_window = count_event_days if subid==1
tab max_days_in_window
quietly sum count_event_days
keep if count_event_days==r(max)
Related Posts with keep if(varname) ==r(max)
cmp for a multinomial charity choice/hurdle modelHi, I am trying to estimate a model of charitable giving. I have a study where individuals are given…
Heckman - Wooldridge - selection model for for 2SLS estimator - complex contextAssume that we have a stock exchange with 500 listed firms. Every year, the data for one of the exp…
Margins in logitHey, I am doing an analysis in stata and i am a bit confused. I have this logit regression: Dealcom…
ML with interval constraintDear All, This is my very first post on Satatlist. If anything is inappropriate, please let me know…
Creating this TableHello all, I am doing an Age-Period-Cohort analysis and was wondering how I can create the follow ta…
Subscribe to:
Post Comments (Atom)
0 Response to keep if(varname) ==r(max)
Post a Comment