Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Gamma Dist stats PROC UNIVARIATE

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-13-2016 02:08 AM

Hello - I want to output a host of Gamma distribution stats on a numeric variable grouped (or classed) by a couple of catagorical variables in an output table for easy consumption.

I think PROC UNIVARIATE is what I need. PROC UNIVARIATE can get me the range of stats I need in an output table, but where I get stuck is that as far as I can manage the stats are only for a normal distribution. i.e. I can't get a table output for Gamma distribution. I want stats about the distribution like quartiles, standard deviation, kurtosis, skewdness etc etc.

Would really appreciate your help.

Accepted Solutions

Solution

01-13-2016
03:25 AM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Silvertreetops

01-13-2016 03:15 AM

I do not understand your question. All the quantiles are empirical quantiles . You want exact theory quantiles ? Check function QUANTILE() .

Or you could use histogram option OUTHISTOGRAM= OUTKERNEL= to get these histogram information.

Or you just want find a BEST Gamma curve to fit these data ? Check Rick's blog how to find the best Normal distribution parameter with a sample data. This can guide you to how to find a BEST Gamma distribution parameter to fit these data .

http://blogs.sas.com/content/iml/2011/10/12/maximum-likelihood-estimation-in-sasiml.html

All Replies

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Silvertreetops

01-13-2016 02:47 AM - edited 01-13-2016 02:49 AM

I find an example how to fit Gamma distribution in Documentation .

`ods select ParameterEstimates GoodnessOfFit FitQuantiles;`

proc univariate data=Plates;
var Gap;
histogram / midpoints=0.2 to 1.8 by 0.2
gamma
vaxis = axis1
name = 'MyHist';
inset n mean(5.3) std='Std Dev'(5.3) skewness(5.3)
/ pos = ne header = 'Summary Statistics';
axis1 label=(a=90 r=0);
run;

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Ksharp

01-13-2016 02:52 AM

Hi- thank you for responding. I've also seen that exact example. My problem
with it is that I want a table output, but using the two table output
options I know for PROC UNIVARIATE (TABLE and OUTTABLE) I can only get the
normal distribution output go the table, not the Gamma distribution. Do you
know starting from that code how to output a table with the gamma
distribution?
Also the full range of stats would be helpful. From what I can tell this
code doesn't have the same as PROC UNIVARIATE produces for a normal
distribution.

Solution

01-13-2016
03:25 AM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Silvertreetops

01-13-2016 03:15 AM

I do not understand your question. All the quantiles are empirical quantiles . You want exact theory quantiles ? Check function QUANTILE() .

Or you could use histogram option OUTHISTOGRAM= OUTKERNEL= to get these histogram information.

Or you just want find a BEST Gamma curve to fit these data ? Check Rick's blog how to find the best Normal distribution parameter with a sample data. This can guide you to how to find a BEST Gamma distribution parameter to fit these data .

http://blogs.sas.com/content/iml/2011/10/12/maximum-likelihood-estimation-in-sasiml.html

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Silvertreetops

01-13-2016 03:20 AM

From output I can see these . Is it what you need ?

Distribution of Plate Gaps

The UNIVARIATE Procedure

Fitted Gamma Distribution for Gap

Parameters for Gamma Distribution

Parameter Symbol Estimate

Threshold Theta 0

Scale Sigma 0.155198

Shape Alpha 4.082646

Mean 0.63362

Std Dev 0.313587

Goodness-of-Fit Tests for Gamma Distribution

Test ----Statistic----- ------p Value------

Kolmogorov-Smirnov D 0.09695325 Pr > D >0.250

Cramer-von Mises W-Sq 0.07398467 Pr > W-Sq >0.250

Anderson-Darling A-Sq 0.58106613 Pr > A-Sq 0.137

Quantiles for Gamma Distribution

------Quantile------

Percent Observed Estimated

1.0 0.23100 0.13326

5.0 0.24700 0.21951

10.0 0.29450 0.27938

25.0 0.37800 0.40404

50.0 0.53150 0.58271

75.0 0.74600 0.80804

90.0 1.10050 1.05392

95.0 1.54700 1.22160

99.0 1.74100 1.57939