Help using Base SAS procedures

Proc univariate

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 18
Accepted Solution

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;


Accepted Solutions
Solution
‎09-05-2016 12:01 PM
SAS Super FREQ
Posts: 3,752

Re: Proc univariate

ODS output FitQuantiles=GammaQuantiles;

 

Or if you plan to explore other distributions:

ODS output FitQuantiles=Quantiles_&LoiSeverite;

 

View solution in original post


All Replies
Solution
‎09-05-2016 12:01 PM
SAS Super FREQ
Posts: 3,752

Re: Proc univariate

ODS output FitQuantiles=GammaQuantiles;

 

Or if you plan to explore other distributions:

ODS output FitQuantiles=Quantiles_&LoiSeverite;

 

Occasional Contributor
Posts: 18

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;

SAS Super FREQ
Posts: 3,752

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) 

Occasional Contributor
Posts: 18

Re: Proc univariate

I'm talking about  distribution,

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;

 

 

SAS Super FREQ
Posts: 3,752

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);

☑ This topic is solved.

Need further help from the community? Please ask a new question.

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