I am trying to count the number of times an NFL has won a game in their last four games. I already have a dummy variable representing the outcome of the game. I think the idea would be to generate the id for each game after sorting them in order by team and game time and then count the dummy variable outcomes from the last four observations. I'm not entirely sure how to go about the syntax/loop as I'm not super familiar doing these things in stata. Let me know if any more information is needed. I would probably have to drop the first four games in each season as well.
Related Posts with Creating a Variable to Measure Recent Performance
Correlations between two variables repeatedly measuredHi, I have a panel data of 30 subjects with 8 longitudinal observations each. I have measured 10 pl…
Multiple Tasks in a MacroI know how to write simpel code of a macro to complete one task: e.g. drop obervations whose var1 va…
Problem with sgmediation after using SEMHello everyone, I used SEM to construct 5 factors using 29 variables. After, I did some regressions…
Merged dataset but converted date variables inaccurateHi I have two datasets, one is compustat data and the other is covenant violations (from Creditor C…
Remove axes from twoway with by()Hi, Any ideas on how to remove the x-axis from all panels in a twoway graph with the by-option? I h…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a Variable to Measure Recent Performance
Post a Comment