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
Differences between cap and quiDear all, does anyone know the differences between the commands capture and quietly? So far it seem…
Python Integration - Matplotlib Error (suggested fix does not work)I've seen this before, but the answer didn't work for me. I'm using Stata 16, and Python 3 under Ana…
Interpreting continuous var by continuous var interactions for FE Poisson modelHi all, I'm looking at the effect of fire occurrence on the number of visits to National Forests an…
Introducing 'pmanage' utility to efficiently compile large projects and detects I/O errorsWe are pleased to introduce pmanage, a utility that leverages Robert Picard's project to efficiently…
Multiple Line Graph of MeanHello! I'm very new to Stata (I just started using it yesterday) and I'm trying to figure out how t…
Subscribe to:
Post Comments (Atom)
0 Response to Creating a Variable to Measure Recent Performance
Post a Comment