Hi. I work with count data and the comparison of the two groups is the purpose of my study. My professor has suggested using the poisson test instead of t test. How can I get this test in Stata?
Announcement
Collapse
No announcement yet.
X

Parastou:
you may want to try something along the following lines:
Code:poisson <count_depvar> i.group
See help estat gof, poisson, poisson postestimation and nbreg entries in Stata .pdf manual.Kind regards,
Carlo
(Stata 15.1 SE)
 1 like

Marcos' helpful reply reminds me that I forgot to mention two really valuable textbooks on count data analysis (with many Stata examples), both written by the deeply missed Joe Hilbe:
https://www.stata.com/bookstore/modelingcountdata/
https://www.stata.com/bookstore/nega...alregression/
Kind regards,
Carlo
(Stata 15.1 SE)
Comment

Thank you everyone for your responses. I have count data for two case and control groups that I think using the poisson test that compare the means of the two groups can be appropriate and poisson regression is not an appropriate option for this. I read an article that I think is similar to my work and attach it. I also used the stata help, but I could not find the sightly test.
Comment

It seems to me that Marcos Almeida and Carlo Lazzaro are on target here. In #1 you referred to two groups. If you are saying that your setup is more complicated than that the answer is still some kind of model with group indicators as predictors. Comparing means **is** regression!
Comment

In a previous thread, some of us discussed how ANOVA is a special case of linear regression. In that sense, Poisson regression can't be an inappropriate option. It would be equally valid as the ANOVA equivalent of Poisson, assuming one exists. This is just another way to restate Nick's assertion that regression and comparing means are equivalent.
I am not wellversed in ANOVAlike analyses, because my field has really defaulted to linear regression and derivatives of that. However, I'm not aware of a Poisson test that is equivalent to ANOVA or a ttest. So, that's the other issue  there may be no such test.
I also can't see any attachments to post #5, and the link just goes to computing services at the University of Louisiana, Lafayette.Please use the code delimiters to show code and results  use the # button on the formatting toolbar, between the " (double quote) and <> buttons.
Please use the command dataex to show a representative sample of data; it is installed already if you have Stata 14.2 or 15.1, else you can install it by typing
Code:ssc install dataex
Comment

Parastou:
I do agree with all Statalister's reply on this query.
Besides, sneaking out the poisson regression framework in favour of the Poisson test (admittedly, a tool I'm not familiar with) does not shelter you from having data that (as it is dramatically often the case with empirical research) do not behave as they were Poisson distributed (Poisson distribution is often a brave assumption; see : https://stats.stackexchange.com/ques...dpoissontest).
Hence, even though you state (or your supervisor states) thatpoisson regression is not an appropriate option for this...
However, with poisson postestimation (estat gof; linktest) you can investigate whether or not you're on target with poisson: I do not know whether you can do the same with the Poisson test.Kind regards,
Carlo
(Stata 15.1 SE)
Comment

Here is my data.
Code:* Example generated by dataex. To install: ssc install dataex clear input byte unit long y1 1 160922 1 57651 1 187935 1 13388 1 126092 1 57127 1 65543 1 158292 1 54349 1 185688 1 12209 1 131718 1 55670 1 63299 2 163611 2 62008 2 188211 2 18002 2 133423 2 62538 2 71836 2 164593 2 59152 2 189614 2 18898 2 129850 2 63540 2 72927 end
Last edited by parastou amirifar; 12 Feb 2019, 09:06.
Comment

Parastou:
your data do not follow a Poisson distribution. You would be better off with nbreg:
Code:. poisson y1 i.unit Iteration 0: log likelihood = 527164.51 Iteration 1: log likelihood = 527164.51 Poisson regression Number of obs = 28 LR chi2(1) = 1711.13 Prob > chi2 = 0.0000 Log likelihood = 527164.51 Pseudo R2 = 0.0016  y1  Coef. Std. Err. z P>z [95% Conf. Interval] + 2.unit  .0500969 .0012113 41.36 0.000 .0477228 .0524709 _cons  11.46154 .0008671 1.3e+04 0.000 11.45984 11.46324  . estat gof Deviance goodnessoffit = 1053963 Prob > chi2(26) = 0.0000 Pearson goodnessoffit = 982949 Prob > chi2(26) = 0.0000 . nbreg y1 i.unit Fitting Poisson model: Iteration 0: log likelihood = 527164.51 Iteration 1: log likelihood = 527164.51 Fitting constantonly model: Iteration 0: log likelihood = 349.63352 Iteration 1: log likelihood = 346.3941 Iteration 2: log likelihood = 345.79765 Iteration 3: log likelihood = 345.79765 Fitting full model: Iteration 0: log likelihood = 345.7788 Iteration 1: log likelihood = 345.77879 Negative binomial regression Number of obs = 28 LR chi2(1) = 0.04 Dispersion = mean Prob > chi2 = 0.8460 Log likelihood = 345.77879 Pseudo R2 = 0.0001  y1  Coef. Std. Err. z P>z [95% Conf. Interval] + 2.unit  .0500969 .2578459 0.19 0.846 .4552717 .5554655 _cons  11.46154 .1823246 62.86 0.000 11.10419 11.81889 + /lnalpha  .764898 .249315 1.253546 .2762496 + alpha  .4653814 .1160266 .2854905 .7586235  LR test of alpha=0: chibar2(01) = 1.1e+06 Prob >= chibar2 = 0.000 .
Kind regards,
Carlo
(Stata 15.1 SE)
Comment
Comment