Week 13 - Multiple Regression Analysis with Dummy Variables Study Guide

Overview of Multiple Regression Analysis with Dummy Variables

  • Date: 02.06.2026
  • Presented by: Petar Zivkovic
  • Subject Focus: Understanding how numerical and categorical predictors contribute to outcomes within a regression framework.

Learning Objectives

  • Understand how multiple predictors, both numerical and categorical, influence the outcome in a regression model.
  • Know how to encode categorical variables as dummy variables and include them correctly in regression models.
  • Know how to interpret coefficients, evaluate model quality, and use regression results for practical decision-making.

Business Case Applications

Multiple linear regression is applied across various industries to translate raw data into actionable insights. The following table identifies typical use cases, their variables, and strategic goals:

  • Streaming Service Analysis

    • Outcome (Dependent Variable): Weekly hours watched (Numerical).
    • Predictors (Independent Variables): Preferred content type (Categorical — e.g., series, films); Recommendation exposure rate (Numerical — % of content suggested to user); Autoplay usage rate (Numerical — % of sessions using autoplay).
    • Goal: Identify which factor most drives watch time and suggest improvements to recommendation algorithms.
  • Electric Car Battery Longevity

    • Outcome (Dependent Variable): Battery degradation (%).
    • Predictors (Independent Variables): Miles driven (Numerical); Charging frequency (Numerical); Driving style score (Categorical); Battery type (Categorical).
    • Goal: Determine which factors accelerate degradation to recommend maintenance or warranty adjustments.
  • Hotel Occupancy Forecast

    • Outcome (Dependent Variable): Room occupancy rate (%) (Numerical).
    • Predictors (Independent Variables): Month (Categorical); Average room rate (Numerical); Number of local events (Numerical); Online review rating (Numerical).
    • Goal: Identify drivers of occupancy and advise on pricing or promotional strategies.
  • Restaurant Menu Sales

    • Outcome (Dependent Variable): Number of dishes sold per week (Numerical).
    • Predictors (Independent Variables): Dish price (Numerical); Day of the week (Categorical); Promotional campaign (Categorical).
    • Goal: Determine which factors increase sales to optimize promotions.
  • Online Retail Customer Spend

    • Outcome (Dependent Variable): Monthly spending per customer ($) (Numerical).
    • Predictors (Independent Variables): Number of emails received (Numerical); Previous purchase amount (Numerical); Website visits (Numerical); Product rating (Numerical).
    • Goal: Identify what encourages spending to recommend targeted marketing strategies.

Encoding Categorical Variables

To include non-numerical data in a regression model, categorical variables must be converted into dummy variables (binary indicators).

  • Binary Variables (2 Categories)

    • Represents the presence or absence of a specific condition.
    • Example: Room has a lake view (Yes/No).
    • Encoding: Requires 1 dummy variable.
    • Formula Logic:
      • 11 = Presence of condition (e.g., Lake View exists).
      • 00 = Absence of condition (e.g., No Lake View).
    • Interpretation: The coefficient (β\beta) represents how much a lake view changes the outcome (e.g., price or rating) compared to rooms without it, keeping all other variables constant.
  • Categorical Variables with Multiple Levels (3+ Categories)

    • All effects are measured relative to a designated reference category.
    • Example: Property condition rating (5 levels: Important renovations needed, renovations needed, well maintained, recently renovated, in mint condition).
    • The (k-1) Rule: If there are kk categories, you must create k1k-1 dummy variables.
    • Procedure:
      1. Choose a reference category (e.g., "well maintained").
      2. Create dummies for all other categories: "Important renovations needed," "renovations needed," "recently renovated," and "in mint condition."
    • Interpretation: Each coefficient represents the specific difference in the outcome compared to the reference category.

Data Transformation Example: Property Encoding

Below is an illustration of how original categorical data for properties is transformed into binary numerical columns for regression analysis.

Original Data Structure
  • P1: LakeView-Yes, Condition-Important renovations needed.
  • P2: LakeView-No, Condition-renovations needed.
  • P3: LakeView-Yes, Condition-well maintained.
  • P4: LakeView-No, Condition-recently renovated.
  • P5: LakeView-Yes, Condition-in mint condition.
Encoded Data Table
Property IDLakeViewImportant renovations neededrenovations neededrecently renovatedin mint condition
P111000
P200100
P310000
P400010
P510001

Note: P3 has zeros for all condition dummies because it represents the reference category ("well maintained").

Regression Output Interpretation

Interpreting the output involves looking at the coefficients (β\beta) and the pp-values to determine the impact and reliability of each predictor.

Comparing Model Variations

Initial Regression (Model 1):

  • Intercept: 200000200'000 (represents no lakeview and well maintained). p<0.001p < 0.001.
  • Lakeview: 2200022'000 (p=0.002p = 0.002).
  • Important renovations needed: 40000-40'000 (p=0.001p = 0.001).
  • Renovations needed: 20000-20'000 (p=0.12p = 0.12).
  • Recently renovated: 1800018'000 (p=0.01p = 0.01).
  • In mint condition: 3800038'000 (p=0.001p = 0.001).
  • Observation: The variable "renovations needed" has a pp-value of 0.120.12, which is not statistically significant. This suggests it does not reliably explain price variation compared to the reference category.

Refined Regression (Model 2):

  • The non-significant predictor ("renovations needed") is removed.
  • New Intercept: 200000200'000. This now represents the base price for a property that is either well maintained or only needs minor renovations (as the latter is now absorbed into the intercept) and has no lake view.
  • Lakeview: 2200022'000. (p=0.002p = 0.002).
  • Important renovations needed: 40000-40'000. (p=0.001p = 0.001).
  • Recently renovated: 1800018'000. (p=0.01p = 0.01).
  • In mint condition: 3800038'000. (p=0.001p = 0.001).
Key Interpretation Rules
  • Coefficient (β\beta): In the presence of the condition (compared to the state defined in the intercept), the dependent variable (YY) varies on average by the value of the coefficient, assuming all other variables remain equal.
  • P-Value: Indicates the probability that the coefficient is equal to 00. A high pp-value means there is a high probability that there is no meaningful difference between that category and the reference category.