I have very easy question that I'm hoping someone can assist me with:
I ran an example logistic regression using this R code:
hours <- c(0.5, 0.75, 1, 1.25, 1.5, 1.75, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.25, 3.5, 4, 4.25, 4.5, 4.75, 5, 5.5)
pass <- c(0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1)
data <- data.frame(hours, pass)
mylogit <- glm(pass ~ hours, data = data, family = "binomial") #Activates the logistic regression model
summary(mylogit) #Summary of the model
Call:
glm(formula = pass ~ hours, family = "binomial", data = data)
Deviance Residuals:
Min 1Q Median 3Q Max
-1.70557 -0.57357 -0.04654 0.45470 1.82008
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -4.0777 1.7610 -2.316 0.0206 *
hours 1.5046 0.6287 2.393 0.0167 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for binomial family taken to be 1)
Null deviance: 27.726 on 19 degrees of freedom
Residual deviance: 16.060 on 18 degrees of freedom
AIC: 20.06
Number of Fisher Scoring iterations: 5
round(exp(cbind(OR = coef(mylogit), confint(mylogit))),3)
OR 2.5 % 97.5 %
(Intercept) 0.017 0.000 0.281
hours 4.503 1.698 23.223
I know that by taking the exponent of the log-odds/coefficients for hours the odds of passing increase by a factor of 4.503 for a one-unit change in hours. However, given that the explanatory variable (hours) is continuous, what is considered a 'one-unit change' i.e. going from 1 to 2 hours as one unit? or from 1.75 to 1.76 hours as one unit? Also, is this interpretation of one-unit the same for regular OLS regression as well? I'm seeking to better understand the rules R applies to creating its regression coefficients.