About
A logistic regression with multiple variables and two class outcome.
Articles Related
General linear model
<MATH> \begin{array}{rrrl} Pr(Y = 1|X) & = & p(X) & = & \frac{\displaystyle e^{\displaystyle B_0 + B_1 . X_1 + \dots + B_i . X_i}}{\displaystyle 1+ e^{\displaystyle B_0 + B_1 . X_1 + \dots + B_i . X_i }} \\ \end{array} </MATH>
Invert of the logit transformation: <MATH> \begin{array}{rrl} log \left (\frac {\displaystyle p(X)}{\displaystyle 1 - p(X)} \right ) & = & B_0 + B_1 X_1 + \dots + B_i X_i \\ \end{array} </MATH>
R
myLogisticRegressionModel <- glm ( targetVariable~�., data=myDataFrame , family = binomial )
summary ( myLogisticRegressionModel )
- tilde means to be modeled as.
- And dot means all the other variables in the data frame
- A binomial family tells to fit the logistic regression model.
Interpretation
We're not too interested in the intercept.
It is difficult to interpret regression coefficients in a multiple regression model, because the correlations between the variables can affect the signs.
When we have correlated variables, these variables act as surrogates for each other and it can affect:
- the sign of the coefficient
- the p-value (significant or not)