Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Deriving change over time by change in groups of variables

    I'm running a regression to try to explain how long people spend in a hospital's A&E (ER) department. The data contains the data on several million individual patients who were in hospital over two years. The basic structure is as follows:

    Code:
     reg MinsinAE i.sex#i.agegroup i.diagnosis i.had_CT i.hadMRI i.hadCT i.hadbloods hospitalbedcapacity
    Over the two year period the average time in A&E has increased so we want to see how each of the variables might explain that. To do this I need to combine the coefficients from the regression with the change in the mean of the variables to see how much of the change in the predicted time in A&E could be attributed to each variable.

    I've tried using margins but I'm not sure if the results I obtain are telling me what I think. Can anyone help please?

    My margins command is:

    Code:
    margins  , over(years) at((means) _all)
    I also wondered if it were possible to get the overall marginal effect of groups of variables (I have several hundred in my model). For example, the impact of all the diagnostic tests.

    Many thanks
    Rob

  • #2
    I'm no expert here, but I have a couple of thoughts regarding just the effect of a change in the mean. I wonder whether examining a change in the *mean* of some X is what you want. Wouldn't you want to examine the effect of the observed change in the *distribution* of some X? Perhaps that would give the same result as a change of mean in a linear model, but I'm not sure. A couple of simulation approaches occur to me: 1) Examine what happens to predicted values when year 1 and year 2 values are randomly exchanged among patient-visits; 2) Or, perhaps more realistically: What happens if values of some X are randomly exchanged among otherwise similar patient-visits?

    Do take my thoughts here with a grain of salt ...

    Comment


    • #3
      A and E is a British term, although I guess nothing rules out its use in other English-speaking countries.

      My own recent experiences in an A and E Department underlined that time spent is a highly skewed response. Long story short, but I would expect the arguments at https://blog.stata.com/2011/08/22/us...tell-a-friend/ to apply and to imply that vanilla regression is not the tool of choice.

      Comment


      • #4
        Thanks both for your comments. I think I was too simplistic in my original post about the regression. I am trying various options include log-transform and logit for time over a certain length. I will try poison too (thanks for the link).

        But I still have the problem with these of trying to explain how much of the change in the fitted value between year one and two is driven by each variable. One option would be to collapse my data to means by year and calculate manually but I wanted to avoid that, and I also have a lot of factor variable.

        Rob

        Comment

        Working...
        X