Heterogeneity
EMSE 6035: Marketing Analytics for Design Decisions
John Paul Helveston
November 18, 2026

Quiz 5 - last one!

Write your name on the quiz!
Rules:
  • Work alone; no outside help of any kind is allowed.
  • No calculators, no notes, no books, no computers, no phones.

Houskeeping items

  • Final presentations will be on 12/09, 2:30pm - 5:00pm in SEH B1270 (Lehman Auditorium).
  • Final Analysis (due 12/06) will also be an html page report.
  • I am planning on posting all final analyses (without grades) to the course site as a showcase for future students - please DM me if you would NOT like your report posted. (examples from last year)

Week 13: Heterogeneity

1. Mixed logit (unobserved heterogeneity)

2. Sub-group modeling (observed heterogeneity)

3. Sensitivity analysis

Week 13: Heterogeneity

1. Mixed logit (unobserved heterogeneity)

2. Sub-group modeling (observed heterogeneity)

3. Sensitivity analysis

Two ways of modeling heterogeneity

“Observed Heterogeneity”

“Unobserved Heterogeneity”

Mixed logit

Preference parameters follow a distribution
across sample population

\[\tilde{u}_j = \beta_1 x_j + \varepsilon_j\]
\[\beta_1 \sim \mathrm{N} (\mu_1, \sigma_1)\]
Parameter Estimate Standard Error
\(\mu_1\) 0.1 0.01
\(\sigma_1\) 0.1 0.01

Which distribution should I use?

Normal distribution

When preferences can be positive or negative

e.g. brand = "n"

Log-normal distribution

When preferences should be strictly positive

e.g. -1*price = "ln"

Fixed parameter

When preferences appear to be homogeneous

(e.g. \(\sigma\) is very small)

Mixed logits are not equivalent in Preference vs. WTP space

Preference space
\[\tilde{u}_j = \alpha p_j + \beta x_j + \varepsilon_j\]
\[\alpha \sim \ln\mathrm{N} (\mu_1, \sigma_1)\]
\[\beta \sim \mathrm{N} (\mu_2, \sigma_2)\]

Mixed logits are not equivalent in Preference vs. WTP space

Preference space
\[\tilde{u}_j = \alpha p_j + \beta x_j + \varepsilon_j\]
\[\alpha \sim \ln\mathrm{N} (\mu_1, \sigma_1)\]
\[\beta \sim \mathrm{N} (\mu_2, \sigma_2)\]
\[\omega = \frac{\beta}{-\alpha} = \frac{\mathrm{N} (\mu_2, \sigma_2)}{- \ln\mathrm{N} (\mu_1, \sigma_1)}\]
WTP space
\[\tilde{u}_j = \lambda(\omega_1 x_j - p_j) + \varepsilon_j\]
\[\omega_1 \sim \mathrm{N} (\mu_1, \sigma_1)\]

Practice Question 3

  1. Use the logitr package to estimate the following homogeneous model:

\[ \tilde{u}_j = \beta_1 x_j^{\mathrm{price}} + \beta_2 \delta_j^{\mathrm{feat}} + \beta_3 \delta_j^{\mathrm{dannon}} + \beta_4 \delta_j^{\mathrm{hiland}} + \beta_5 \delta_j^{\mathrm{weight}} + \varepsilon_j \]

where the three \(\delta\) coefficients are dummy variables for Dannon, Hiland, and Weight Watchers brands (Yoplait is the reference level).

  1. Use the logitr package to estimate the same model but with the following mixing distributions:
  • \(\beta_1 \sim \mathrm{N} (\mu_1, \sigma_1)\)
  • \(\beta_2 \sim \mathrm{N} (\mu_2, \sigma_2)\)

Estimating mixed logit models with logitr


1. Open logitr-cars
2. Open code/8.1-model-mxl.R

Your Turn

As a team, re-estimate the main model you used in your pilot analysis report, but now using a mixed logit model.

Carefully consider which distributions to use (i.e., normal or log-normal) for different variables.

Week 13: Heterogeneity

1. Mixed logit (unobserved heterogeneity)

2. Sub-group modeling (observed heterogeneity)

3. Sensitivity analysis

Two ways of modeling heterogeneity

“Observed Heterogeneity”

“Unobserved Heterogeneity”

Use interactions to model preferences for multiple groups

Homogenous model:
\(\tilde{u}_j = \beta_1 x_j + \varepsilon_j\)
Two groups: A & B
\(\tilde{u}_j = \beta_1 x_j + \beta_2 x_j \delta^\mathrm{B} + \varepsilon_j\)
\(\quad = (\beta_1 + \beta_2 \delta^\mathrm{B}) x_j + \varepsilon_j\)
Par. Meaning
\(\beta_1\) Effect of \(x_j\) for group A
\(\beta_2\) Difference in effect of \(x_j\) between groups

What’s the difference?

Separate models

\[ \tilde{u}_j^\mathrm{A} = \beta_1^\mathrm{A} x_j + \varepsilon_j^\mathrm{A} \]

\[ \tilde{u}_j^\mathrm{B} = \beta_1^\mathrm{B} x_j + \varepsilon_j^\mathrm{B} \]

Single model

\[\tilde{u}_j = \beta_1 x_j + \beta_2 x_j \delta^\mathrm{B} + \varepsilon_j\]

Accounting for scale differences

Separate models

\[ \tilde{u}_j^\mathrm{A} = \alpha^\mathrm{A} p_j + \beta_1^\mathrm{A} x_j + \varepsilon_j^\mathrm{A} \]

\[ \tilde{u}_j^\mathrm{B} = \alpha^\mathrm{B} p_j + \beta_1^\mathrm{B} x_j + \varepsilon_j^\mathrm{B} \]

Imagine you got the following results

  • \(\hat{\alpha}^\mathrm{A}\) = 100
  • \(\hat{\beta}^\mathrm{A}\) = 200
  • \(\hat{\alpha}^\mathrm{B}\) = 1
  • \(\hat{\beta}^\mathrm{B}\) = 2
Single model

\[\tilde{u}_j = \alpha_1 p_j + \alpha_2 p_j \delta^\mathrm{B} + \beta_1 x_j + \beta_2 x_j \delta^\mathrm{B} + \varepsilon_j\]

\[\quad = (\alpha_1 + \alpha_2 \delta^\mathrm{B}) p_j + (\beta_1 + \beta_2 \delta^\mathrm{B}) x_j + \varepsilon_j\]

Accounting for scale differences

Preference Space

\[ \tilde{u}_j^\mathrm{A} = \alpha^\mathrm{A} p_j + \beta_1^\mathrm{A} x_j + \varepsilon_j^\mathrm{A} \]

\[ \tilde{u}_j^\mathrm{B} = \alpha^\mathrm{B} p_j + \beta_1^\mathrm{B} x_j + \varepsilon_j^\mathrm{B} \]

Imagine you got the following results

  • \(\hat{\alpha}^\mathrm{A}\) = 100
  • \(\hat{\beta}^\mathrm{A}\) = 200
  • \(\hat{\alpha}^\mathrm{B}\) = 1
  • \(\hat{\beta}^\mathrm{B}\) = 2
WTP Space

\[ \tilde{u}_j^\mathrm{A} = \lambda^\mathrm{A}(\omega_1^\mathrm{A} x_j - p) + \varepsilon_j^\mathrm{A} \]

\[ \tilde{u}_j^\mathrm{B} = \lambda^\mathrm{B}(\omega_1^\mathrm{B} x_j - p) + \varepsilon_j^\mathrm{B} \]

\[ \omega = \frac{\beta}{- \alpha} \]

  • \(\hat{\omega}^\mathrm{A} = 200 / (-100) = -2\)
  • \(\hat{\omega}^\mathrm{B} = 2 / (-1) = -2\)

Practice Question 1

Suppose we estimate the following utility model describing preferences for cars:

\[ \tilde{u}_j = \beta_1 x_j^{\mathrm{price}} + \beta_2 x_j^{\mathrm{mpg}} + \beta_3 x_j^{\mathrm{elec}} + \varepsilon_j \]

  1. Using interactions, write out a model that accounts for differences in the effects of \(x_j^{\mathrm{price}}\), \(x_j^{\mathrm{mpg}}\), and \(x_j^{\mathrm{elec}}\) between two groups: A and B.

  2. Write out the effects of \(x_j^{\mathrm{price}}\), \(x_j^{\mathrm{mpg}}\), and \(x_j^{\mathrm{elec}}\) for each group.

Practice Question 2

Suppose we estimate the following utility model describing preferences for chocolate bars between two groups: A & B

\[ \tilde{u}_j = \beta_1 x_j^{\mathrm{price}} + \beta_2 x_j^{\mathrm{caco}} + \beta_3 x_j^{\mathrm{price}}\delta_j^{\mathrm{B}} + \beta_4 x_j^{\mathrm{cacao}}\delta_j^{\mathrm{B}} + \varepsilon_j \]

The estimated model produces the following coefficients and hessian:

\(\beta\) = [-0.7, 0.1, 0.2, 0.8]

\[ H = \begin{bmatrix} -6000 & 50 & 60 & 70 \\ 50 & -700 & 50 & 100 \\ 60 & 50 & -300 & 20 \\ 70 & 100 & 20 & -6000 \end{bmatrix} \]

  1. Use the mvrnorm() function from the MASS library to generate 10,000 draws of the model coefficients.

  2. Use the draws to compute the mean WTP and 95% confidence intervals of the effects of \(x_j^{\mathrm{price}}\) and \(x_j^{\mathrm{cacao}}\) for each group (A & B).

Estimating mixed logit models with logitr


1. Open logitr-cars

2. Open code/8.2-mnl-groups.R

Your Turn

Do this individually, and compare with your teammates:

  • Examine the demographic and other variables in your pilot data and specify a model that estimates differences between different groups.
  • Write code to estimate that model (or multiple models, e.g. WTP space models).
  • Compute and compare WTP across the different groups.

Week 13: Heterogeneity

1. Mixed logit (unobserved heterogeneity)

2. Sub-group modeling (observed heterogeneity)

3. Sensitivity analysis

What’s a sensitivity analysis?

A market simulation gives you one predicted share for one market.

The next question your client will ask:

“How much does that share change if we change our product?”

  1. Pick a baseline market (e.g., your market simulation)
  2. Change one attribute of your product, holding everything else fixed
  3. Re-run predict() and see how your product’s share moves

Two common sensitivity analyses

1. Sweep the price

Re-predict your product’s share across a range of prices

Market share vs. price
Revenue vs. price (price x share x market size)

2. Push each attribute up & down

Move each attribute by a fixed amount (e.g. +/- 20%) in the direction that raises (“high”) and lowers (“low”) your share

Tornado plot

Sensitivity to price

Solid line = prices included in the survey; dashed = extrapolation beyond that range

Sensitivity to other attributes: “tornado” plot

  • Each bar is the EV’s share when one attribute moves to its low or high value
  • Sorted so the attributes your share depends on most are on top

Sensitivity analysis with logitr


1. Open logitr-cars
2. Open code/9.1-compute-sensitivity.R
3. Open code/9.2-plot-sensitivity.R


These charts belong in your Final Analysis report.
Think about what makes a good baseline market for your project.