source('../../Data/get_pro_bowl_data.R') DF = get_pro_bowl_data() ##m = glm(n_probowls ~ active*yards_rushing, family=poisson, data=DF) ##m = glm(n_probowls ~ active + yards_rushing, family=poisson, data=DF) m = glm(n_probowls ~ yards_rushing, family=poisson, data=DF) print(summary(m)) DF$mPrediction = predict(m, type='response') DF$mResidual = residuals(m) DF = DF[order(DF$mResidual), ] print(DF) ## Try to transform the yards_rushing variable ## m_sqrt = glm(n_probowls ~ I(sqrt(yards_rushing)), family=poisson, data=DF) print(summary(m_sqrt)) m_log = glm(n_probowls ~ I(log(yards_rushing)), family=poisson, data=DF) print(summary(m_log))