Hi R-help, Is there such a thing as a function in R for fitting a GLM where the response is distributed as a Beta distribution? In my case, the response variable is a percentage ([0,1] and continuous). The current glm() function in R doesn't include the Beta distribution. Thank you for any help on this topic. Sincerely, Sharon K?hlmann +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ SHARON K?HLMANN-BERENZON Tel. +46-31-772 53 60 Dept. Mathematical Statistics Fax. +46-31-772 35 08 Chalmers University of Tech. e-mail: sharon at math.chalmers.se Eklandagatan 86 412 96 G?teborg, Sweden
On Wed, 19 Feb 2003, Sharon Kuhlmann-Berenzon wrote:> > Hi R-help, > > Is there such a thing as a function in R for fitting a GLM where the > response is distributed as a Beta distribution? > > In my case, the response variable is a percentage ([0,1] and continuous). > > The current glm() function in R doesn't include the Beta distribution. >That's because they aren't generalised linear models. Two simple possibilities - use the quasibinomial variance and an appropriate link such as logit in glm -- there's an example in McCullagh & Nelder that tries this (though they decide in the end that it doesn't fit their data very well) - Take logits and model with linear regression: a lot of beta distributions are fairly similar to logit-normal distributions. Or you could write down the loglikelihood and use nlm() or optim() to maximise it. -thomas
> On Wed, 19 Feb 2003, Sharon Kuhlmann-Berenzon wrote: > > > > > Hi R-help, > > > > Is there such a thing as a function in R for fitting a GLM where the > > response is distributed as a Beta distribution? > > > > In my case, the response variable is a percentage ([0,1] and continuous). > > > > The current glm() function in R doesn't include the Beta distribution. > > > > That's because they aren't generalised linear models. > > Two simple possibilities > > - use the quasibinomial variance and an appropriate link such as logit in > glm -- there's an example in McCullagh & Nelder that tries this (though > they decide in the end that it doesn't fit their data very well) > > - Take logits and model with linear regression: a lot of beta > distributions are fairly similar to logit-normal distributions.A third simple possibility: my gnlr function in my gnlm library, which fits linear and nonlinear regression models with a beta distribution. www.luc.ac.be/~jlindsey/rcode.html Jim> > Or you could write down the loglikelihood and use nlm() or optim() to > maximise it. > > -thomas > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > http://www.stat.math.ethz.ch/mailman/listinfo/r-help >