Tutorials › Econometrics (Graduate) › Estimation and Inference for Two-Part Models

Censoring and Truncation · Tutorial 537 of 952

Estimation and Inference for Two-Part Models

Estimate each part of a two-part model, combine its predictions correctly, and make inference for the resulting mean and marginal effects.

Intermediate 12 min read

What You'll Learn

  • Define the conditioning assumptions needed for a product of binary and positive-outcome predictions to equal a conditional mean.
  • Estimate the binary probability and the positive-outcome mean using their respective observations and covariates.
  • Combine component predictions and differentiate the combined mean to obtain marginal effects.
  • Apply the delta method using the covariance matrix of both component estimators.
  • Use a pairs bootstrap to obtain uncertainty for the combined prediction without assuming component estimates are independent.

Why Inference Must Recombine the Two Parts

A two-part model describes an outcome with a mass at zero and a positive value otherwise. Its two components answer different questions: how likely is a positive outcome, and what is the expected outcome among cases that are positive? Neither component alone gives the expected outcome for the full population. For that target, the component predictions must be combined, and uncertainty in both predictions must be carried through the calculation.

The conditioning sets matter. A probability specified using one set of covariates and a positive-outcome mean specified using another cannot automatically be multiplied and called a conditional mean. The product has that interpretation only when the component specifications describe the factors of the same conditional expectation.

Definition: Let \(Y_i\geq 0\) be the outcome and let \(D_i=1(Y_i>0)\) indicate a positive outcome. For covariates \(w_i,z_i\), define \(p_i=P(D_i=1\mid w_i,z_i)\) and \(\mu_{i+}=E(Y_i\mid D_i=1,w_i,z_i)\). The conditional mean is \(m_i=E(Y_i\mid w_i,z_i)=p_i\mu_{i+}\). A two-part model may specify \(p_i=p(w_i;\gamma)\) and \(\mu_{i+}=\mu_+(z_i;\beta)\) only under the additional restrictions that \(P(D_i=1\mid w_i,z_i)\) is represented by the first specification and \(E(Y_i\mid D_i=1,w_i,z_i)\) by the second. These restrictions allow the factors to use different covariate sets while referring to the same conditioning information \((w_i,z_i)\).

The identity follows by conditioning on whether the outcome is positive. Since \(Y_i=0\) when \(D_i=0\), the part of the expectation for zero outcomes contributes nothing:

$$ E(Y_i\mid w_i,z_i) =P(D_i=0\mid w_i,z_i)\cdot 0 +P(D_i=1\mid w_i,z_i)E(Y_i\mid D_i=1,w_i,z_i) =p_i\mu_{i+}. $$

This identity does not itself justify a particular regression specification. The modeler must ensure that each estimated component represents its factor conditional on the same information. One straightforward case uses the same covariates in both parts. Another permits different covariates but assumes, as the model restriction, that the binary probability depends on \(w_i\) and not additionally on \(z_i\), while the positive mean depends on \(z_i\) and not additionally on \(w_i\).

Estimating and Combining the Components

A common specification models the binary indicator with a logit:

$$ p_i=P(D_i=1\mid w_i,z_i)=\Lambda(w_i'\gamma), \qquad \Lambda(a)=\frac{1}{1+\exp(-a)}. $$

The parameters \(\gamma\) are estimated from the binary outcomes for all \(n\) observations. The positive-outcome component is estimated using observations with \(D_i=1\), under a model for \(E(Y_i\mid D_i=1,w_i,z_i)\). For instance, a log-linear conditional-mean specification is \(\mu_{i+}=\exp(z_i'\beta)\). Other appropriate positive-outcome models can be used; what matters for the combined-mean calculation is that \(\mu_{i+}\) is the model-implied conditional mean, not just a generic index.

After estimation, write the parameter vector as \(\theta=(\gamma',\beta')'\). The plug-in prediction for the conditional mean at covariate values \((w,z)\) is the product of the two fitted components:

$$ \widehat m(w,z) =\widehat p(w)\widehat\mu_+(z) =p(w;\widehat\gamma)\mu_+(z;\widehat\beta). $$

Worked Example: Combining Two Fitted Parts

Suppose a hypothetical sample of 200 households records monthly out-of-pocket spending on a service, in dollars. Eighty households have positive spending. A fitted binary model predicts a 0.40 probability of positive spending for a household with specified covariates. A fitted positive-outcome model predicts a mean of $10 among households with positive spending at those covariates. Assume, as part of the model, that these predictions represent \(P(D=1\mid w,z)\) and \(E(Y\mid D=1,w,z)\), respectively.

The model-implied conditional mean spending is

$$ \widehat m =\widehat p\,\widehat\mu_+ =0.40\times \$10 =\$4.00 \text{ per household per month}. $$

The interpretation is an average across all households at the specified covariates, including those predicted to spend zero. It is not the expected spending conditional on positive spending; that prediction is $10. The sample size and number of positive observations describe the hypothetical data, but the fitted probabilities and means are the quantities used in this calculation.

Marginal Effects of the Combined Mean

A covariate can affect the overall conditional mean through either component, or both. For a continuous covariate \(x\) that enters the two fitted functions, differentiating their product gives the marginal effect:

$$ \frac{\partial m}{\partial x} =\mu_+\frac{\partial p}{\partial x} +p\frac{\partial\mu_+}{\partial x}. $$

The first term is the change in the probability of a positive outcome, weighted by the positive-outcome mean. The second is the change in the positive-outcome mean, weighted by the probability of being positive. This is a derivative of the overall conditional mean; it is not generally equal to either component’s coefficient.

Worked Example: Combining Marginal Effects

At a particular covariate value, suppose a hypothetical logit component gives \(p=0.40\) and has slope \(\gamma_x=0.50\). Suppose the positive mean is log-linear, with \(\mu_+=\$8\) and slope \(\beta_x=0.20\). The slopes are per one-unit increase in \(x\), with other covariates held fixed. For the logit, \(\partial p/\partial x=p(1-p)\gamma_x\); for the log-linear mean, \(\partial\mu_+/\partial x=\mu_+\beta_x\). Thus,

$$ \begin{aligned} \frac{\partial p}{\partial x} &=0.40(1-0.40)(0.50)=0.12,\\ \frac{\partial\mu_+}{\partial x} &=\$8(0.20)=\$1.60,\\ \frac{\partial m}{\partial x} &=(\$8)(0.12)+(0.40)(\$1.60)\\ &=\$0.96+\$0.64 =\$1.60 \text{ per one-unit increase in }x. \end{aligned} $$

At these covariates, a one-unit increase in \(x\) changes the model-implied conditional mean at an instantaneous rate of $1.60 per household, per month, per unit of \(x\). The calculation combines both pathways. For a binary covariate, report the discrete difference in predicted means between its two values rather than interpreting a derivative as a finite change.

Delta-Method Inference for the Combined Mean

A standard error for \(\widehat m\) must account for estimation error in both components and their covariance. Let \(\widehat\Sigma\) estimate the covariance matrix of the joint parameter estimator \(\widehat\theta=(\widehat\gamma',\widehat\beta')'\). Under standard large-sample conditions, including consistent component estimation, differentiability of the prediction function, and a suitable asymptotic distribution for \(\widehat\theta\), the delta method approximates the variance of a smooth function of \(\widehat\theta\) using its gradient.

For \(m=p(w;\gamma)\mu_+(z;\beta)\), the gradient stacks the derivatives with respect to the two parameter blocks. Therefore the estimated variance and standard error are:

$$ \widehat{\operatorname{Var}}(\widehat m) =\widehat G'\widehat\Sigma\widehat G, \qquad \widehat{SE}(\widehat m) =\sqrt{\widehat G'\widehat\Sigma\widehat G}, \qquad \widehat G= \begin{pmatrix} \widehat\mu_+\nabla_\gamma \widehat p\\ \widehat p\nabla_\beta\widehat\mu_+ \end{pmatrix}. $$

The covariance matrix should correspond to the estimator and sampling assumptions being used. In particular, do not discard cross-covariances merely because the two components were fitted in separate steps. If the model’s likelihood factorization and sampling assumptions imply zero cross-covariance, that can be used; otherwise use the appropriate joint covariance estimate, such as a sandwich estimate or a bootstrap estimate.

Worked Example: A Delta-Method Interval for the Mean

Continue the hypothetical spending setting. Suppose the binary estimate is \(\widehat p=0.40\) with standard error \(0.0346\), and the positive-mean estimate is \(\widehat\mu_+=\$10\) with standard error \(\$0.1342\). For this illustration, assume the two estimates have zero covariance, as can hold in the simple independent-observation setting with a constant probability and a correctly specified conditional positive-mean model. The combined estimate is \(\widehat m=\$4.00\).

For \(m=p\mu_+\), the derivatives with respect to \(p\) and \(\mu_+\) are \(\mu_+\) and \(p\). Under the stated zero-covariance assumption, the delta-method variance is:

$$ \begin{aligned} \widehat{\operatorname{Var}}(\widehat m) &=(\widehat\mu_+)^2\widehat{\operatorname{Var}}(\widehat p) +(\widehat p)^2\widehat{\operatorname{Var}}(\widehat\mu_+)\\ &=(10)^2(0.0346)^2+(0.40)^2(0.1342)^2\\ &=0.119716+0.0028815424=0.1225975424, \\ \widehat{SE}(\widehat m)&=\sqrt{0.1225975424}\approx\$0.3501. \end{aligned} $$

Using the large-sample normal critical value 1.96, a 95% Wald confidence interval is

$$ \$4.00\pm 1.96(\$0.3501) \approx[\$3.314,\ \$4.686]. $$

Under the model and the approximation used, this interval is intended to cover the conditional mean spending at the specified covariates in 95% of repeated samples. It is not a statement that the fixed mean has a 95% probability of lying in this particular computed interval.

Bootstrap Inference

A pairs bootstrap provides an alternative when deriving or implementing the covariance of a combined estimator is inconvenient. Resample observational units, not the two component datasets independently: each resampled unit must retain its \(D_i\), outcome \(Y_i\), and covariates together. In each bootstrap sample, refit both parts, compute the product or marginal effect of interest, and save that statistic. Resampling whole units preserves the observed relationship between positivity, positive outcomes, and covariates.

For a percentile interval, sort the bootstrap estimates and use their 2.5th and 97.5th percentiles as the endpoints of a 95% interval. This procedure requires that the resampling scheme reflect the sampling design; for clustered or otherwise dependent observations, resample the appropriate independent sampling units rather than individual records.

Worked Example: Bootstrap Interval for a Combined Mean

Suppose the original hypothetical sample has a combined-mean estimate of $4.00. The analyst draws 1,000 pairs-bootstrap samples, refits both model components in every sample, and calculates \(\widehat p^{\,*}\widehat\mu_+^{\,*}\). In one replicate, the two fitted predictions are 0.38 and $9.80, giving:

$$ \widehat m^{\,*}=0.38\times \$9.80=\$3.724. $$

After calculating this statistic for all 1,000 replicates, suppose the ordered bootstrap estimates have a 2.5th percentile of $3.31 and a 97.5th percentile of $4.74. The percentile interval is therefore [$3.31, $4.74]. These percentile values are hypothetical bootstrap output; the displayed replicate shows how each value is constructed. The interval reflects variation in both fitted parts because both were re-estimated in every replicate.

Common Mistakes and Practical Checks

The most important check is whether the two components refer to the same conditional target. Writing \(p(w)\mu_+(z)\) does not by itself establish that this product is \(E(Y\mid w,z)\). The model must specify that \(p(w)=P(D=1\mid w,z)\) and \(\mu_+(z)=E(Y\mid D=1,w,z)\), or otherwise define the product as a model-implied target rather than asserting the equality. If an omitted variable in one component changes its conditional factor after conditioning on the full covariate set, the product need not be the desired conditional mean.

A second mistake is to calculate an uncertainty estimate for only one part. The combined mean changes when either the probability or the positive mean changes, so both sources of estimation uncertainty belong in the delta-method calculation. Nor should their covariance be assumed zero without justification. In a bootstrap, fitting both parts on the same resampled units is a practical way to retain their joint sampling variation.

Key takeaway: Define the conditional factors first, verify they describe the same conditioning set, then combine their fitted values. For inference, propagate uncertainty through the product using the full covariance matrix or by refitting both parts in each bootstrap sample.

Check Your Understanding

Use the definitions and procedures above to answer the following questions.

  1. State the conditional-probability and conditional-mean assumptions needed for \(p(w)\mu_+(z)\) to equal \(E(Y\mid w,z)\).
  2. If \(p=0.25\) and the conditional mean among positive outcomes is $16, what is the combined conditional mean? Give its units and interpretation.
  3. Explain why a continuous covariate’s marginal effect on the combined mean generally includes two terms.
  4. For a product \(p\mu_+\), what entries of the component estimator’s covariance matrix may be needed for delta-method inference?
  5. Why should a pairs bootstrap resample the full observational units and refit both parts, rather than resample positive observations alone?
Clinical Biostats