Announcement

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

  • How to estimate prevalences of an indicator over the years?

    Dear Statalist,

    My dataset presents the prevalence of a given indicator over 11 years (2007 to 2017). I would like to make a prevalence projection of this indicator for 2020, 2025 and 2030. What´s the appropriate command to do so?

    I tried to use 'margins, at (ano==2020)' after the regression command, but the estimate seems unlikely.

    I´d appreciate if you could help me.

    Thanks a lot.

    Fernanda

  • #2
    Well, as I'm sure you know, extrapolating beyond the range of the existing data is always just a guess--the software community has not developed a crystal ball app.

    That said, people do forecasting. The implausibility of your result using -margins, at(ano = 2020)- is ultimately not a problem with the use of margins. I am highly confident that -margins- has given you a correctly calculated estimate of what your underlying regression model predicts for year 2020. If that result is implausible, it means that the underlying regression model you ran before -margins- is implausible. As you said nothing about that model, it isn't possible to advise how you might modify or replace it.

    Added: It dawns on me that there could be a problem in the way you used -margins-. In most situations, the default output of -margins- is in the same metric as the outcome variable of the regression itself. But, particularly in earlier versions of Stata, there are some exceptions. So, for example, if your outcome variable is a count, it may be that the default output of -margins- for that particular model is -xb- rather than the count itself. So you should check the help file for your regression models postestimation commands, and select -margins- to see if the -margins- output is in the metric you expect. If it isn't, you may be able to re-run margins and use the -predict()- or -expression()- options to get the predicted outcome.
    Last edited by Clyde Schechter; 11 Mar 2019, 16:18.

    Comment


    • #3
      Dear Mr. Schechter,

      Thank you for your feedback on my question. It helped to clarify the correct way to execut the command.

      Indeed, it´d be of great joy if there were an crystal ball app and it certainly would help me a lot, but for now, it´s a shame I can only count with projections.

      Joking apart, I ran a linear regression model in which my outcome and predictor variables were both a count. There´s a downward trend of the outcome over the years but, according to margins, the projections would present an upward trend in the future. From that moment, it has occured me that, perhaps, the margins command could not be appropriate in that case. Once more, thank you for you help. I´ll check the regression models postestimation commands you mentionned.

      Best regards,

      Fernanda

      Comment

      Working...
      X