[R] zero truncated poisson regression

Achim Zeileis Achim.Zeileis at uibk.ac.at
Tue Aug 2 01:14:35 CEST 2011


On Mon, 1 Aug 2011, Iasonas Lamprianou wrote:

> Thank you, it works! And the estimates (as well as the standard errors) 
> seem to be more reasonable now, compared to the "normal" Poisson model. 
> Thank you. However, I tried to find a manual? (although I did manage to 
> find the paper published in the Journal of Statistical Software. For 
> example, how does ?zerotrunc return?

The package still needs some proper documentation and some cleaning up 
which is why it is not yet on CRAN.

The code, however, is well tested because it is exactly the code 
underlying the hurdle() function in "pscl". Hence, the "zerotrunc" objects 
are rather similar in many respect to "hurdle" objects. Starting from the 
JSS paper you should hopefully be able to find your way.
Z

> ?
> Dr. Iasonas Lamprianou
> Department of Social and Political Sciences
> University of Cyprus
>
>
>> ________________________________
>> From: Achim Zeileis <Achim.Zeileis at uibk.ac.at>
>> To: Iasonas Lamprianou <lamprianou at yahoo.com>
>> Cc: Mitchell Maltenfort <mmalten at gmail.com>; "r-help at r-project.org" <r-help at r-project.org>
>> Sent: Monday, 1 August 2011, 10:10
>> Subject: Re: [R] zero truncated poisson regression
>>
>> On Sun, 31 Jul 2011, Iasonas Lamprianou wrote:
>>
>>> Thanks
>>> Pscl seems to be a sensible option.
>>>
>>>
>>> I have the counts variable with the name "N". This variable can only
>>> take values bigger than zero!
>>>
>>> I have two explanatory variables with the names "type" and "diam"
>>>
>>> but when I run
>>>
>>> hpm <- hurdle(n ~ type+diam, data = an, dist = "poisson")
>>>
>>> I get the message "invalid dependent variable, minimum count is not
>>> zero". Well, I know that N>0, that is why want to run a zero-truncated
>>> model. But I must be missing something...and the manual does not seem to
>>> help a lot...
>>>
>>> Can anyone help please?
>>
>> As previously pointed out by others on this list: hurdle() is not what you
>> are looking for (although it is related to what you want to do). The
>> hurdle() model is a two-part model consisting of a zero-truncated count
>> part and a binary part for modeling N=0 vs N>0. See also
>> vignette("countreg", package = "pscl") for details.
>>
>> As you don't need the binary hurdle part, you cannot use hurdle()
>> directly.
>>
>> This is why the package "countreg" on R-Forge provides the function
>> zerotrunc() which essentially does the same thing as the count part in
>> hurdle().
>>
>> install.packages("countreg", repos = "http://R-Forge.R-project.org")
>> library("countreg")
>> m <- zerotrunc(n ~ type + diam, data = an, dist = "poisson")
>> summary(m)
>>
>>> ?
>>> Dr. Iasonas Lamprianou
>>> Department of Social and Political Sciences
>>> University of Cyprus
>>>
>>>
>>>> ________________________________
>>>> From: Mitchell Maltenfort <mmalten at gmail.com>
>>>> To: Iasonas Lamprianou <lamprianou at yahoo.com>; "r-help at r-project.org" <r-help at r-project.org>
>>>> Sent: Sunday, 31 July 2011, 20:45
>>>> Subject: Re: [R] zero truncated poisson regression
>>>>
>>>> Pscl package.
>>>>
>>>> On 7/31/11, Iasonas Lamprianou <lamprianou at yahoo.com> wrote:
>>>>> Dear friends,
>>>>>
>>>>> does anyone know how I can run a zero truncated poisson regression using R
>>>>> (or even SPSS)?
>>>>>
>>>>> Dr. Iasonas Lamprianou
>>>>> Department of Social and Political Sciences
>>>>> University of Cyprus
>>>>>
>>>>> ??? [[alternative HTML version deleted]]
>>>>>
>>>>>
>>>>
>>>> --
>>>> Sent from my mobile device
>>>>
>>>> Due to the recession, requests for instant gratification will be
>>>> deferred until arrears in scheduled gratification have been satisfied.
>>>>
>>>>
>>>>
>>> ??? [[alternative HTML version deleted]]
>>>
>>>
>>
>>
>>
> 	[[alternative HTML version deleted]]
>
>



More information about the R-help mailing list