Skip to content
Prev 77075 / 398502 Next

fit data with gammadistribution

Somebody already did the job for you.  Try fitdistr{MASS} i.e.

x=scan("clipboard")#Read your data from clipboard
sh=(mean(x))^2/var(x)
sc=var(x)/mean(x)
fitdistr(x,"gamma", list(shape=sh, scale=sc))

Now you probably know that you have to be carfeul when estimating 
distribution parameters from such a small number of observations.

PS: this is a very "popular" question so in the future before you post a 
question try RSiteSearch() i.e.  RSiteSearch("fit gamma") gave me 273 hits

Cheers

Francisco