问题
I am running some fairly simple odds ratio analysis to investigate relationships of certain variable on injury outcomes. The exposure term (inj) is binary with 0 representing no injury and 1 meaning an injury is present. The interaction terms I am investigating are whether the person injured at work (causeWork; 0represents not a work related injury and 1represents a work injury) and the mechanism of injury (mechanism; multivariable ie. mechanismFall, mechanismObject, mechanismPerson). The reference variable for mechanism= fall). My glm is as follows:
fit 1 <- glm(formula = inj ~ cause * mechanism, family = "binomial",
data = dat)
After exponentiating the coefficients and calling for the confidence intervals, I get the following values:
round(cbind(OR=exp(coef(fit1)), exp(confint(fit1))), 2)
OR 2.5% 97.5 %
(Intercept) 0.24 0.11 0.47
causeWork 1.06 0.14 5.17
mechanismObject 3.52 1.51 8.81
mechanismPerson 1.79 0.65 5.02
causeWork:mechanismObject 0.48 0.07 4.24
causeWork:mechanismPerson 1.88 0.30 16.24
Where I am getting confused is understanding the meaning for each, particularly which reference is being used for the OR comparison. The way I currently understand this is:
(intecept): The odds of suffering an injury
causeWork: The OR of suffering an injury while at work (1) versus suffering an injury not at work (0)
mechanismFall: The OR of suffering an injury at work from an object versus suffering an injury at work from a fall (reference).
...
'causeWork:mechanismObject': The incremental change from 'causeWork' given mechanism=object (versus fall)
Does R automatically use 0 as the reference for all cases? If that is the case, would the intercept be the odds of NOT suffering and injury? Is my interpretation of the 'causeWork' OR correct? Thanks!
回答1:
R, to my understanding, does automatically use 0 as the reference class. For categorical variables that are not hierarchical it selects just one for the reference but I am not sure how it does so. Nonetheless, your interpretation of the causeWork odds ratio is correct: when the causeWork predictor goes from 0 to 1, while all other predictors are held constant, the odds that an injury will occur increases by 1.06 (or the respected confidence interval).
来源:https://stackoverflow.com/questions/38575321/generalized-linear-regression-model-with-binary-exposure-and-interaction-terms