In our never ending Nascar modeling saga (I swear I will finish this all), lets focus on some data that usually gets overlooked: pit data.
Why is this important? Drivers can gain or lose a lot of spots on pit road. In addition to that there are several tracks where it's hard to pass, so pit road might be the only place to move up.
How can we get the data?
Lets look at one of the race results:
https://www.nascar.com/results/racec...2/stn/results/
When you view the source there's a section that has a link to a lot of json files. The two I'm interested in at lapTimes and pitStopData. This is produced for every race, what changes is the four digit race code. (in this case it's 4902). These may go sequential but COVID and rescheduling messed it up. Also the series_1 changes if you're looking at xfinity (_2) or trucks (_3).
So what type of information can we get from this pit road data? The main thing I look at is: pit stop duration and pit stop type. I count the number of top 5, top 10, top 20 pit stops for each crew and calculate the median time for all the "four_wheel_change" stops. Four wheels is the most common pit stop. There are some teams that constantly try to gain position using two tire strategies (e.g., Austin Dillon) so that could skew his median/top X.
I also keep track of how many "other" pits people make early in the race. A pit for an adjustment early on is usually an indication that they missed something on the setup. Once or twice isn't bad, but when it happens every race that is an issue.
So how do we use the lap by lap data? Well we can sync it with the pit data to calculate how many spots someone gained on/off pit road.
[this may not sum to 0 because I excluded part-time drivers]
You can also look for trends. About a month ago Truex had one of the worst pit road crews. Now he's +1 spot for the year. Some careful interpretations: people who race up the front have a harder chance to move up (less spots to gain + better drivers they're competing against). That's why you see someone like Joey Gase +23, Houff +16, Timmy Hill +31. They have less spots to go backwards.
If you look at stats like driver rating Logano is always rating high (and in my initial model back in March he was always popping as a great bet), but when I started to include more pit stop data he dropped - why? Consistently throughout the year he's been the #1 driver in lost pit road spots. I've also been killing it recently on Custer, McDowell, and Byron for the opposite reason.
I also find it interesting that Logano's crew chief is always touted as a genius, but he's been so bad this year he has Logano doing things like no tire pit stops to try and gain position.
I found this data to be very useful in XFinity and Trucks as there is a huge difference in pit crews there. People like Chase Briscoe and Harrison Burton are making their seasons based on their elite pit crews. They're regularly 2-3 seconds faster than everyone else. In Trucks Gilliland, Hill, Crafton, Creed, Moffitt, and Zane are the elite crews.
Using this info could make watching races more interesting too. I set up
http://motorsportsodds.com/pitstop/ which will populate live during the race.
Last edited by fkjlhfdkjhkj.; 08-28-2020 at 11:16 AM.