Hi I have a data set of athletes training times per day as well as the date the training was held. I wish to identify when the athlete passes 500,1000 and 2000 training minutes. So far I have used
bysort athlete_id: gen total_training_minutes= sum(minutes)
This has helped me obtain the cumulative training minutes of the athletes. After that I used drop total_training_minutes if <500 to identify the date which the athlete surpassed the 500 mark. Now, I wish to do the same with 1000 and 2000 minutes. I was thinking of using drop if total_training_minutes<1000 but then I would lose the data on when the athlete passed 500 minutes. Any advice on how to identify the date where the athlete passed 1000 training minutes without dropping the data when the athlete passed 500?
Thank you.
Related Posts with Identifying when a variable passes a certain threshold
How can I modify the variable label of a table output?Hi everybody, I use table command to create a table, but I'm not satisfied with the table's output. …
Inflated coefficient using FEIV modelDear Statalist, I am estimating the effects of variable x on outcome y. Since x might be endogenous…
Staggered Difference in DifferenceDear Stata Users, I am new on the platform and also on Stata, so I am looking for someone to kindly …
Mata included in foreach varHi everyone, I'm trying to automatize/optimize the code used to create my primary table. What I'm t…
change reference category in stata 12 - POISSON REGRESSIONHi to everybody i wrote this instruction: xi: poisson a i.year, exp (pop) irr by default STATA giv…
Subscribe to:
Post Comments (Atom)
0 Response to Identifying when a variable passes a certain threshold
Post a Comment