family:poisson(link = "log") 中的错误:NA/NaN 参数
Error in family:poisson(link = "log") : NA/NaN argument
我正在尝试使用 R 内置函数 glm()
预测足球赛果。但是我得到了 Error in family:poisson(link = "log") : NA/NaN argument
。
我使用的代码是:
model <- glm(HomeTeamScore ~ AwayTeamScore + HomeTeam + AwayTeam,
family:poisson(link = "log"), data = results)
summary(model)
结果如下table:-
Day Date HomeTeam AwayTeam HomeTeamScore AwayTeamScore Competition
1 Friday 2015-08-14 Aston Villa Man United 0 1 PremierLeague
2 Monday 2015-08-10 West Brom Man City 0 3 PremierLeague
3 Monday 2015-08-17 Liverpool Bournemouth 1 0 PremierLeague
4 Monday 2015-08-24 Arsenal Liverpool 0 0 PremierLeague
5 Monday 2015-09-14 West Ham Newcastle 2 0 PremierLeague
6 Monday 2015-09-28 West Brom Everton 2 3 PremierLeague
你需要 =
而不是 :
family = poisson(link = "log")
我正在尝试使用 R 内置函数 glm()
预测足球赛果。但是我得到了 Error in family:poisson(link = "log") : NA/NaN argument
。
我使用的代码是:
model <- glm(HomeTeamScore ~ AwayTeamScore + HomeTeam + AwayTeam,
family:poisson(link = "log"), data = results)
summary(model)
结果如下table:-
Day Date HomeTeam AwayTeam HomeTeamScore AwayTeamScore Competition
1 Friday 2015-08-14 Aston Villa Man United 0 1 PremierLeague
2 Monday 2015-08-10 West Brom Man City 0 3 PremierLeague
3 Monday 2015-08-17 Liverpool Bournemouth 1 0 PremierLeague
4 Monday 2015-08-24 Arsenal Liverpool 0 0 PremierLeague
5 Monday 2015-09-14 West Ham Newcastle 2 0 PremierLeague
6 Monday 2015-09-28 West Brom Everton 2 3 PremierLeague
你需要 =
而不是 :
family = poisson(link = "log")