Tutorials › Econometrics (Graduate) › A Bayesian Wage Regression Case Study

Bayesian Econometrics · Tutorial 890 of 952

A Bayesian Wage Regression Case Study

Work through a Bayesian wage model from prior specification to posterior interpretation, wage prediction, and posterior predictive checks.

Advanced 11 min read

What You'll Learn

  • Specify a log-wage regression with centered education and a curved experience profile.
  • Choose priors whose scales correspond to plausible wage levels and percentage effects.
  • Translate posterior coefficients into conditional wage ratios and percentage changes.
  • Distinguish a posterior prediction for a new worker from uncertainty about the fitted mean.
  • Use replicated data to check a model feature and interpret the check cautiously.

Case Study: Modeling Hourly Wages

A wage regression can connect familiar economic quantities—education, work experience, and hourly pay—to a model whose assumptions and predictions can be examined directly. The goal here is not to establish a causal return to schooling. It is to work through a Bayesian analysis of a clearly hypothetical wage sample: define an interpretable model, specify priors on an economic scale, summarize posterior effects, predict pay for a worker with specified characteristics, and compare observed data features with replicated data.

Suppose the synthetic data contain 600 workers. For worker \(i\), let \(W_i\) be hourly wage in dollars, \(E_i\) be completed years of education, and \(X_i\) be years of work experience. The outcome is log hourly wage, \(Y_i=\log(W_i)\). Using log wages makes coefficients interpretable as changes in log pay, and exponentiating a log-wage contrast gives a wage ratio.

Model and Economically Interpretable Priors

Center education at 12 years and experience at 10 years: \(e_i=E_i-12\) and \(x_i=X_i-10\). A quadratic experience term allows the association with experience to become flatter as experience accumulates. The regression model is

$$ Y_i=\alpha+\beta_E e_i+\beta_X x_i+\beta_{X2}x_i^2+\varepsilon_i,\qquad \varepsilon_i\mid e_i,x_i\sim N(0,\sigma^2). $$

The model treats observations as conditionally independent given the predictors and parameters. Its conditional mean is the stated quadratic function, and its errors have a common variance and a normal distribution. These are modeling assumptions, not facts guaranteed by the data. In particular, an association in this regression is not automatically a causal effect: unmeasured ability, job type, selection into employment, and other factors could affect both wages and the predictors.

Centering gives the intercept a direct reference point: \(\alpha\) is the mean log wage for a worker with 12 years of education and 10 years of experience. The slope \(\beta_E\) is the change in mean log wage for one more year of education, holding experience fixed. The experience coefficients jointly determine the experience profile; \(\beta_X\) is its local slope at 10 years of experience, not a constant effect at every experience level.

For an illustrative prior, suppose wage knowledge suggests a baseline wage around $25 per hour, an education association around a 7% wage increase per year, and a positive but diminishing experience association. One possible independent prior specification is

$$ \alpha\sim N(\log 25,0.35^2),\quad \beta_E\sim N(\log 1.07,0.04^2),\quad \beta_X\sim N(0.030,0.015^2), $$
$$ \beta_{X2}\sim N(-0.0006,0.00025^2),\qquad \sigma\sim \operatorname{HalfNormal}(0,0.25). $$

The first prior centers the baseline log wage on \(\log 25\); it allows substantial uncertainty around that benchmark. Since \(\exp(\beta_E)\) is the wage ratio for one additional year of education in this model, centering \(\beta_E\) on \(\log 1.07\) corresponds to a 7% prior benchmark. The experience priors encode a positive slope near the centered experience value and a modestly negative curvature. Prior scales should be checked against the units and plausible covariate ranges: a quadratic coefficient that seems small can matter substantially when \(x_i^2\) is large.

Worked Example: Interpreting the Education Prior

The prior mean for \(\beta_E\) is \(\log 1.07\approx0.06766\). What wage change does this benchmark represent, and how broad is a rough 95% prior range for the coefficient?

A one-year education contrast in this model has wage ratio \(\exp(\beta_E)\). At the prior mean, the ratio is

$$ \exp(\log 1.07)=1.07,\qquad 100(1.07-1)=7.00\%. $$

A rough 95% range under the normal prior is its mean plus or minus \(1.96\) standard deviations:

$$ 0.06766\pm1.96(0.04) =[-0.01074,\ 0.1461]. $$

Exponentiating the endpoints gives approximate wage ratios \(\exp(-0.01074)=0.9893\) and \(\exp(0.1461)=1.1573\), or about a 1.07% decrease to a 15.7% increase. This range describes prior uncertainty, not a data-based result. It also shows why interpreting the coefficient scale matters: the prior allows both a small negative association and a sizable positive one.

Posterior Effects on the Wage Scale

The likelihood for the sample is determined by the conditional normal model, and the posterior is proportional to that likelihood times the prior density. In practice, posterior summaries can be computed from converged MCMC draws. Assume here that diagnostics are satisfactory and that the hypothetical sample yields the following summaries. They are illustrative results for this synthetic case, not estimates from real workers.

QuantityPosterior median95% credible interval
\(\alpha\)3.266[3.214, 3.318]
\(\beta_E\)0.071[0.052, 0.090]
\(\beta_X\)0.041[0.028, 0.054]
\(\beta_{X2}\)-0.00082[-0.00112, -0.00052]
\(\sigma\)0.310[0.286, 0.337]

A 95% posterior credible interval is an interval containing 95% of the posterior probability for the parameter, conditional on the model, prior, and observed data. It is not a statement that there is a 95% probability the fixed parameter lies in this particular interval. For a coefficient, the posterior probability of a sign can also be summarized directly from draws. In this illustration, suppose \(P(\beta_E>0\mid\text{data})=0.999\); that is a posterior probability under the specified analysis.

Interpretation: In a log-wage regression, a coefficient contrast \(\Delta\) corresponds to a wage ratio of \(\exp(\Delta)\), or a percentage change of \(100\{\exp(\Delta)-1\}\%\). This is an exact multiplicative comparison under the model, not a causal claim.

Worked Example: Education Effect in Percentage Terms

Use the posterior median \(\beta_E=0.071\) to translate the estimated one-year education contrast onto the wage scale. Then transform the reported credible interval.

The median-coefficient wage ratio is \(\exp(0.071)=1.0736\). Thus the corresponding percentage contrast is

$$ 100\{\exp(0.071)-1\} =100(1.0736-1) =7.36\%. $$

Transforming the coefficient interval endpoint by endpoint gives

$$ 100\{\exp(0.052)-1\}=5.34\%,\qquad 100\{\exp(0.090)-1\}=9.42\%. $$

Because exponentiation is increasing, the transformed interval is approximately 5.34% to 9.42%. In this fitted model, workers differing by one year of education but having the same experience have a modeled wage contrast of about 7.36% at the posterior median, with a 95% credible interval from 5.34% to 9.42%. The interval is for the model-based contrast; it does not account for unmodeled confounding or justify a causal interpretation.

For experience, the local derivative of the model’s conditional mean log wage with respect to experience is \(\beta_X+2\beta_{X2}x\). A one-year difference is more precisely computed from the quadratic model’s finite change, rather than treating that derivative as constant over a full year. Posterior uncertainty for such a contrast should be computed draw by draw, retaining the joint posterior dependence between coefficients; combining separate marginal interval endpoints generally does not give a valid interval for the contrast.

Worked Example: One-Year Experience Contrast

Compare 5 years of experience with 6 years, holding education fixed. At 5 years, \(x=5-10=-5\). Using the posterior median coefficients, the change in predicted log wage is

$$ \Delta =\beta_X+\beta_{X2}\{(-4)^2-(-5)^2\} =0.041+(-0.00082)(16-25) =0.04838. $$

The corresponding wage ratio and percentage contrast are

$$ \exp(0.04838)=1.0496,\qquad 100(1.0496-1)=4.96\%. $$

Thus the plug-in posterior-median profile predicts about 4.96% higher wages at 6 rather than 5 years of experience, all else equal. This is a contrast from the median coefficients, not necessarily the posterior median of the contrast. To obtain a posterior interval or probability for this effect, calculate \(\Delta\) for each joint posterior draw and then summarize those draw-specific values.

Posterior Prediction for a Worker

A prediction for a new worker must include both uncertainty about the regression parameters and the worker-level error. For a new worker with covariates \(e_*\) and \(x_*\), each posterior draw first gives a conditional mean log wage \(\mu_*=\alpha+\beta_Ee_*+\beta_Xx_*+\beta_{X2}x_*^2\). A new log wage is then drawn from \(N(\mu_*,\sigma^2)\), and the predicted hourly wage is its exponential. The spread of these predictions is wider than uncertainty about the conditional mean alone because it includes residual variation among workers.

For a lognormal outcome, exponentiating a conditional mean log wage gives the conditional median wage, not the conditional arithmetic mean. Given fixed parameters, the conditional mean wage is \(\exp(\mu_*+\sigma^2/2)\). Posterior predictive summaries should therefore specify whether they concern a typical (median) wage, a mean wage, or the distribution of an individual future wage.

Worked Example: Predicting a New Worker’s Wage

Consider a new worker with 12 years of education and 10 years of experience, so \(e_*=0\) and \(x_*=0\). The posterior median log-wage prediction is the posterior median of \(\alpha\), 3.266. Its exponent is

$$ \exp(3.266)=26.20. $$

This gives a plug-in estimate of about $26.20 per hour for the conditional median wage at those characteristics. It is not the full predictive distribution for an individual worker. Suppose posterior predictive draws, which also include residual error and parameter uncertainty, give a median wage of $26.30 per hour and a 90% predictive interval of $13.40 to $51.70 per hour.

The interval means that, under this model and conditional on the observed data and stated covariates, 90% of the posterior predictive distribution for a new worker’s hourly wage lies between $13.40 and $51.70. Its width reflects substantial worker-level variation; it is not a 90% credible interval for the conditional median wage.

Checking Fit With Replicated Data

A posterior predictive check asks whether data simulated from the fitted model reproduce features of the observed data that matter for the analysis. For each posterior draw, generate a replicated outcome \(Y_i^{\mathrm{rep}}\) at the observed covariates using the model’s error distribution. Compare a chosen discrepancy \(T\) in the observed data with the same discrepancy in the replicated data. This check is diagnostic: it can reveal a mismatch, but it does not prove the model is correct when the observed value looks typical.

For instance, let \(T\) be the number of workers with hourly wages below $12. In log-wage units this is the number with \(Y_i<\log(12)\). Suppose 108 of the 600 hypothetical observed wages are below $12, so the observed proportion is \(108/600=0.180\). Assume replicated datasets have a median count of 96 and a 90% predictive interval from 72 to 126, with \(P(T(Y^{\mathrm{rep}})\geq T(Y)\mid Y)=0.31\).

The observed count falls within the replicated range and the upper-tail probability is not unusually small. This check does not identify a clear problem for this particular feature. It does not establish that the whole model fits well: other checks could examine tails, variation across experience levels, or residual patterns. The posterior predictive tail probability is not a frequentist test p-value and is not the probability that the model is true.

Why the Case Study Matters

A Bayesian regression analysis is a connected chain of choices and interpretations. Centering predictors makes the intercept useful; priors can then be expressed in terms of a plausible baseline wage and plausible percentage contrasts. The posterior summarizes how those priors combine with the data. Transforming log-wage contrasts makes effects economically readable, while prediction and replicated-data checks address different questions: what might a new worker earn, and can the model reproduce selected features of the observed sample?

The quadratic experience term also illustrates why coefficients should not be interpreted in isolation. A positive \(\beta_X\) does not mean the same percentage wage increase for every additional year of experience. The model’s predicted profile depends on both the linear and squared terms, and a contrast at a particular experience level should be calculated at that level. Likewise, an interval for a transformed effect or prediction should be based on posterior draws of the relevant quantity, rather than assembled from unrelated coefficient summaries.

Common Mistakes

  • Calling the education coefficient a causal return to schooling. The regression estimates a conditional association under its specification. A causal interpretation requires a defensible identification strategy beyond this model alone.
  • Reading a log coefficient as an exact percentage. A coefficient of 0.071 is not exactly a 7.1% wage contrast. Exponentiating gives \(100\{\exp(0.071)-1\}=7.36\%\).
  • Using only the regression mean as a new-worker prediction. The conditional mean omits individual residual variation. A posterior predictive distribution includes both parameter uncertainty and a new error draw.
  • Treating one satisfactory predictive check as proof of fit. A check concerns the chosen discrepancy. It cannot establish that all aspects of the model are adequate.
  • Interpreting a posterior predictive tail probability as the probability the model is true. It measures how often replicated discrepancies are at least as extreme as the observed discrepancy under the specified posterior predictive procedure.
Key takeaway: Keep the model’s scale and target clear. Coefficients describe conditional log-wage contrasts, exponentiated contrasts describe wage ratios, predictions for individuals include residual variation, and posterior predictive checks assess selected features rather than certify a model.

Check Your Understanding

Use the model and interpretations in this case study to answer the following questions.

  1. Why does centering experience at 10 years make the interpretation of \(\alpha\) more specific?
  2. For a log-wage contrast of 0.05, write the formula for the exact percentage wage contrast. Why is 5% only an approximation?
  3. In the quadratic experience model, what determines the local slope at a given number of years of experience?
  4. How does a posterior predictive interval for a new worker differ from an interval for the conditional mean wage?
  5. If an observed discrepancy falls within the central range of replicated discrepancies, what can—and what cannot—you conclude about model fit?
Clinical Biostats