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;
ODS output FitQuantiles=GammaQuantiles;
Or if you plan to explore other distributions:
ODS output FitQuantiles=Quantiles_&LoiSeverite;
ODS output FitQuantiles=GammaQuantiles;
Or if you plan to explore other distributions:
ODS output FitQuantiles=Quantiles_&LoiSeverite;
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;
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)
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;
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);
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.