Help using Base SAS procedures

proc univariate - store observed and estimate quantile in data set

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

proc univariate - store observed and estimate quantile in data set

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


Accepted Solutions
Solution
‎02-04-2015 03:54 AM
Super User
Posts: 17,775

Re: proc univariate - store observed and estimate quantile in data set

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;

View solution in original post


All Replies
Solution
‎02-04-2015 03:54 AM
Super User
Posts: 17,775

Re: proc univariate - store observed and estimate quantile in data set

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;

Occasional Contributor
Posts: 6

Re: proc univariate - store observed and estimate quantile in data set

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

☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 204 views
  • 0 likes
  • 2 in conversation