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)
Coefplot with multiple models to show change over time horizontallyHello, I'm trying to plot concertation indices for 5 variables obtained from separate linear regres…
Minimize under a restriction (in each individual)I wanna to find individual values to minimize an outcome in a restriction. *variables - fac1, ..., …
Help with xtabond2Dear Sir/Madam, I am trying to use the xtabond2 command for system GMM. I am getting TWO problems,…
Error uninstalling a package: Criterion matches more than one packageDavid Roodman posted yesterday a discussion of xtabond2, contributed by him I installed the package …
Deriving ISEI from ISCO-08 and ISCO-88 with 2 digits. Is it possible?Hi there! I have a dataset covering 14 years, and I have isco88 and isco08 with only 2 digits for t…
Subscribe to:
Post Comments (Atom)
0 Response to keep if(varname) ==r(max)
Post a Comment