[R] Gamma Distribution - is there any problem with "pgamma"?

Amelia Marsh amelia_marsh08 at yahoo.com
Wed Mar 11 10:41:43 CET 2015


Dear R forum

I have following data

amounts = c(928906.144,156091.0576,433798.3404,993425.7224,1323976.364,649106.9339, 369967.2612,2528872.35,1226093.655,1145446.149,1809624.453,599329.0394,2200955.213,2583318.064,745625.8069,961828.8828,1744841.313,1939390.005,1077873.654,729924.2713,803584.2636,287020.8529,530910.9004,818574.0089,1908133.51,262336.0893,593808.2542,780258.1354)

# Estimating Gamma distribution parameters

shape_gamma	    	<-    		(mean(amounts)/sd(amounts))^2 


scale_gamma      <-    		(sd(amounts)^2/mean(amounts))


Fx    				<-    		pgamma(amounts, shape_gamma, scale_gamma)



I get following values of Fx

> Fx 
[1] 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 



I have tried this for different dataset but still each time I am getting values of Fx as 1's only.

Is there any problem with pgamma command?

Kindly advise.

Regards

Amelia



More information about the R-help mailing list