-
Notifications
You must be signed in to change notification settings - Fork 33
Open
Description
I compared the diff of two plays' home_wp_post and WPA in the database.
Is WPA suppose to be the diff of two plays' home_wp_post?
Most numbers check out, but some numbers dont make sense.
Why timeOUT has a different home_wp_post?
Here is what i do:
tic()
test<-pbp %>%
filter(game_id == "2009_18_GB_ARI",!is.na(home_wp_post)) %>%
select(game_id,play_id, qtr, desc, total, spread_line, home_wp_post, wpa) %>%
collect()
toc()
tic()
test <- test %>%
mutate(wp_diff1 = abs(wpa))
toc()
tic()
test[1,'wp_diff2'] = 0
rownum <- nrow(test)
for (i in 2:rownum){
test[i,'wp_diff2']=abs(test[i,'home_wp_post']-test[i-1,'home_wp_post'])
}
toc()
temp<-test%>%filter(wp_diff2!=wp_diff1)
Metadata
Metadata
Assignees
Labels
No labels