Hi Alex,

Try

> require(MASS)
Loading required package: MASS
> b <- c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L,
+ 3363L, 3567L, 4798L, 2032L, 1699L, 3001L, 2329L, 3944L, 2568L,
+ 1699L, 4545L)
> fitdistr(b, 'gamma')
      shape           rate
  6.4528939045   0.0021887943
 (0.7722567310) (0.0001854559)

HTH,
Jorge


On Sat, Aug 6, 2011 at 3:14 PM, Alexander Engelhardt <> wrote:

> Hey,
> I have a set of income data which I'd like to fit to a gamma distribution.
> How can I estimate the two parameters of the gamma distribution for a
> vector, e.g.
>
> c(2039L, 2088L, 5966L, 2353L, 1966L, 2312L, 3305L, 2013L, 3376L,
> 3363L, 3567L, 4798L, 2032L, 1699L, 3001L, 2329L, 3944L, 2568L,
> 1699L, 4545L)
>
> I sense this will be a very easy one-liner, but my searching didn't come up
> with results yet.
>
> Thanks in advance,
>  Alex
>
> ______________________________**________________
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/**listinfo/r-help<https://stat.ethz.ch/mailman/listinfo/r-help>
> PLEASE do read the posting guide http://www.R-project.org/**
> posting-guide.html <http://www.R-project.org/posting-guide.html>
> and provide commented, minimal, self-contained, reproducible code.
>

	[[alternative HTML version deleted]]

