6
$\begingroup$

This relates to the use of a continuous variable as a predictor in a multiple regression.

If a continuous variable (e.g. age) was measured in a questionnaire but the datafile has placed 'cutoffs' on the variable (it has been censored at the lowest and highest ends) can it still be used as continuous variable?

For example, I have a data file of a large dataset and I think for ethical reasons the data collectors had to use "21 years or below" as the lowest measure of age and "60 years or above" as the higher measure. So someone who was 18 years of age isn't in the file as 18, they are in the file as "21 years or below". So my frequencies look like this:

"21 years or below" - n=102.

"22 years" - n=28.

"23 years" - n=16.

...

"58 years" - n=8.

"59 ears" - n=11.

"60 years or above" - n=62.

Can this variable really be considered a continuous variable anymore? Or do I have to create ordinal groups to account for the 'groupings' at the low and high end of data?

$\endgroup$
2
  • 4
    $\begingroup$ This is an example of a censored variable. As always, creating ordinal groups loses information. There are some specialized techniques for analyzing censored variables: search our site. $\endgroup$
    – whuber
    Commented Jul 28, 2016 at 13:41
  • 3
    $\begingroup$ Thanks for telling me the correct term - that's helped a lot with my searching. I don't fully understand some of the answers to this but I'll keep at it! $\endgroup$ Commented Jul 28, 2016 at 13:49

1 Answer 1

8
$\begingroup$

I think most articles on "censored variables" will be related to the response variable which is quite a different story.

Being a censored regressor is not automatically a problem. If you are not fully trusting this regressor or if the corresponding "residuals versus variable"-plot shows troubles in the two extreme values 21 and 60, then you can still decide to add dummy variables like

  1. year60: 1 if 60 or above, 0 otherwise
  2. year21: 1 if 21 or below, 0 otherwise

to the regression to allow the model to be flexible enough to represent the relationship.

Of course, because you don't have values outside the interval from 21 to 60, nothing can be made to recover the information loss. All you can do is trying to choose a flexibly enough regression equation.

Let me demonstrate the idea on a simple example with just this one covariable in R

# Step 1: Generate and visualize data
set.seed(29)

age <- 15:90
ageCensored <- pmin(60, pmax(21, age)) # censored at 21 an 60
outcome <- 20 + 0.5 * age + 0.03 * (age - 40)^2 + rnorm(length(age))*10

plot(outcome ~ ageCensored)

enter image description here

# Simple linear regression, ignoring for potential misfit at the endpoints
fit <- lm(outcome ~ ageCensored)
summary(fit)
abline(fit, col = "red") # to add the regression line to the scatter plot above

# Output
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) 17.30597    3.99649   4.330 4.61e-05 ***
ageCensored  0.60062    0.08176   7.346 2.21e-10 ***
[...]
Residual standard error: 10.39 on 74 degrees of freedom
Multiple R-squared:  0.4217,    Adjusted R-squared:  0.4139 
F-statistic: 53.97 on 1 and 74 DF,  p-value: 2.213e-10

# Residual versus fitted plot shows considerable misfit which is also directly visible from the scatter plot with the regression line
plot(fit, which = 1)

enter image description here

        # Now we can either improve the fit by using a squared age effect (by knowing how the data way generated) or using the dummy "trick" mentioned above. Let's try with the dummy trick.

fit2 <- lm(outcome ~ ageCensored + I(ageCensored == 21) + I(ageCensored == 60))
summary(fit2)
plot(fit2, which = 1)

# Results
                         Estimate Std. Error t value Pr(>|t|)    
(Intercept)               31.0754    10.4810   2.965   0.0041 ** 
ageCensored                0.3242     0.2498   1.298   0.1984    
I(ageCensored == 21)TRUE   4.3685     8.4830   0.515   0.6082    
I(ageCensored == 60)TRUE  43.7598     6.3583   6.882 1.82e-09 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 16.89 on 72 degrees of freedom
Multiple R-squared:  0.6965,    Adjusted R-squared:  0.6838 
F-statistic: 55.07 on 3 and 72 DF,  p-value: < 2.2e-16

# Residuals versus fitted plot looks better now (although heterogeneity can be spottet at the right endpoint, a problem which I do not account for simplicity)

enter image description here

# Plot of the regression function against age
plot(outcome ~ ageCensored, xlim = range(age), xlab = "age")
lines(age, predict(fit2, list(ageCensored)), col = "red")

enter image description here

Note that since in your data, you cannot distinguish a 60 year old person with a person older than 60 (i.e. you don't know what value is really censored), you cannot do much more here. If you had this information, you could slighly redefine the dummy variables to

  1. year>60: 1 if above 61, 0 otherwise
  2. year<21: 1 if below 21, 0 otherwise

to treat persons ages 60 or 21 separately from the censored ones.

$\endgroup$
4
  • $\begingroup$ Michael M thanks for all of that info - I'm learning an awful lot that was never touched on in my stats classes... I have actually found a study that uses the same dataset that I'm using and they created ordinal categories for these ages, so I'm guessing they had the same issue and since I can reference their method as having been used/published I'm gonna go with that. $\endgroup$ Commented Jul 29, 2016 at 12:36
  • 3
    $\begingroup$ I, too, initially thought that including appropriate dummy variables would solve this problem. After some reflection I no longer believe that's correct. The reason is that the response observed for an interval of ages, such as under 21 or over 60, will have a greater variability--perhaps much greater--than the response at an individual age. The severity of the heteroscedasticity depends on the strength of the relationship between age and response. It might even be better to run three separate regressions: one for under-21, one for over-60, and one for all the other ages. $\endgroup$
    – whuber
    Commented Aug 1, 2016 at 16:51
  • 1
    $\begingroup$ @whuber: not only the extra variability can be an issue, also the potential omitted variable bias in the estimates of the other effects (coming from the censored observations). The extra variability can probably be handled by white correction or weighted least-squares though. The best strategy will depend on the exact aim of the analysis. If the focus is on prediction or effect estimation, unequal variance is hardly ever the biggest problem. $\endgroup$
    – Michael M
    Commented Aug 1, 2016 at 17:15
  • 1
    $\begingroup$ The censoring will cause overestimation of the error variance, which will make any tests less powerful. I don't understand the point about omitted variable bias: provided the results are correctly interpreted, no variables are omitted. $\endgroup$
    – whuber
    Commented Aug 1, 2016 at 18:05

Your Answer

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

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