Announcement

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

  • Covid19 ICUs prediction

    Dear all
    I am trying to help a local hospital in Italy in predicting the number of intensive care units (ICUs) which will be required in the next few days. I know the number of admitted patients but also the number of positives (including those not admitted at hospital but quarantined at home). I first tried a linear regression of ICUs as a function of admitted patients (nr of observation n=28) (p<0.0001 and R-square=0.997) then a quadratic polynomial regression of ICUs as a function of total positives (again p<0.0001 and R-square=0.998). Similarly, I did a regression of ICUs vs day_number (1...28). Now I assume I can try to predict ICUs. I did it for the sample (n=1...28), but I do not know how to do it for the next few days (29, 30...) and for more admitted patients. Any suggestions? I attach here my data. Thanks
    Attached Files

  • #2
    From what I understand, I should perform a dynamic out-of-sample prediction…

    Comment


    • #3
      So what you need is a prediction of the number of COVID cases. Doing this right is hard, it is a discipline in its own right for a reason. I would be very relunctant to do this, as I know I am an amateur in this field and quite literally lives are at stake. This is something you should discuss with an epidemiologist (though they tend to be a bit busy right now).
      ---------------------------------
      Maarten L. Buis
      University of Konstanz
      Department of history and sociology
      box 40
      78457 Konstanz
      Germany
      http://www.maartenbuis.nl
      ---------------------------------

      Comment


      • #4
        Normally I don't touch attached files, but the current circumstances warrant it. Here's a cleaned up -dataex- presentation of the example data:
        Code:
        * Example generated by -dataex-. To install: ssc install dataex
        clear
        input int(ICUs admitted positives nuovi_attualmente_positivi) str9 date byte day float(positives2 ICU_Pred) byte day2
         26  127  221 221 "24feb2020" 1   48841 51.07011  1
         35  150  311  90 "25feb2020" 2   96721 59.58235  4
         36  164  385  74 "26feb2020" 3  148225 66.57358  9
         56  304  588 203 "27feb2020" 4  345744 85.71637 16
         64  409  821 233 "28feb2020" 5  674041 107.6234 25
        105  506 1049 228 "29feb2020" 6 1100401 128.9934 36
        140  779 1577 528 "01mar2020" 7 2486929 178.2274 49
        166  908 1835 258 "02mar2020" 8 3367225 202.1557 64
        229 1263 2263 428 "03mar2020" 9 5121169 241.6637 81
        end
        What you want can be done with the -margins- command, I think. If you would post your exact regression code, some more regular user of -margins- than me could supply you with code easily. Also, with an important situation and a small N relative to number of predictors, I'd encourage you to try some other models (perhaps Poisson regression??) and see if the predictions are similar. I quite support Maarten's comments re the need for an expert here, too.

        Comment


        • #5
          It's great that you can help out, Davide! (I want to acknowledge that, even though I agree with Maarten's and Mike's advice about consulting experts).

          FYI1 there's been discussion of various models on the Gelman blog: https://statmodeling.stat.columbia.edu/. FYI2 The Imperial College London report that changed British policy-makers' minds in recent days is downoadable from https://www.imperial.ac.uk/mrc-globa...n-coronavirus/. Look at report 9. [Apologies if these links are common knowledge.]

          Comment


          • #6
            Originally posted by Maarten Buis View Post
            So what you need is a prediction of the number of COVID cases. Doing this right is hard, it is a discipline in its own right for a reason. I would be very relunctant to do this, as I know I am an amateur in this field and quite literally lives are at stake. This is something you should discuss with an epidemiologist (though they tend to be a bit busy right now).
            I have a PhD in biomedical sciences and work with intensive care. I do not want to predict the number of positives. As I wrote, I want to estimate the nr of required intensive care units on the basis of both admitted (which we know precisely) and time.

            Comment


            • #7
              Originally posted by Mike Lacy View Post
              Normally I don't touch attached files, but the current circumstances warrant it. Here's a cleaned up -dataex- presentation of the example data:
              Code:
              * Example generated by -dataex-. To install: ssc install dataex
              clear
              input int(ICUs admitted positives nuovi_attualmente_positivi) str9 date byte day float(positives2 ICU_Pred) byte day2
              26 127 221 221 "24feb2020" 1 48841 51.07011 1
              35 150 311 90 "25feb2020" 2 96721 59.58235 4
              36 164 385 74 "26feb2020" 3 148225 66.57358 9
              56 304 588 203 "27feb2020" 4 345744 85.71637 16
              64 409 821 233 "28feb2020" 5 674041 107.6234 25
              105 506 1049 228 "29feb2020" 6 1100401 128.9934 36
              140 779 1577 528 "01mar2020" 7 2486929 178.2274 49
              166 908 1835 258 "02mar2020" 8 3367225 202.1557 64
              229 1263 2263 428 "03mar2020" 9 5121169 241.6637 81
              end
              What you want can be done with the -margins- command, I think. If you would post your exact regression code, some more regular user of -margins- than me could supply you with code easily. Also, with an important situation and a small N relative to number of predictors, I'd encourage you to try some other models (perhaps Poisson regression??) and see if the predictions are similar. I quite support Maarten's comments re the need for an expert here, too.
              Thanks Mike. I tried to format with datex, but for some reason it was not possible to install it (error was something like could not reach the website). Here is my code:

              Code:
              gen day= _n
              gen day2=day^2
              regress ICUs day day2
              
              predict ICUs_pred1
              and

              Code:
              gen admitted2=admitted^2
              regress ICUs admitted admitted2
              predict ICUs_pred2
              I both cases I would like to predict out of sample the next few values for ICUs.

              Comment


              • #8
                Davide: Suppose, for sake of argument, your model is a linear regression: #ICUs = a + b*#admitted + c*time + error ,and that for this regression you have observations for time = 1,...,T.

                To get out-of-sample predictions for the period T+1 to T+s, the usual procedure would, I think, be to:
                (a) increase the number of observations in the memory data set: set obs T+s
                (b) fill in the values of the "time" and "#admitted" variables in the additional observations. (Some sort of assumptions would be needed about how #admitted change over time in the post-estimation period.)
                (c) use -predict- to get the predicted number of #ICUs. For example, with the estimates of the linear model above still in memory, -predict ICUs_hat- will give you the linear prediction.

                If you use a different model than linear/OLS, I suspect that the same 3 steps could be used.

                In terms of what model to use, I know nothing about this. From your small dataset, though, I observe, that #ICUs is a near-linear function of #admitted, and also of #positives. (I used -tw connect-). I guess that as time proceeds the 'exponential' nature of things may kick in.

                Good luck!

                Comment


                • #9
                  Stephen's suggestion relies on predictions of the number of admitted people that are subsequently used to predict ICUs.

                  In the absence of a more sophisticated model, you could try to jointly predict the number of admitted people and ICUs following a var estimation. The forecast command suite might be of help.
                  https://twitter.com/Kripfganz

                  Comment

                  Working...
                  X