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]

From |
Nick Cox <[email protected]> |

To |
[email protected] |

Subject |
Re: st: Fit chi2 as in gammafit |

Date |
Tue, 30 Aug 2011 21:27:35 +0100 |

It doesn't worry me personally. I've never wanted to compare a chi-square distribution with data. On Tue, Aug 30, 2011 at 9:24 PM, Tirthankar Chakravarty <[email protected]> wrote: > Fair point Nick - one which I neglected to take into account. > > T > > On Tue, Aug 30, 2011 at 1:19 PM, Nick Cox <[email protected]> wrote: >> Ho hum. A conservative might want the free parameter to be integer-valued. >> >> Nick >> >> On Tue, Aug 30, 2011 at 9:11 PM, Tirthankar Chakravarty >> <[email protected]> wrote: >>> You could do this pretty easily using -ml-, allowing additionally the >>> possibility of including covariates to parameterise the mean >>> (exponential) of the distribution. >>> >>> /*******************************************/ >>> // chi2 regression >>> webuse dollhill3, clear >>> poisson deaths smokes i.agecat >>> >>> cap prog drop chi2reg >>> program chi2reg >>> version 11 >>> args lnf theta >>> qui replace `lnf' = -0.5*exp(`theta')*log(2) /// >>> -lngamma(exp(`theta')/2) + /// >>> (exp(`theta')/2 - 1)*log($ML_y1) /// >>> -$ML_y1/2 >>> end >>> >>> ml model lf chi2reg (deaths = smokes i.agecat) >>> ml maximize >>> /*******************************************/ >>> >>> T >>> >>> >>> On Tue, Aug 30, 2011 at 12:53 PM, Maarten Buis <[email protected]> wrote: >>>> Acutually you can use -gammafit- to estimate a chi square distribution >>>> by constraining [beta]_b[_cons] to be 2. The estimated degrees of >>>> freedom are than 2*[alpha]_b[_cons]: >>>> >>>> *------------ begin example ------------- >>>> drop _all >>>> set obs 100 >>>> gen chi2 = rchi2(3) >>>> constraint 1 [beta]_b[_cons]=2 >>>> gammafit chi2, constraint(1) >>>> >>>> // display estimated degrees of freedom: >>>> lincom [alpha]_b[_cons]*2 >>>> *------------- end example --------------- >>>> (For more on examples I sent to the Statalist see: >>>> http://www.maartenbuis.nl/example_faq ) >>>> >>>> Hope this helps, >>>> Maarten >>>> >>>> On Tue, Aug 30, 2011 at 8:43 PM, Nick Cox <[email protected]> wrote: >>>>> -gammafit- (SSC) is also to be attributed to Stephen Jenkins. >>>>> >>>>> I think the short answer is that nothing is canned and public, but >>>>> existing code like -gammafit- would get you most of the way. Fitting a >>>>> more general distribution has the merit that it tells you something of >>>>> what ways the distribution departs from the specific case. >>>>> >>>>> See also official -pchi- and -qchi-. >>>>> >>>>> Nick >>>>> >>>>> On Tue, Aug 30, 2011 at 7:30 PM, Laurie Molina <[email protected]> wrote: >>>>>> Hi, >>>>>> I would like to fit a chi2 probability distribution to my data, in the >>>>>> same way as the gammafit command (by Nick Cox) does it. >>>>>> Is there any way to perform such a task? >>>>>> >> >> * >> * For searches and help try: >> * http://www.stata.com/help.cgi?search >> * http://www.stata.com/support/statalist/faq >> * http://www.ats.ucla.edu/stat/stata/ >> > > > > -- > Tirthankar Chakravarty > [email protected] > [email protected] > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/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/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**st: Fit chi2 as in gammafit***From:*Laurie Molina <[email protected]>

**Re: st: Fit chi2 as in gammafit***From:*Nick Cox <[email protected]>

**Re: st: Fit chi2 as in gammafit***From:*Maarten Buis <[email protected]>

**Re: st: Fit chi2 as in gammafit***From:*Tirthankar Chakravarty <[email protected]>

**Re: st: Fit chi2 as in gammafit***From:*Nick Cox <[email protected]>

**Re: st: Fit chi2 as in gammafit***From:*Tirthankar Chakravarty <[email protected]>

- Prev by Date:
**Re: st: Fit chi2 as in gammafit** - Next by Date:
**Re: st: xtcorr2 after xtgee** - Previous by thread:
**Re: st: Fit chi2 as in gammafit** - Next by thread:
**Re: st: Fit chi2 as in gammafit** - Index(es):