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
Forecast applications of dynamic panel data models with fixed effectsI am attempting to produce out-of-sample forecasts based on a dynamic panel data model with fixed ef…
vce(cluster clustvar) & fe with logit1. Stata documentation includes provides examples of vce(cluster clustvar) with the regress command.…
Generalized ordered probit: "Looping over program" problemDear Statalist User, I have a piece of code for estimation generalized ordered probit model from th…
Advice regarding estimating competing riskIf i desire to calculate the cumulative incidence of both outcome (fracture=1/no fracture=0) and dea…
Confidence intervals of medians by groupDear all, I want to find out the confidence intervals of the median earnings by different years. U…
Subscribe to:
Post Comments (Atom)
0 Response to Identifying when a variable passes a certain threshold
Post a Comment