## Proc univariate

hello,

I use Proc univariate to estimate data parameters,

I would like to export Quantiles for Gamma Distribution in a data sas,

How i can do that ?

%let LoiSeverite =Gamma;

data Grave;

input VAR1;

datalines;

150100

15000

17000

200000

300000

run;

proc univariate data=Grave;

histogram / midpoints=3. to 32043. by 2912.727273

&LoiSeverite

vaxis = axis1

name = 'MyHist';

axis1 label = (a=90 r=0);

/*Loi Gamma*/

qqplot Var1/height = 1 &LoiSeverite(Theta=est sigma=est Alpha=est color=red);

ppplot / &LoiSeverite(Theta=est sigma=est Alpha=est) ctext=blue;

ods output Quantiles=GoodnessOfFit;

run;

1 ACCEPTED SOLUTION

Accepted Solutions

## Re: Proc univariate

ODS output FitQuantiles=GammaQuantiles;

Or if you plan to explore other distributions:

ODS output FitQuantiles=Quantiles_&LoiSeverite;

5 REPLIES 5

## Re: Proc univariate

ODS output FitQuantiles=GammaQuantiles;

Or if you plan to explore other distributions:

ODS output FitQuantiles=Quantiles_&LoiSeverite;

## Re: Proc univariate

Thank you, it works for me.

i would like to extract only Percent 20, 40 and 99.5 for quantile,

How i can do that?

ODS output FitQuantiles=Quantiles&i. Percent= 20 40 99.5;

## Re: Proc univariate

Are you asking for the empirical quantiles of the data, or the quantiles of the estimated distribution?

For the distribution, use the QUANTILE function for the gamma distribution at the estimated parameter values.

For non-standard percentiles of the data, you can use the OUTPUT statement and specify the percentiles that you want. For an example, see this article about percentiles (but ingnore the sections about confidence intervals):

``````
proc univariate data=Grave;
var var1;
output out=pctl pctlpre=p
pctlpts=20 40 99.5; /* <== specify percentiles */
run;

proc print data=pctl; run;``````

You can also output this information in a long form (more like the FitQuantiles table)

## Re: Proc univariate

Instead of Fitquantiles default percentile(exemple inside the /**/ in the code), i would like to change them,

I need necessarely to use quantile function?

I can't do that by Proc univariate?

proc univariate data=Grave;

var VAR1;

histogram / Exponential(theta=0);

qqplot / Exponential(theta=0 Sigma=est);

ppplot / Exponential(theta=0 Sigma=est);

histogram / gamma(theta=0);

qqplot / gamma(theta=0 alpha=est Sigma=est);

ppplot / gamma(theta=0 alpha=est Sigma=est);

ODS output FitQuantiles=Quantiles&i. /*Percent= 20 40 99.5*/;

run;

## Re: Proc univariate

Okay, for the fitted distribution, you can specify the quantiles in the FitQuantile table by using the PERCENT= option on the HISTOGRAM statment, like this

histogram / Exponential(theta=0 percents=20 40 99.5);

Discussion stats
• 5 replies
• 1647 views
• 3 likes
• 2 in conversation