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
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.