Hi,
I am trying to store lognormal quantile distribution in proc univariate in a dataset.
Suppose my output is :
Quantiles for Lognormal Distribution
Quantile
Percent Observed Estimated
1.0 0.23100 0.17449
5.0 0.24700 0.24526
10.0 0.29450 0.29407
25.0 0.37800 0.39825
50.0 0.53150 0.55780
75.0 0.74600 0.78129
90.0 1.10050 1.05807
95.0 1.54700 1.26862
99.0 1.74100 1.78313
Now I need both Observed and Estimated value in SAS dataset. Can anyone guide me what "output out" statement or "ods" statement I should use?
Help is appreciated.
Thanks,
Anupam
In general sandwich a proc between ODS TRACE ON; and ODS TRACE OFF; to see the table names in the log:
ods trace on;
proc univariate data=sashelp.cars;
var mpg_highway;
histogram mpg_highway/lognormal;
run;
ods trace off;
From the log:
Output Added:
-------------
Name: FitQuantiles
Label: Quantiles
Template: base.univariate.FitQuant
Path: Univariate.MPG_Highway.Histogram.Lognormal.FitQuantiles
-------------
Therefore use:
ODS TABLE FITQUANTILES=WANT;
In general sandwich a proc between ODS TRACE ON; and ODS TRACE OFF; to see the table names in the log:
ods trace on;
proc univariate data=sashelp.cars;
var mpg_highway;
histogram mpg_highway/lognormal;
run;
ods trace off;
From the log:
Output Added:
-------------
Name: FitQuantiles
Label: Quantiles
Template: base.univariate.FitQuant
Path: Univariate.MPG_Highway.Histogram.Lognormal.FitQuantiles
-------------
Therefore use:
ODS TABLE FITQUANTILES=WANT;
Thanks Reeza , This was really helpful and solved my problem.
Adding to that I needed to have additional quantiles in my dataset suppose if we need more quantiles other than default 9 in our dataset . For eg p1, p5, p10 , p25, p50, p60, p70, p80 , p90 , p95 , p98, p99 This can be achieved by the following statement.
histogram / weibull (percents = 1 5 10 25 50 60 70 80 90 95 98 99 midpercents )
Gamma (percents = 1 5 10 25 50 60 70 80 90 95 98 99 midpercents )
……. (other options) ;
Thanks Again!!!
Anupam
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.