Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: Marginsplot after Poisson regression and negative predicted values
From
Maarten Buis <[email protected]>
To
[email protected]
Subject
Re: st: Marginsplot after Poisson regression and negative predicted values
Date
Wed, 8 Jan 2014 15:33:42 +0100
The fact that you did not use -poisson- but -xtpoisson- is crucial
here. -margins- looks at the default prediction to determine what it
is going to predict, unless you specify the -predict()- option in
-margins-. If you look at -help xtlogit_postestimation- you can see
that the default prediction is the linear predictor not the expected
count. So the solution to your problem is to look at that help file,
select the prediction you want, look at the help file of margins on
how to use the -predict()- option, and apply all that.
-- Maarten
On Wed, Jan 8, 2014 at 3:19 PM, James Bernard <[email protected]> wrote:
> The model is like this
>
> -xtpoisson y x1 x2 x3
>
> y is the count variable
>
> -margins, at(x1=(0(1)20))
>
> -marginsplot, noci
>
> On Wed, Jan 8, 2014 at 10:11 PM, Maarten Buis <[email protected]> wrote:
>> What are the exact commands you used? The defaults should not result
>> in negative predicted counts.
>>
>> -- Maarten
>>
>> On Wed, Jan 8, 2014 at 2:52 PM, James Bernard <[email protected]> wrote:
>>> Forgot to add that I am not interested in confidence interval. My
>>> dependent variable has maximum of 300. However, the maximum of y axis
>>> on the predicted plot is 1
>>>
>>> On Wed, Jan 8, 2014 at 9:47 PM, James Bernard <[email protected]> wrote:
>>>> No, I mean that the Y variable that is a count variable on the y axis
>>>> is negative, while my dependent variable is count variable
>>>>
>>>> On Wed, Jan 8, 2014 at 5:37 PM, Maarten Buis <[email protected]> wrote:
>>>>> I suspect that you mean the confidence interval around the predicted
>>>>> values. It is a known issue with the delta method that is used by
>>>>> -margins- for computing the confidence interval. Generally I would not
>>>>> worry too much about it, as these bounds are failry approximate
>>>>> anyhow, but if you do you can predict the linear predictor with its
>>>>> confidence intervals and transform those to the expected count metric
>>>>> as in <http://www.stata.com/support/faqs/statistics/delta-rule/index.html>.
>>>>>
>>>>> Hope this helps,
>>>>> Maarten
>>>>>
>>>>>
>>>>> On Wed, Jan 8, 2014 at 9:51 AM, James Bernard <[email protected]> wrote:
>>>>>> Hi all,
>>>>>>
>>>>>> I have ran a Poisson model. Then tried to run -margins and
>>>>>> -marginsplot for one of the variables.
>>>>>>
>>>>>> The shape of the graph makes sense. But, the range of predicted values
>>>>>> of the dependent variable (which is a count variable, obviously)
>>>>>> ranges from 1 at its maximum and -6 at its minimum. Is this usual? Am
>>>>>> I doing something wrong?
>>>>>>
>>>>>> Thanks,
>>>>>> James
>>>>>> *
>>>>>> * For searches and help try:
>>>>>> * http://www.stata.com/help.cgi?search
>>>>>> * http://www.stata.com/support/faqs/resources/statalist-faq/
>>>>>> * http://www.ats.ucla.edu/stat/stata/
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> ---------------------------------
>>>>> Maarten L. Buis
>>>>> WZB
>>>>> Reichpietschufer 50
>>>>> 10785 Berlin
>>>>> Germany
>>>>>
>>>>> http://www.maartenbuis.nl
>>>>> ---------------------------------
>>>>> *
>>>>> * For searches and help try:
>>>>> * http://www.stata.com/help.cgi?search
>>>>> * http://www.stata.com/support/faqs/resources/statalist-faq/
>>>>> * http://www.ats.ucla.edu/stat/stata/
>>> *
>>> * For searches and help try:
>>> * http://www.stata.com/help.cgi?search
>>> * http://www.stata.com/support/faqs/resources/statalist-faq/
>>> * http://www.ats.ucla.edu/stat/stata/
>>
>>
>>
>> --
>> ---------------------------------
>> Maarten L. Buis
>> WZB
>> Reichpietschufer 50
>> 10785 Berlin
>> Germany
>>
>> http://www.maartenbuis.nl
>> ---------------------------------
>> *
>> * For searches and help try:
>> * http://www.stata.com/help.cgi?search
>> * http://www.stata.com/support/faqs/resources/statalist-faq/
>> * http://www.ats.ucla.edu/stat/stata/
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/faqs/resources/statalist-faq/
> * http://www.ats.ucla.edu/stat/stata/
--
---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany
http://www.maartenbuis.nl
---------------------------------
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/