Tiago Pereira
2011-Jun-12 00:44 UTC
[R] How to compute the P-value for a mixture of chi^2 distributions
Hello, The test I am working on has an asymptotic 0.5*chi2(1)+0.5*chi2(2) distribution, where numbers inside parenthesis stand for the degrees of freedom. Is is possible to compute quickly in R the cumulative distribution of that distribution? Thanks in advance. Tiago -- View this message in context: http://r.789695.n4.nabble.com/How-to-compute-the-P-value-for-a-mixture-of-chi-2-distributions-tp3591276p3591276.html Sent from the R help mailing list archive at Nabble.com.
Thomas Lumley
2011-Jun-12 01:36 UTC
[R] How to compute the P-value for a mixture of chi^2 distributions
On Sun, Jun 12, 2011 at 12:44 PM, Tiago Pereira <tiago.pereira at mbe.bio.br> wrote:> The test I am working on has an asymptotic 0.5*chi2(1)+0.5*chi2(2) > distribution, where numbers inside parenthesis stand for the degrees of > freedom. Is is possible to compute quickly in R the cumulative distribution > of that distribution? >There appear to be pchibar() functions in both the ibdreg and ic.infer packages that should do want you want. Simulation is also fairly efficient. -thomas -- Thomas Lumley Professor of Biostatistics University of Auckland
Tiago Pereira
2011-Jun-12 02:32 UTC
[R] How to compute the P-value for a mixture of chi^2 distributions
thank you very much for your advice, Thomas! Extremely helpful! Cheers! Tiago -- View this message in context: http://r.789695.n4.nabble.com/How-to-compute-the-P-value-for-a-mixture-of-chi-2-distributions-tp3591276p3591365.html Sent from the R help mailing list archive at Nabble.com.
peter dalgaard
2011-Jun-12 08:39 UTC
[R] How to compute the P-value for a mixture of chi^2 distributions
On Jun 12, 2011, at 03:36 , Thomas Lumley wrote:> On Sun, Jun 12, 2011 at 12:44 PM, Tiago Pereira > <tiago.pereira at mbe.bio.br> wrote: > >> The test I am working on has an asymptotic 0.5*chi2(1)+0.5*chi2(2) >> distribution, where numbers inside parenthesis stand for the degrees of >> freedom. Is is possible to compute quickly in R the cumulative distribution >> of that distribution? >> > > There appear to be pchibar() functions in both the ibdreg and ic.infer > packages that should do want you want. Simulation is also fairly > efficient.Assuming that you mean a 50-50 mixture of the two, it should also work just to take the average of the two CDFs. The integral is a linear operator after all. -- Peter Dalgaard Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
Tiago Pereira
2011-Jun-14 00:58 UTC
[R] How to compute the P-value for a mixture of chi^2 distributions
Thanks for your very constructive and helpful tips, Peter and Ted! -- View this message in context: http://r.789695.n4.nabble.com/How-to-compute-the-P-value-for-a-mixture-of-chi-2-distributions-tp3591276p3595373.html Sent from the R help mailing list archive at Nabble.com.