Announcement

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

  • Mimgrns command/Limiting predicted values to 0?

    Dear all,

    I am using the user-written command mimgrns (mi command for margins, reference at the bottom) after mi estimate: regress (mi command for regress) to obtain predicted values (marginal means) in my response variable for each level of my categorical variable. I am then plotting the values using marginsplot.

    Code applied in Stata/SE 14.0:
    Code:
    mi estimate: regress pctnbseryth c.year##i.iaprecent
    Code:
    qui mimrgns ,  at(iaprecent  =(0 1 2) year=(1995 (5) 2010 2014))  cmdmargins
    Code:
    marginsplot, noci x(year) recast(line)
    The problem I am facing is that I end up with negative predicted values. I believe this is technically or statistically fine, however, this makes interpretation difficult as it is not possible for the subject area (negative % of cases).
    I would like to limit the lower end of the predicted values to 0.

    I have tried to add
    Code:
    predict(ystar(0,.))
    following the mimgrns command, however, I get the following error:
    “prediction is a function of possibly stochastic quantities other than e(b)
    an error occurred when mi estimate executed mimrgns_estimate on m=1”

    Is this a bug in the command? Is there a way around this in order to limit the predicted values to 0?

    This is the first time I am posting on Statalist so I apologise if I have left out any necessary information. Please let me know and I will provide further details.

    Any advice will be most appreciated.

    Many thanks,
    Farah

    Mimgrns: http://www.haghish.com/statistics/st...d/mimrgns.html

  • #2
    No, it's not a bug. It's the reality of linear probability models that they can, and often do, predict values outside the [0,1] interval. The -predict(ystar())- option is specifically not allowed with -margins- after regress because it cannot be calculated from e(b) alone.

    If you don't want to have to deal with predicted values outside the [0, 1] interval, you have to use a non-linear model such as -logit- or -probit- instead of -regress-.

    Comment


    • #3
      To add to Clyde's comment, if the LPM gives you implausible predicted values for a plausible range of your predictors, then it might not be the most appropriate choice, scientifically speaking.

      Best
      Daniel

      Comment


      • #4
        I have posted a general advice on problems with the mimrgns command.

        Best
        Daniel

        Comment


        • #5
          Dear Clyde and Daniel,

          Thanks very much for your advice.
          I will look into using the -tobit- model instead as I have values above 1.

          Best wishes,
          Farah

          Comment

          Working...
          X