'Binomial GLM in R: what do the coefficients talk about?
I'd like to uderstand what the coefficents of the binomial GLM models are. In my hypothetical data:
# Create the dataset
set.seed(1)
n <- 50
cov <- 10
x <- c(rep(0,n/2), rep(1, n/2))
p <- 0.4 + 0.2*x
y <- rbinom(n, cov, p)
Now we fit a logistic regression model with x as a covariate, using the logit link:
model0 <- glm(cbind(y, cov-y) ~ x, family="binomial")
summary(model0)
# Call:
# glm(formula = cbind(y, cov - y) ~ x, family = "binomial")
# Deviance Residuals:
# Min 1Q Median 3Q Max
# -1.50013 -0.58688 -0.05123 0.48348 2.43452
# Coefficients:
# Estimate Std. Error z value Pr(>|z|)
# (Intercept) -0.3064 0.1280 -2.394 0.016668 *
# x 0.6786 0.1815 3.739 0.000185 ***
# ---
# Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
# (Dispersion parameter for binomial family taken to be 1)
# Null deviance: 53.720 on 49 degrees of freedom
# Residual deviance: 39.537 on 48 degrees of freedom
# AIC: 177.99
# Number of Fisher Scoring iterations: 4
Returning to the original data scale
model_intercept <- 1/(1+(1/(exp(model0[[1]][1]))))
model_intercept
# (Intercept)
# 0.424
model_x <- 1/(1+(1/(exp(model0[[1]][2]))))
model_x
# x
# 0.6634292
And here from me starting a big confusion. The 0.6634292 values mean that the y increases at a rate of 0.6634292 per unit of x. Or 0.6634292 means 66,34292% mean increase rate of y with x interval used. And about the intercept? Something like despite x the y starts at 0.4 units, despite the negative value in the binomial model.
Thanks in advance for your time and help.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
