You are not logged in. You can browse but not post. Login or Register by clicking 'Login or Register' at the top-right of this page. For more information on Statalist, see the FAQ.
I have been doing projections since April with SIR and other models (sites.google.com/site/shafiunihe). You can use NL logistic of Stata to estimate the parameters of logistic functions to make projections.
Step 1: load data and declare the date variables ( if date is not detected by stata you can follow this: gen date=date(datevariable name in your dataset, "MDY") and then run format date %td)
Step2: Run nl log4 (i.e. 4 parameter logistics), command: nl log4: total_cases date, you will get estimated parameters (lowest one is the lowest value of cases, highest one is the highest value, there is a value in between which is an inflection point. and you will see a growth coefficient (which is less than one usually) and this growth coefficient is equivalent to beta-gamma (I am still looking to estimate beta and gamma separately from this)
Step 3: set observation n+i (n is your current obs number and i is the days for which you want to do projection), then gen day=n+i
Step 4: predict total_cases_predicted
Step 5: tsset day
Step 6: tsline total_cases total_cases_predicted (for graph)
From my experience, if any country is in the early stages of the epidemics then expontential/gomperzt does better job which can be easily done with stata nl command, logistic may give a false notion of early ending of epidemics
This package (epimodels) will also be helpful if you want to do simulation, instead of estimating parameters.
I'll be trying to write Stata program to do all these things. If I finally do, I'll definitely share.
I have been doing projections since April with SIR and other models (sites.google.com/site/shafiunihe). You can use NL logistic of Stata to estimate the parameters of logistic functions to make projections.
Step 1: load data and declare the date variables ( if date is not detected by stata you can follow this: gen date=date(datevariable name in your dataset, "MDY") and then run format date %td)
Step2: Run nl log4 (i.e. 4 parameter logistics), command: nl log4: total_cases date, you will get estimated parameters (lowest one is the lowest value of cases, highest one is the highest value, there is a value in between which is an inflection point. and you will see a growth coefficient (which is less than one usually) and this growth coefficient is equivalent to beta-gamma (I am still looking to estimate beta and gamma separately from this)
Step 3: set observation n+i (n is your current obs number and i is the days for which you want to do projection), then gen day=n+i
Step 4: predict total_cases_predicted
Step 5: tsset day
Step 6: tsline total_cases total_cases_predicted (for graph)
From my experience, if any country is in the early stages of the epidemics then expontential/gomperzt does better job which can be easily done with stata nl command, logistic may give a false notion of early ending of epidemics
This package (epimodels) will also be helpful if you want to do simulation, instead of estimating parameters.
I'll be trying to write Stata program to do all these things. If I finally do, I'll definitely share.
I have been doing projections since April with SIR and other models (sites.google.com/site/shafiunihe). You can use NL logistic of Stata to estimate the parameters of logistic functions to make projections.
Step 1: load data and declare the date variables ( if date is not detected by stata you can follow this: gen date=date(datevariable name in your dataset, "MDY") and then run format date %td)
Step2: Run nl log4 (i.e. 4 parameter logistics), command: nl log4: total_cases date, you will get estimated parameters (lowest one is the lowest value of cases, highest one is the highest value, there is a value in between which is an inflection point. and you will see a growth coefficient (which is less than one usually) and this growth coefficient is equivalent to beta-gamma (I am still looking to estimate beta and gamma separately from this)
Step 3: set observation n+i (n is your current obs number and i is the days for which you want to do projection), then gen day=n+i
Step 4: predict total_cases_predicted
Step 5: tsset day
Step 6: tsline total_cases total_cases_predicted (for graph)
From my experience, if any country is in the early stages of the epidemics then expontential/gomperzt does the better job which can be easily done with stata nl command, logistic may give a false notion of the early ending of epidemics
This package (epimodels) will also be helpful if you want to do simulation, instead of estimating parameters.
I'll be trying to write Stata program to do all these things. If I finally do, I'll definitely share.
The version released through SSC doesn't do the fitting yet, but I have a version that is doing this already.
If Alberto Osella wants to have an early look, please PM me.
@Sergiy Radyakin: Wow! Great. Congratulations. I would love to have it. Would you please share it with me? my email: shafiun.ihe@gmail.com; sshimul@worldbank.org
Hi everyone,
I am trying to simulate the potential number of COVID-19 infections in a given country in absence of restrictive measures. I have data about the cumulative number of positive cases.
I was trying to fit a Gompertz distribution (as mentioned by @Shafiun Shimul) in the first weeks and then use it to predict the values in the subsequent days.
However, I notice that moving the threshold a little makes results change dramatically. Is there a method to test which is the exact threshold date which should be set? Or maybe is this method not so reliable?
Thanks a lot in advance!
Comment