[R] fitting data to exponential distribution with glm

Adelchi Azzalini azzalini at stat.unipd.it
Tue Jun 10 17:47:57 CEST 2003


On Tuesday 10 June 2003 17:31, Masayoshi Hayashi wrote:
> I am learning glm function, but how do you fit data using exponential
> distribution with glm?

The Gamma family is parametrised in glm() by two parameters: 
mean and dispersion; the "dispersion" regulates the shape. 

So must fit a GLM with the Gamma family, and then produce a "summary"
with dispersion parameter set equal to 1, since this value 
corresponds to the exponential distribution in the Gamma family.

In practice:

fit <- glm(formula =...,  family = Gamma)
summary(fit,dispersion=1)   


best wishes,

Adelchi Azzalini

-- 
Adelchi Azzalini  <azzalini at stat.unipd.it>
Dipart.Scienze Statistiche, Universit? di Padova, Italia
http://azzalini.stat.unipd.it/




More information about the R-help mailing list