Last active
August 29, 2015 14:01
-
-
Save wkschwartz/96d58802af2de16178f3 to your computer and use it in GitHub Desktop.
Example of spreads data & code in Stata
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
spreads_read using spreads.csv, clear | |
collapse (firstnm) open_pinnacle=pinnacle_spread /// | |
open_betonline=betonline_spread /// | |
open_bookmaker=bookmaker_spread /// | |
points_* /// | |
(lastnm) close_pinnacle=pinnacle_spread /// | |
close_betonline=betonline_spread /// | |
close_bookmaker=bookmaker_spread, /// | |
by(season week hometeam awayteam game_date) | |
generate byte actual = points_home - points_away | |
drop points* | |
regress open_pinnacle actual | |
predict uhat, residuals | |
regress close_pinnacle uhat actual |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Results from
regress close_pnnacle uhat actual
: