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:
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
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
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)
I would like to limit the lower end of the predicted values to 0.
I have tried to add
Code:
predict(ystar(0,.))
“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
Comment