Sorkin, John
2023-Sep-15 01:51 UTC
[R] Theta from negative binomial regression and power_NegativeBinomiial from PASSED
Colleagues, I want to use the power_NetativeBinomial function from the PASSED library. The function requires a value for a parameter theta. The meaning of theta is not given in the documentation (at least I can?t find it) of the function. Further the descriptions of the negative binomial distribution that I am familiar with do not mention theta as being a parameter of the distribution. I noticed that when one runs the glm.nb function to perform a negative binomial regression one obtains a value for theta. This leads to two questions 1. Is the theta required by the power_NetativeBinomial function the theta that is produced by the glm.nb function 2. What is theta, and how does it relate to the parameters of the negative binomial distribution? Thank you, John [[alternative HTML version deleted]]
Andrew Robinson
2023-Sep-15 02:05 UTC
[R] [EXT] Theta from negative binomial regression and power_NegativeBinomiial from PASSED
Hi John, the negative binomial is a tricky one - there are several different parameterisations and therefore different interpretations of the parameters. Joseph Hilbe wrote a whole book on it that might be wroth checking. Cheers, Andrew -- Andrew Robinson Chief Executive Officer, CEBRA and Professor of Biosecurity, School/s of BioSciences and Mathematics & Statistics University of Melbourne, VIC 3010 Australia Tel: (+61) 0403 138 955 Email: apro at unimelb.edu.au Website: https://researchers.ms.unimelb.edu.au/~apro at unimelb/ I acknowledge the Traditional Owners of the land I inhabit, and pay my respects to their Elders. On 15 Sep 2023 at 11:52 AM +1000, Sorkin, John <jsorkin at som.umaryland.edu>, wrote: External email: Please exercise caution Colleagues, I want to use the power_NetativeBinomial function from the PASSED library. The function requires a value for a parameter theta. The meaning of theta is not given in the documentation (at least I can?t find it) of the function. Further the descriptions of the negative binomial distribution that I am familiar with do not mention theta as being a parameter of the distribution. I noticed that when one runs the glm.nb function to perform a negative binomial regression one obtains a value for theta. This leads to two questions 1. Is the theta required by the power_NetativeBinomial function the theta that is produced by the glm.nb function 2. What is theta, and how does it relate to the parameters of the negative binomial distribution? Thank you, John [[alternative HTML version deleted]] [[alternative HTML version deleted]]
Ivan Krylov
2023-Sep-15 06:27 UTC
[R] Theta from negative binomial regression and power_NegativeBinomiial from PASSED
On Fri, 15 Sep 2023 01:51:27 +0000 "Sorkin, John" <jsorkin at som.umaryland.edu> wrote:> What is theta, and how does it relate to the parameters of the > negative binomial distribution?Plugging the p (the success probability) and the r (the number of successes until the experiment is stopped) from the Wikipedia article (where they are defined in terms of mean mu and variance sigma^2) together with the variance from ?MASS::rnegbin (where it's defined as mu + mu^2/theta) into Maxima and then solving for theta, I get: solve( [ p = mu / sigma^2, r = mu^2/(sigma^2-mu), sigma^2 = mu + mu^2/theta ], [mu, sigma, theta] ); [ mu = ((1-p)*r)/p, sigma = sqrt(r-p*r)/p, theta = r ] That is, the theta from MASS seems to be equivalent to the number of successes from the formulation in the Wikipedia article. -- Best regards, Ivan