0
$\begingroup$

I'm trying to estimate days spent in hospital (length of stay, continuous variable) based on a clinical severity score (categorical, integer: 1, 2 or 3). The numbers reflect level of severity, so 1 is mild, 3 is severe.

I'm also interested to know if age (integer, continuous variable) confounds this as well.

In R, my code is as follows, but I'm unsure if I'm treating the categorical variable for severity score correctly.

df$scoreFac <- factor(df$score)
lm.model <- lm(lengthOfStay ~ scoreFac, data = df)

summary(lm.model)

The result coefficient is:

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept)   1.1705     0.1680   6.757  2.02e-10 ***
scoreFac2     0.4313     0.1768   2.429  0.02623 *  
scoreFac3     0.5340     0.1769   2.912  0.00383 ** 

If I want to add age onto this:

lm.modelB <- lm(lengthOfStay ~ scoreFac + age, data = df)
summary(lm.modelB)

Resulting in coefficient output:

Coefficients:
            Estimate Std. Error t value Pr(>|t|)    
(Intercept) 0.753531   0.210627   3.631  0.00035 ***
scoreFac2   0.363182   0.175734   1.938  0.05595 .  
scoreFac3   0.434588   0.175463   2.485  0.01665 *  
age         0.008762   0.002147   3.158  0.00173 ** 

Should I be representing score differently (such as using score not scoreFac)? I'm not sure if I'm able to correctly interpret the esimtate when there's the dummy variables for score.

$\endgroup$

1 Answer 1

2
$\begingroup$

If you use score (the original variable) then you are assuming that severity is actually continuous. This may be a fine assumption. I know it's numbered 1, 2, 3, but surely those are just convenient measures. It could be between mild and moderate, or moderate and severe, or even vary within severe.

The problem would be that you are also assuming that it is interval level: That the differences between mild and moderate and between moderate and severe are the same. Even that may not be unreasonable, and you could do sensitivity analysis, using different numbers instead of 1, 2, and 3 and see what happens.

If you are not willing to make those assumptions, you can use ScoreFac, then each parameter estimate is comparing to the lowest level (by default).

Yet another possibility is to use a method like optimal scoring.

Finally, lm may not be right. LOS variables are typically very skewed, and, while lm does not make assumptions about the variable (only the residual), it may be better to use a robust method. And, if you have any censored observations (people still in the hospital when the study was done) you will need to use a survival method such as Cox.

$\endgroup$
4
  • $\begingroup$ Thank you. LOS is actually log(LOS) in this case. If I use scoreFac, am I right in thinking that lm(LOS ~ scoreFac + age) changes the estimate by 0.008762 (P=0.001), and thus it isn't a significant confounder (due to low change in estimate)? $\endgroup$
    – Edge
    Commented Aug 24, 2023 at 13:46
  • $\begingroup$ Where are you getting 0.0087? It changes the intercept, and it changes scorefac2 from 0.43 to to 0.36 and scorefac3 from 0.53 to 0.43. Are those changes big? They seem pretty big to me, but it's a substantive question. You may also want to account for age because it's an important covariate. (I would think age is important in most studies related to health). $\endgroup$
    – Peter Flom
    Commented Aug 24, 2023 at 13:58
  • $\begingroup$ I was getting the 0.008762 from the estimate of age, wasn't sure what it specifically represented. $\endgroup$
    – Edge
    Commented Aug 24, 2023 at 21:13
  • 1
    $\begingroup$ It says that for each unit increase in age (probably years) there is a 0.00876 increase in LOS (presumably in days). So, assuming it is years and days, that's probably not important, even though it's significant. But it does change the other parameter estiamtes, which is what "confound" means. $\endgroup$
    – Peter Flom
    Commented Aug 24, 2023 at 21:38

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.