# 32. Binary logistic regression

## Purpose

Which business characteristics predict customer churn?

## Practice study

- File: [business-outcomes-observed.csv](../samples/business-outcomes-observed.csv)
- Observations: 500
- Data type: deterministic synthetic instructional data
- Complexity: a realistic multivariable observed-data analysis

## Exact procedure

1. Start QuickPLS and choose **New Project**. Enter a readable project name such as **Binary logistic regression Tutorial** and choose a local `.qpls` destination.

2. Open **Data**, choose **Import Data**, select **business-outcomes-observed.csv**, keep the detected header row, review the preview, and choose **Import**. Confirm 500 observations are available.

   ![Binary logistic regression imported data](../screenshots/binary-logistic-regression/01-data-ready.png)

3. This method does not require a latent-variable diagram. In its setup screen use these roles: Outcome: customer_churn. Predictors: business_performance, market_turbulence, analytics_capability, and organizational_agility. Controls: firm_age_years and employee_count_log.

4. Review the selected outcome, predictors, groups, or analysis variables. Remove case_id and every unused teaching/reference column from the analysis selection.

   ![Binary logistic regression prepared model or variable roles](../screenshots/binary-logistic-regression/02-variable-roles.png)

5. Check that every required role is populated with a numeric variable and that outcome/predictor selections do not overlap.

6. Use **Calculate → Regression → Binary logistic**.

   ![Binary logistic regression calculation setup](../screenshots/binary-logistic-regression/03-calculation-setup.png)

7. Complete the method-specific settings:

- Confirm customer_churn is coded strictly 0/1
- Keep the default classification cutoff for the first run

8. Read **Readiness**, leave **Open Results when finished** selected, and choose **Start calculation** once. Wait for **Completed**; do not close the project while the result is being saved.

9. In **Results**, confirm **Binary logistic regression** is selected and inspect these outputs in order:

1. Coefficients and odds ratios
2. Model fit
3. Classification/confusion table
4. ROC/AUC and cutoff chart

   ![Binary logistic regression primary result](../screenshots/binary-logistic-regression/04-results-primary.png)

   ![Binary logistic regression secondary result](../screenshots/binary-logistic-regression/05-results-secondary.png)

10. Choose **Save Report** to preserve the exact result. Use **Export** for the needed table/report format. Close and reopen the project once and confirm the saved result remains selectable.

## Reading guidance

- The data are deterministic synthetic teaching data. They are suitable for reproducing the workflow, not for substantive publication claims.
