Leo Q
Leo Q

Reputation: 1

Python glm regression with log link, using aggregated success, failure data

I want to build a GLM data, but I have aggregated count data, instead of individual 0/1 data.

I can do it in R, How to do it in Python?

data <- data.frame(n = c(1000000, 20000000), x = c(2003, 24455), group = as.factor(c("Control", "Treated")))
model <- glm(cbind(x, n - x) ~ group, data = data, family = binomial(link=log))

summary(model)

Upvotes: 0

Views: 23

Answers (0)

Related Questions