Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: syntax -chi2fit-


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: syntax -chi2fit-
Date   Thu, 23 Jun 2005 13:31:09 +0100

-chi2fit- is a user-written program by Stas Kolenikov. 
The problem indicated is the lack of a variable -poisson-, 
which is needed to hold your theoretically expected cdf. 
This is indicated in the help file. 

In this case it seems to me that 

. poisson locn 

would provide a direct approach. 

Nick 
n.j.cox@durham.ac.uk 

Rajiv Mallick
 
> I am trying to use -chi2fit- test to compare distribution of 
> my variable 
> LOCN against Poisson distribution.  I am looking for some 
> guidance on how to 
> use -chi2fit- test, i.e.,
>         - correct Stata syntax for the test,
>         - do I need to first compute cdf of the variable,
>         - in the Stata command how do I specify the 
> theoretical distribution 
> I am comparing the distribution of my variable against,
>         - do I need to -collapse- the variable? If I do, then 
> is it group 
> wise or for any point.
> 
> You can see, any help in implementing this test will be appreciated.
> 
> My variable looks and feels like the following, and my 
> attempt on -chi2fit- 
> is below that.
> 
> 
> Variable LOCN
> ----------------------------------------------------------------
> . tabulate locn
>         LOCN |      Freq.     Percent        Cum.
> ------------+-----------------------------------
>            0 |      2,984       64.35       64.35
>            1 |      1,409       30.39       94.74
>            2 |        185        3.99       98.73
>            3 |         59        1.27      100.00
> ------------+-----------------------------------
>        Total |      4,637      100.00
> 
> . summ locn
>      Variable |       Obs        Mean    Std. Dev.       Min  
>       Max
> -------------+--------------------------------------------------------
>          locn |      4637    .4218245    .6325427          0  
>         3
> ----------------------------------------------------------------------
> 
> 
> My Attempt on -chi2test-
> ----------------------------------------------------------------
> . chi2fit locn poisson if loyald==1 pw(4) fw(4), bins(4) df(0)
> variable poisson not found
> 

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index