I'm working on regression in Stata, in which I'm taking income as being dependent on sex, education and tenure. Tenure in my data is the number of years spent in the current job. The regression itself doesn't matter really, be it an OLS, quantile or whatever.

I have panel data of 15 waves (or years). My respondents have changed jobs through time and I have calculated tenure to be the time of the last wave minus the time at which they last changed jobs. This means tenure data for each respondent is only available from the time they last changed jobs onwards. So if I have data for 2000-2014 and someone changed jobs in 2010, tenure is then available for 2010-2013 and before 2010 would be coded missing.

Whenever I include tenure in my model, the number of observations used in the model drops dramatically. I assume this is due to listwise deletion, as Stata removes observations for which no tenure data are available. In the example above, this would mean observations of years 2000-2009 would be ignored.

Should I therefore code the years 2000-2009 as 0 instead of missing? In that case, Stata would take it into account in the regression. However, what would that mean for coefficients, standard errors etc, e.g., the regression results? Would they be biased or be completely wrong?


1 Answer 1


Use of Stata is immaterial here, as the answer would be the same regardless of which software you are using.

Replacing missings by zeros would be arbitrary and unjustified in this case as at best you know that tenure should be some positive number so long as people were employed in those years. (You don't make clear what would be done if the individuals for which you don't have tenure information were not in the labour market or just unemployed in those years.)

Be clear: Stata and indeed any other software has no way to distinguish those zeros and take account of the fact that zero is for you an agnostic private code for missing. The zeros will be taken quite literally in regression calculations and so (a) wrong (b) biased would be a fair short summary.

You could explore the magnitude of this problem by trying other replacement values and then seeing how dependent results were on your various fudge replacements. There are other imputations and interpolations you might try, but very simply there can't be an easy way, or any way, to convert unknown values into known without engaging strong extra assumptions.

  • $\begingroup$ Hello Nick, thanks for your quick reply. I indicated I was using Stata as it might have been helpful for others in providing example commands for instance. I can see replacing the missings by zeros would indeed cause the results to be wrong. Perhaps my question is even wrong due to how I've been struggling with this: perhaps "How to include job tenure in a regression?" would be the better question. I actually have data on previous job tenure so I actually don't even need missings or zeros. Would it be better to include tenure of all jobs in the regression, instead of only the last job? $\endgroup$
    – ARW
    Jun 16, 2015 at 14:51
  • 1
    $\begingroup$ Your last is surely to be decided based on your research aims. Moreover, I am not any kind of economist to advise. $\endgroup$
    – Nick Cox
    Jun 16, 2015 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.