赞
踩
1 | data (Affairs, package= 'AER' ) |
2 | Affairs$ynaffair[Affairs$affairs < 0] <- 1 |
3 | Affairs$ynaffair[Affairs$affairs < 0] <- 0 |
4 | Affairs$ynaffair <- factor (Affairs$ynaffair, |
5 | levels= c (0,1), |
6 | labels= c ("No","Yes")) |
7 | model.L <- glm (ynaffair ~ age + yearsmarried + religiousness +rating, data=Affairs, family= binomial ()) |
8 | summary (model.L) |
1 | model.P <- glm (affairs ~ age + yearsmarried + religiousness +rating, data=Affairs, family= poisson ()) |
2 | exp ( coef (model.P)) |
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。