6  Censored, Truncated or Selected Data

6.1 Compare three different cases

A sample is truncated if some observations are systematically excluded from the sample. For example, suppose we are interested in relationship between people’s income(\(y\)) and education(\(x\)). If we have observations of both \(y\) and \(x\) only for people whose income is above $20,000 per year, then we have a truncated sample. A sample is censored if no observations have been systematically excluded but some of information contained in them has been suppressed. In other words, in a truncated sample, you don’t have observations which have been truncated; while in a censored sample, you do have observations but you don’t have full information. The idea of “censoring” is that some data above or below a threshold are mis-reported at the threshold. If we use the same example of people’s income, if people with income lower than $20,000 per year do not appear in the sample at all—we have no observations of either \(y\) or \(x\) for them—then we have a truncated sample. If we have observations of \(x\) for people whose income above AND below that limit, but no information on exactly how much their income is for those whose income below the limit (only thing we know is that it’s lower than $20,000 per year), then we have a censored sample.

Sample selection is a third case, and it is not censoring with an extra variable attached. In a censored sample the outcome is missing in a known way: the threshold is known, and the suppressed value is known to lie beyond it. That is information, and the Tobit model below uses it. In a selected sample the outcome is simply unobserved for some units, and what decides whether we observe it is a separate selection process rather than the value of \(y\) crossing a threshold. There need be no threshold in \(y\) at all.

Truncation Censoring Sample selection
What we observe for a unit that is selected out nothing; the unit is absent from the sample \(x\), and the fact that \(y\) lies beyond the threshold \(x\); \(y\) is missing
Is a threshold in \(y\) known? yes yes not in general
What determines observation the value of \(y\) the value of \(y\) a separate selection process, usually its own equation

The union example is sample selection. We observe education for everybody, members and non-members alike, and income only for members. Nothing tells us that a non-member’s income sits above or below any particular figure; it is simply missing. Union membership is the selection equation, and it is what the estimation below has to model. So read sample selection as missing outcome data governed by a selection process.

6.2 An illustration for truncated or censored data

Consider the model \[ y_t^0=\beta_1 +\beta_2 x_t +u_t, \ u_t \sim NID(0, \sigma^2), \tag{6.1}\] where \(y_t^0\) is a latent variable. We actually observe \(y_t\), which differs from \(y_t^0\) , because it’s either truncated or censored.

Suppose that censorship or truncation occurs whenever \(y_t^0\) is less than 0. Clearly, the larger the error term \(u_t\), the larger is \(y_t^0\) and thus the greater must be the probability that \(y_t^0 \geq 0\). This probability also depends on \(x_t\). So for the sample we observe, \(E(y_t \mid x_t)\) is no longer \(x_t\beta\): censoring or truncation changes the observed conditional mean, so the gap between \(y_t\) and \(x_t\beta\) does not have conditional mean 0. The latent error \(u_t\) itself need not be endogenous. OLS of \(y_t\) on \(x_t\) in truncated or censored samples is therefore biased and inconsistent for the latent slope \(\beta\). Selection on \(x_t\) alone would not do this. Normally we would like to draw inference on the population which is represented by the full sample. Shown in the figure below, ideally we would have the OLS regression line (if we had the full sample), which is very close to the “true” regression line (which is the mechanism generates the data). We would have the “OLS censored sample” line if we run OLS on the censored sample; we would have “OLS truncated sample” if we run OLS on the truncated sample. It shows that both of them are severely biased from the “true” regression line.

Here is a graph to illustrate from Davidson and MacKinnon (2004).

Scatterplot of y against x with four fitted lines. Filled circles lie above the zero line and hollow circles below it, marking the observations lost to censoring or truncation. The true regression line and the full-sample OLS fit are steep and nearly coincide; the censored-sample and truncated-sample fits are visibly flatter, attenuated toward zero slope.

Effects of truncation and censoring from Davidson and MacKinnon (2004)

6.3 Truncated Models

For truncated data, a consistent estimator comes from maximum likelihood estimator (MLE). If we assume the error terms in the latent variable model has a known distribution, then MLE estimator can be applied. The most popular choice is Gaussian. \[ \begin{aligned} \mbox{Pr}(y_t^0 \geq 0) & = \mbox{Pr} ({{\symbf{X}}}_t \beta +u_t \geq 0) \\ & = 1- \mbox{Pr} (u_t/\sigma < - {{{\symbf{X}}}_t \beta} / \sigma) \\ & = 1- \Phi (-{{{\symbf{X}}}_t \beta} / \sigma)=\Phi ({{{\symbf{X}}}_t \beta} / \sigma) \end{aligned} \tag{6.2}\]

The density of \(y_t\) is proportional to the density of \(y_t^0\) when \(y_t^0 \geq 0\) and \(y_t\) is observed. It is 0 elsewhere. The factor of proportionality, which is needed to ensure that the density integrates to unity, is the inverse of the probability that \(y_t^0 \geq 0\). The density of \(y_t\) can be written as \[ \frac{\sigma^{-1} \phi ((y_t - {{\symbf{X}}}_t \beta)/\sigma)}{\Phi ({{\symbf{X}}}_t \beta / \sigma)} \tag{6.3}\]

This implies the log-likelihood function, \[ \ell ({{\symbf{y, \beta}}}, \sigma)=- \frac{n}{2} \log(2 \pi) -n \log(\sigma) - \frac{1}{2 \sigma^2} \sum_{t=1}^n(y_t-{{\symbf{X}}}_t \beta)^2 - \sum_{t=1}^n \log \Phi ({{\symbf{X}}}_t \beta / \sigma). \tag{6.4}\]

This can be estimated by MLE. In Stata, truncreg is the command to do truncated regression model.

6.4 Censored Models

The most popular censored model is Tobit model. \[ \begin{aligned} y_t^0 & = {{\symbf{X}}}_t \beta +u_t, \quad u_t \sim NID(0, \sigma^2) \\ y_t & = y_t^0 \ \mbox{if} \ y_t^0 > 0; \ y_t=0 \ \mbox{otherwise}. \end{aligned} \tag{6.5}\]

We see that \[ \begin{aligned} \mbox{Pr}(y_t= 0) & = \mbox{Pr} (y_t^0 \leq 0) = \mbox{Pr} ({{\symbf{X}}}_t \beta +u_t \leq 0) \\ & = \mbox{Pr} (u_t/\sigma < - {{{\symbf{X}}}_t \beta} / \sigma) \\ & = \Phi (-{{{\symbf{X}}}_t \beta} / \sigma) \end{aligned} \tag{6.6}\]

The contribution to the log-likelihood function made by observations with \(y_t=0\) is \[ \ell_t(y_t, \beta, \sigma) = \log \Phi (-{{\symbf{X}}}_t \beta/\sigma). \tag{6.7}\]

If \(y_t\) is positive, the contribution to the log-likelihood is the logarithm of the density, \[ \log(\frac{1}{\sigma} \phi ((y_t - {{\symbf{X}}}_t \beta) / \sigma )). \tag{6.8}\]

The log-likelihood function of the tobit model is \[ \sum_{y_t=0} \log \Phi (-{{\symbf{X}}}_t \beta/\sigma) + \sum_{y_t>0} \log(\frac{1}{\sigma} \phi ((y_t - {{\symbf{X}}}_t \beta)/\sigma )) \tag{6.9}\]

This can be estimated by MLE. In Stata, tobit or intreg can be used for censoring models.

Both this likelihood and the truncated one in Equation 6.4 lean on the normal, homoskedastic latent error far more than a linear regression does. The slope \(\beta\) and the scale \(\sigma\) enter together through \(\Phi({\symbf{X}}_t\beta/\sigma)\) and the Mills-ratio terms, so if \(u_t\) is heteroskedastic or not normal, the MLE of \(\beta\) is inconsistent. This is not like linear OLS or Poisson QMLE, where a correct conditional mean is enough and a sandwich variance repairs the standard errors: vce(robust) after tobit or truncreg fixes nothing about the point estimates.

6.5 Sample Selection

The sample selection models differ from censored model in that it involves a different variable (from \(y\) itself) to determine the censorship (selection).

Suppose that \(y_t^0\) and \(z_t^0\) are two latent variables, generated by the bivariate process

\[ \begin{bmatrix} y_t^0 \\ z_t^0 \end{bmatrix} =\begin{bmatrix} {{\symbf{X}}}_t \beta \\ {{\symbf{W}}}_t \gamma \end{bmatrix}+ \begin{bmatrix} u_t \\ v_t \end{bmatrix}, \ \begin{bmatrix} u_t \\ v_t \end{bmatrix} \sim NID({{\symbf{0}}}, \begin{bmatrix} \sigma^2 & \rho\sigma \\ \rho\sigma & 1 \end{bmatrix}) \tag{6.10}\]

Here \(\rho\) is the correlation between \(u_t\) and \(v_t\); since \(\mbox{Var}(u_t)=\sigma^2\) and \(\mbox{Var}(v_t)=1\), their covariance is \(\rho\sigma\).

We observe \(y_t\) and \(z_t\): \[ y_t = y_t^0 \ \mbox{if} \ z_t^0 > 0; \ y_t \ \mbox{unobservable otherwise}; \\ z_t = 1 \ \mbox{if} \ z_t^0 > 0; \ z_t=0 \ \mbox{otherwise}. \tag{6.11}\]

There are two types of observations, ones we observe \(y_t=y_t^0\) and \(z_t=1\), along with both \({\symbf{X_t}}\) and \({\symbf{W_t}}\), and ones we observe only \(z_t=0\) and \({\symbf{W_t}}\).

Each observation contributes to the likelihood function by \[ I(z_t=0)\mbox{Pr}(z_t=0)+I(z_t=1)\mbox{Pr}(z_t=1)f(y_t^0 | z_t=1), \tag{6.12}\]

Under the normality assumption, \[ u_t=\rho\sigma v_t+e_t \tag{6.13}\] where \(e_t\) is independent of \(v_t \sim N(0,1)\), with \(\mbox{Var}(e_t)=\sigma^2(1-\rho^2)\). A useful fact about the standard normal distribution is that \[ {{\mathrm{E}}} (v_t | v_t>-x)=\lambda (x) =\frac{\phi(x)}{\Phi(x)} \tag{6.14}\] and the function \(\lambda(x)\) is called the inverse Mills ratio.

The log-likelihood function can be shown to be \[ \sum_{z_t=0} \log \Phi(-{{\symbf{W}}}_t \gamma)+\sum_{z_t=1} \log(\frac{1}{\sigma} \phi ((y_t - {{\symbf{X}}}_t \beta)/\sigma)) + \sum_{z_t=1} \log \Phi (\frac{{{\symbf{W}}}_t \gamma+\rho (y_t-{{\symbf{X}}}_t \beta)/\sigma}{(1-\rho^2)^{1/2}}) \tag{6.15}\]

So this model can be estimated by MLE.

It is also popular to use Heckman’s (1979) two-step method.

Heckman’s method is based on the fact that the original latent model can be rewritten as \[ y_t={{\symbf{X}}}_t \beta + \rho\sigma v_t +e_t \tag{6.16}\]

Here the error term \(u_t\) is divided into two parts, one perfectly correlated with \(v_t\), and one independent of \(v_t\).

In the first step, an ordinary probit model is used to obtain consistent estimates \(\hat \gamma\) of the parameters of the selection equation.

In the second step, the unobserved \(v_t\) is replaced by the selectivity regressor \(\frac{\phi({{\symbf{W}}}_t \hat \gamma)}{\Phi({{\symbf{W}}}_t \hat \gamma)}\).

Therefore, the regression becomes \[ y_t={{\symbf{X}}}_t \beta + \rho\sigma \frac{\phi({{\symbf{W}}}_t \hat \gamma)}{\Phi({{\symbf{W}}}_t \hat \gamma)} + e_t \tag{6.17}\]

Or, \[ y_t={{\symbf{X}}}_t \beta + \rho\sigma \hat \lambda_t + e_t \tag{6.18}\]

Strictly, Equation 6.18 hides two parts of the error. Write \(\lambda_t = \phi({\symbf{W}}_t\gamma)/\Phi({\symbf{W}}_t\gamma)\) for the inverse Mills ratio at the true \(\gamma\). Conditional on selection, the second-step error is

\[ u_t^* = e_t + \rho\sigma(v_t - \lambda_t) + \rho\sigma(\lambda_t - \hat\lambda_t). \tag{6.19}\]

The middle term makes the error heteroskedastic even with \(\gamma\) known. Among selected units, \(\text{Var}(v_t \mid z_t = 1, {\symbf{W}}_t) = 1 - \lambda_t(\lambda_t + {\symbf{W}}_t\gamma)\), so the error variance is \(\sigma^2[1 - \rho^2\lambda_t(\lambda_t + {\symbf{W}}_t\gamma)]\), which changes from unit to unit. The last term comes from estimating \(\gamma\): \(\hat\lambda_t\) is a generated regressor, as in the control-function discussion of the Endogeneity chapter. A robust (sandwich) variance in the second-step OLS handles the first problem but not the second. Heckman’s two-step covariance matrix, or a bootstrap over both steps, handles both. Neither term biases the coefficients: \(\rho\sigma\) on \(\hat\lambda_t\) and \(\beta\) remain consistent.

One thing to note in Heckman model is that in many situations, \(\hat \lambda\) is believed to be highly collinear with \({\symbf{X_t}}\), if \({\symbf{W_t}}\) is the same as \({\symbf{X_t}}\). However, the model can still be estimated due to the nonlinearity of the model. Nevertheless, it becomes a regular practice to require \({\symbf{W_t}}\) contains at least one extra variable than \({\symbf{X_t}}\), which is sometimes called exclusion restriction. In many situations, \({\symbf{W_t}}\) contains all \({\symbf{X_t}}\) variables, and at least one more variable. The reason to include all the \({\symbf{X_t}}\) variables is more mundane than it is often made to sound: whatever plausibly affects selection belongs in the selection equation, and the determinants of the outcome usually do. What identification turns on is the other direction – at least one variable in \({\symbf{W_t}}\) kept out of \({\symbf{X_t}}\), affecting selection but not the outcome. Without such an exclusion, \(\hat\lambda\) is a nonlinear function of the same \({\symbf{X_t}}\)’s and identification rests entirely on that nonlinearity.

In Stata, heckman is the command to do sample selection models. It has options to do a Heckman two-step estimation or MLE estimation. MLE is usually preferred, on the understanding that its efficiency advantage holds if the joint normality it assumes is right. The two-step estimator is less efficient but leans less heavily on the full likelihood, which makes it easier to diagnose when the specification is in doubt.

6.6 Switching Regression (Treatment-Effects Model)

There is another situation that is similar to sample selection model: we observe \(y\) for \(z=1\) and \(z=0\). In the example of effect of education on income, we observe both union member’s income and non-member’s income. In this case, we have switching regression model or treatment-effect model. The treatment effect model estimates the effect of an endogenous binary treatment \(z_t\) (treatment, program participation, etc.) on a continuous, fully-observed variable, \(y_t\), conditional on the independent variables \(x_t\) and \(w_t\).

Suppose \(z_t^0\) is a latent variable.

\[ \begin{bmatrix} y_t \\ z_t^0 \end{bmatrix} =\begin{bmatrix} {{\symbf{X}}}_t \beta \\ {{\symbf{W}}}_t \gamma \end{bmatrix}+ \delta \begin{bmatrix} {z_t} \\ 0 \end{bmatrix} + \begin{bmatrix} u_t \\ v_t \end{bmatrix}, \ \begin{bmatrix} u_t \\ v_t \end{bmatrix} \sim NID({{\symbf{0}}}, \begin{bmatrix} \sigma^2 & \rho\sigma \\ \rho\sigma & 1 \end{bmatrix}) \tag{6.20}\]

We observe \(y_t\) and \(z_t\): \[ z_t = 1 \ \mbox{if} \ z_t^0 > 0; \ z_t=0 \ \mbox{otherwise}. \tag{6.21}\]

Notice that the only difference between this model and the selection model is that we observe \(y_t\) when \(z_t=0\) and \(z_t=1\). It’s not a selection, but a regime switching.

One caveat about the name. The specification above lets treatment shift only the intercept: there is a single \(\beta\) and a single \(\delta\), so the treatment effect is \(\delta\) for everyone. That is the treatment-effects model. A switching regression in the fuller sense lets the whole coefficient vector differ by regime,

\[ y_t = z_t ({{\symbf{X}}}_t \beta_1 + u_{1t}) + (1-z_t)({{\symbf{X}}}_t \beta_0 + u_{0t}), \qquad z_t^0 = {{\symbf{W}}}_t \gamma + v_t, \tag{6.22}\]

with \(u_{1t}\) and \(u_{0t}\) each allowed to correlate with \(v_t\) (two selection parameters, \(\rho_1\) and \(\rho_0\), rather than one). This is the Roy model, and the treatment effect \({{\symbf{X}}}_t(\beta_1-\beta_0)\) then varies with \({\symbf{X_t}}\) instead of being a constant. The distinction matters in practice: if the returns to education genuinely differ between union and non-union jobs, the common-slope model above will report a single \(\delta\) that is some average of them and will not reveal the heterogeneity. Fitting it requires two outcome equations rather than one intercept shift.

A word on software, since the two models above are easy to conflate. Stata’s etregress fits the common-slope specification – the endogenous treatment-effects model with a single \(\delta\) – not the two-regime switching regression with separate \(\beta_1\) and \(\beta_0\). For the fuller Roy-type model, Stata users generally reach for the user-written movestay (endogenous switching regression), and SAS’s qlim covers a range of limited-dependent and selection specifications. The default in each case is MLE.

6.7 Summary

Truncation drops units outside a threshold. Censoring keeps them but reports only that the outcome lies beyond a known threshold. Sample selection leaves the outcome missing for units chosen by a separate process. In all three, OLS on the observed data is biased and inconsistent, because the error no longer has mean zero given the regressors. Truncated regression and Tobit fix the first two by maximum likelihood under normal errors.

For selection, the Heckman model adds a selection equation whose error is correlated with the outcome error. It can be estimated by MLE, or in two steps with a probit followed by OLS that includes the inverse Mills ratio. The two-step version is less efficient but relies less on the full likelihood. It is fragile when the selection equation has no variable excluded from the outcome equation. When the outcome is observed in both regimes, the problem becomes an endogenous treatment-effects model. Its fuller form, the Roy switching regression, lets every coefficient differ by regime.