2
$\begingroup$

I have this OvF plot with the outcome being a ln-transformed continuous variable (length of stay in days).

This plot is the result of a survey-adjusted weighted mixed-level (1 level random intercept), linear regression done in stata 14.

I don't know how to interpret this plot. There seems to be a weird horizontal pattern accross the o=f line that i cannot understand. Please advise.

Also if you know another method of assessing the model fit for generalized linear regression (continuous outcomes), please let me know (stata commands --> extra kudos!)

Observed-vs-fitted plot

$\endgroup$
  • 2
    $\begingroup$ Your observed values are presumably integer days, which lead to those unequally spaced values when you take their natural logarithms, but cannot fill the gaps $\endgroup$ – Henry Oct 11 '16 at 20:43
  • $\begingroup$ how can we fix that? $\endgroup$ – Paris Char Oct 11 '16 at 20:56
  • 2
    $\begingroup$ As Henry says, this is what you would expect when the dependent variable is discrete - you don't need to fix it. There are several answers concerning diagnostic for log-linear/Poisson models. For example, have a look at this, this, or this. $\endgroup$ – matteo Oct 11 '16 at 20:56
  • $\begingroup$ @MatteoLisi i appreciate your answer but none of the 3 sources can help me out. number of days should treated as continuous discete variable, not as ordinal categorical. Do you suggest i ran Poisson regression instead? Im not sure how these sources help me out here - do i need a different kind of plot? The above sources point to residuals vs fitted instead. $\endgroup$ – Paris Char Oct 11 '16 at 21:29
  • 2
    $\begingroup$ "Continuous discrete variable" is a contradiction in terms: by definition, "discrete" is as far from "continuous" as one can get. $\endgroup$ – whuber Oct 12 '16 at 19:40
3
$\begingroup$

Your variable is measured in days, so the lowest value is $1$ day or $\ ln 1=0$, the second lowest value is $2$ days or $\ln 2\approx0.69$, the third is $3$ days or $\ln 3\approx1.10$, etc. That is what you see in the graph; the bottom three horizontal lines of points happen at about the values $0$, $0.69$, and $1.10$. So the graph accurately represents what is happening in your data.

You mentioned you wanted to treat length of stay as continuous. However, what would that mean in terms of your length of stay variable? In principle we could have measured length of stay in hours. This would not solve the problem completely, as the variable will still be granular to some extent, but the graph would look much prettier. More importantly, does that extra detail contain information you care about? Probably not, as the hour of the day that you leave a hospital is largely determined by organizational concerns, e.g. when is the doctor who does the final check-up available? So a finer measure of length of stay would probably only add random noise to your variable.

Having said all that, I probably would not use a linear model for such duration data. There is a whole set of statistical models that are explicitly designed for such data, typically referred to as survival analysis. See here, here, here, or here.

$\endgroup$
  • $\begingroup$ I appreciate your answer and I am aware of survival analysis but in this case I think Poisson Regression or Negative Binomial (doesn't work well with survey -specification due to many clusters being used) would be a better idea. $\endgroup$ – Paris Char Oct 12 '16 at 17:21
  • $\begingroup$ That sounds wrong to me, but it is your research, so also your decision. $\endgroup$ – Maarten Buis Oct 12 '16 at 17:33
  • $\begingroup$ I wouldn't use a negative binomial model in this case, but in Stata you can use the svy prefix before nbreg, so there shouldn't be big problem with including design information in an nbreg model. $\endgroup$ – Maarten Buis Oct 12 '16 at 17:38
  • $\begingroup$ What about Poisson regression? Also GLM with ln(LOS) as outcome has been studied with good fit (link) $\endgroup$ – Paris Char Oct 12 '16 at 19:33
  • $\begingroup$ GLMs with a log link function (Poisson regression is a special case) are not designed for that purpose, while survival analysis is. $\endgroup$ – Maarten Buis Oct 12 '16 at 20:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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