32 次浏览

二分类 Logistic 回归:应用研究入门

What Is Binary Logistic Regression?

Binary logistic regression is used when the outcome has exactly two categories, such as success or failure, disease or no disease, and pass or fail. Instead of modeling the outcome itself as a straight-line mean, logistic regression models the probability of one outcome category.

Because probabilities must stay between 0 and 1, logistic regression works with the log-odds of the event:

log(p / (1 - p)) = b0 + b1X1 + b2X2 + ...

Why Use Logistic Regression?

  • The dependent variable is binary.
  • You want to estimate how one or more predictors change the odds of the event.
  • You need a model that can produce predicted probabilities for real cases.

What Do the Coefficients Mean?

Each regression coefficient describes how the log-odds change for a one-unit increase in the predictor, holding other variables constant. Exponentiating the coefficient gives an odds ratio, which is usually easier to interpret.

For example, if the odds ratio is 1.20, the odds of the event increase by 20 percent for each one-unit increase in that predictor, assuming the other predictors stay fixed.

Step-by-Step Method

  1. Define the binary outcome clearly.
  2. Select predictors based on a real research question.
  3. Check data quality, coding, and missing values.
  4. Fit the logistic regression model.
  5. Inspect coefficients, odds ratios, confidence intervals, and p-values.
  6. Evaluate model fit and predictive usefulness.
  7. Translate the model into plain-language probabilities or odds.

An Original Example

Suppose a training program wants to predict whether a participant passes a certification exam. One predictor is the number of practice sessions completed. After fitting a simple logistic regression, the odds ratio for practice sessions is 1.18.

This means that each additional practice session is associated with an 18 percent increase in the odds of passing, on average. If the coefficient is statistically significant and the model diagnostics are acceptable, the result suggests that practice intensity is meaningfully related to success.

You can also convert the model output into predicted probabilities. For instance, a participant with 2 practice sessions may have a predicted pass probability of 0.46, while a participant with 8 sessions may have a predicted probability of 0.71.

Main Assumptions and Checks

  • Observations are independent.
  • The outcome is binary.
  • Predictors are measured appropriately and coded correctly.
  • Continuous predictors have a sensible relationship with the log-odds.
  • Severe multicollinearity is absent if multiple predictors are included.

Common Mistakes

  • Interpreting odds ratios as if they were risk ratios without caution.
  • Using too many predictors for a small sample.
  • Ignoring model fit and focusing only on coefficient p-values.
  • Failing to explain the reference category for categorical predictors.

Short Summary

Binary logistic regression is a practical method for modeling yes or no outcomes. When you understand the role of odds, probabilities, and model assumptions, it becomes an accessible tool for applied research and decision-making.