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
Lag independent variable in fixed effects regression using repeated cross section dataHello Statalist, I'm currently analyzing repeated cross-section data (different individuals were su…
xtaond2Hello, Would someone please tell me why the estimation results of the following two xtabond2 comman…
How to find the value of a variable using condition on another variable?Hi Statalist users, I have a dataset of which I am posting a snippet with relevant variables (age, …
Negative values for categorical variable.Hello, I have been using R but started learning STATA recently. To briefly introduce what I have be…
How to avoid duplication in observations for variables that exist in multiple waves of panel dataHi Statalist. Using panel dataset with five waves, I group couples into a number of religious categ…
Subscribe to:
Post Comments (Atom)
0 Response to Identifying when a variable passes a certain threshold
Post a Comment