getwd()
[1] "C:/Users/orgac/OneDrive/Documents"
In-class activity 7
NumberofWins=80.88+0.106*(763-614)
NumberofWins
#A team with a runs difference of 149 is expected to win around 97 games.
In-class activity 8
ExpectedRuns=-804.63+2737.77*(0.361)+1584.91*(0.409)
ExpectedRuns
#We expect the team to score around 832 runs.
ExpectedRunsAllowed=-837.38+2913.60*(0.267)+1514.29*(0.392)
ExpectedRunsAllowed
[1] 534.1529
#The team is expected to allow around 534 runs
#install.packages("car")
#install.packages("carData")
vif(RunsReg)
OBP SLG BA
4.271126 3.426472 4.433501
RunsAllowedReg=1m(RA~OOBP+OSLG, data=moneyball)
Error: unexpected symbol in "RunsAllowedReg=1m"
In-class activity 8: Part 2
ExpectedRunsAllowed=-837.38+2913.60*(0.267)+1514.29*(0.392)
ExpectedRunsAllowed
[1] 534.1529
#The teams is expected to allow around 534 runs.
vif(RunsAllowedReg)
OOBP OSLG
2.735629 2.735629