# Non-existent variables: 0 or NA?

Let's say I have a data set where there are some people sitting and some people standing. One of the variables in my data set is the amount of weight a person is holding on their lap. However, a person who is standing does not have a lap, so the question is meaningless for them. (I apologize that this is the best example I can come up with...)

I create a regression model where weight held by lap is one of the predictors. Should I omit all rows of standing people (NA), or consider the weight held in their laps to be 0? What are the pros and cons of each approach?

A further complication could be that a person was in fact sitting with some weight in their lap, but I incorrectly thought they were standing. Also, some people are sitting, but have nothing on their lap.

• – Tim Mar 28 '17 at 9:06

The main question is interesting because it could be one of rare cases where you may skip the main effect and keep the interaction term. Consider this model: $$y_i=\beta_0+\beta_s s_i +\beta_{sw} s_i w_i+\varepsilon_i,$$ where $s_i$ - dummy with 0/1 for sitting/standing and $w_i$ - weight on the lap.

The weight variable will be included in the model only when the subject is standing. When a subject is sitting the weight variable is toggled off, you can set it at any value, e.g. 0.

A further complication could be that a person was in fact sitting with some weight in their lap, but I incorrectly thought they were standing.

This question is even more subtle. The OLS routinely assumes that the design matrix is fixed, i.e. in the above model both $s_i,w_i$ are known exactly. When you relax this assumption and work with random design matrix, i.e. allow for $s_i$ to have an error, the source of uncertainty is not only the usual error term $\varepsilon_i$, but also the variables themselves, so things get a bit complicated. You can start with ignoring this complication, and assume that your $s_i$ variable is fixed.

There is a vast literature on missing data and model specification, and in such cases you have a number of options. Perhaps the safest approach would be to consider standing and sitting participants as separate populations. You could construct a model of the form: $$Y_i=\beta_0+\beta_1Standing+\beta_2\mathbf{X}_i+\epsilon_i$$

where $Y_i$ is your dependent variable, $Standing$ is a dummy variable for standing or sitting,$\mathbf{X_i}$ is a vector of independent variables and $\epsilon_i$ is your error term. This would hopefully capture the effect of sitting/standing upon your dependent variable.

For your sitting participants, you can consider a subset of participants who are sitting, and fit a model: $$Y_i=\beta_0+\beta_1weight+\beta_2\mathbf{X}_i+\epsilon_i$$

where $weight$ is the weight held in lap for each sitting participant.

You would have to be careful in generalising the effect of $weight$ beyond the sitting participants, as this would imply that were the standing individuals seated, the same relationships would hold. There may be some features of the standing population that make this difficult. For example if a greater proportion of elderly participants are seated rather than using random allocation of $standing$ status through some random sampling technique. This would be a confounding problem, as the effects would be biased due to features unique to idiosyncracies of the subpopulation. $weight$ may have greater effect for the elderly than for younger participants with respect to your $Y_i$

One thing you should NOT do is assign the standing participants a value of 0 and consider the entire population within a single model. In this case, it is impossible to differentiate between standing participants, and sitting participants who have a value of 0.

To use a probability example (which extends to the regression case), consider the case in which we are interested in the probability of an outcome of heads. If we were to toss a fair coin, we know that the probability of either an outcome of heads or tails is 0.5. Now assume that the want to know the probability of two consecutive heads outcomes. Assuming each coin toss is independent, we would calculate the probability of two outcomes of heads from two tosses as: $$Prob[H]0.5 * Prob[H]0.5 = Prob[H|H]=0.25$$

Now, we know that the probability of a two heads outcomes for a participant with an initial outcome of tails is 0, but assume that we include participants with an initial tails outcome in our estimation of $Prob[H|H]$. If we put both groups in the same model, we would not be able to differentiate between the two groups, and the expected value of two head outcomes occurrences would be biased towards 0. We have made an error if we ignore the difference between the two populations, which is essentially what we are doing by assigning a value of zero to standing participants.

So in a pros cons sense: The pro in modelling subpopulations separately is that you are less likely to run into this problem. The con is that you sample size will go down, and therefore your power to detect causal effects.

A further complication could be that a person was in fact sitting with some weight in their lap, but I incorrectly thought they were standing.

This is a measurement error problem. In short, if your mistakes are random, then you may essentially be able to get away with it if over the whole sample your measurements have a similar average to the true population average (A contentious claim). If your mistakes are systematic i.e. participants with certain characteristics have errors in variable measurement, then you will have bias in your estimates, as you are effectively miss-characterising that subpopulation of individuals (somewhat similar to the above case).

That was a long winded answer, and there are many approaches to these sorts of problems. I would recommend the following sources if you want to find out more, as what I have mentioned is by no means a comprehensive treatment of the problems of missing data and measurement error.

Bibliography:

Bland, J. Martin, and Douglas G. Altman. "Statistics notes: measurement error." Bmj 313.7059 (1996): 744.

Little, R.J.A, and Rubin, D.B, "Statistical Analysis with Missing Data", 2nd Edition

Wooldridge, J. M. 2006. Introductory econometrics: a modern approach. Mason, OH, Thomson/South-Western.

There is also a good existing answer on this site answer focusing on different approaches to missing data here. Definitely worth a read :)

• Please feel free to edit as appropriate :) – Wes Mar 27 '17 at 17:23
• Trouble with $Y_i=\beta_0+\beta_1 \mathrm{Standing}+\beta_2\mathbf{X}_i+\epsilon_i$ is that if weight does affect the response, it'll be more variable for seated people. "Modelling as separate populations" could suggest $Y_i=\beta_0+\beta_2\mathbf{X}_i+\epsilon_i$ for standing people only. – Scortchi Mar 28 '17 at 8:47
• True. One would assume in using the $Standing$ dummy variable, that being seated included variables such as weight, and we would be likely to have some degree of endogeneity bias in our estimates. You could either try to capture the difference between standing and sitting in this way, or fit separate $Y_i=\beta_0+\beta_2\mathbf{X_i}+\epsilon_i$ for each subset. The possibilities are endless :) – Wes Mar 28 '17 at 9:06