statistics - Anova test for GLM in python -
i trying f-statistic , p-value each of covariates in glm. in python using stats mode.formula.api conduct glm.
formula = 'propno_pred ~ geography + log10bmi + cat_opcavity + catles_neles + catrural_urban + \ catpred_control + catnative_intro + midpoint_of_study' mod1 = smf.glm(formula=formula, data=a2, family=sm.families.binomial()).fit() mod1.summary()
after trying anova test model using anova in statsmodels.stats
table1 = anova_lm(mod3) print table1
however getting error saying: 'glmresults' object has no attribute 'ssr'
looks anova_lm function applies linear model there module in python anova test glms?
there isn't, unfortunately. however, can roll own using model's hypothesis testing methods on each of terms. in fact, of anova methods not use attribute ssr
(which model's sum of squared residuals, undefined binomial glm). modify code glm anova.
Comments
Post a Comment