BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
clarkchong1
Fluorite | Level 6

I am using SAS 9.4.

Does PROC HPLOGISTIC has an option similar to OUTEST of PROC LOGISTIC?

I know HPLOGISTIC has CODE option which would produce the SAS code to score a future datset, but my concern is to output the parameter estimates in a format easily manipulatable by a downstream process for automation.

Could this be done in HPLOGISTIC, say by using an ODS statement to capture them?

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

It's always best to use one of the SASHELP sample data sets so that everyone can access the data and run the code.

You are correct: that the OUTEST option in HPLOGISTIC works differently than for PROC LOGISTIC. However, what Reeza is saying is that you can use the statement

ODS OUTPUT ParameterEstimates=HPLogiPE;

to convert the ParameterEstimates table to a SAS data set. See the article "ODS OUTPUT: Store any statistic created by any SAS procedure."

 

Here is the comparison:

proc logistic data=sashelp.class outest=LogiPE;
model sex = height weight age;
run;

proc print data=LogiPE; run;

proc hplogistic data=sashelp.class outest;
ods output ParameterEstimates=HPLogiPE;
model sex = height weight age;
run;

proc print data=HPLogiPE; run;

Notice that if you want the HPLOGISTIC output to exactly match the LOGISTIC output, you can use PROC TRANSPOSE, as shown in the documentation:

 

proc transpose data=HPLogiPE out=inest(type=EST) label=_TYPE_;
   label Estimate=PARMS;
   var Estimate;
   id ParmName;
run;

proc print data=inest; run;

View solution in original post

5 REPLIES 5
Reeza
Super User

Yes, In fact it's the same name as proc logistic. 

HPLOGISTIC also has the OUTEST option. 

 

 

clarkchong1
Fluorite | Level 6

Hi Reeza,

While HPLOGISTIC also has OUTEST, it seems that the functionality is completely different. The OUTEST switch doesn't allow specification of a output estimate dataset. For example, the following code would fail:

 

PROC HPLOGISTIC DATA=&in_ds._binned_data OUTEST=parms;

TITLE &in_title;

CLASS &in_independent_class;

MODEL &in_dependent(DESCENDING)=

%DO j=1 %TO &in_num_cont;

var&j._miss_ind /* NOT Commented out for comparison */

%DO k=2 %TO &in_num_bins;

var&j._bin&k._ind

%END;

%END;

RUN;

 

Any suggestion?

Reeza
Super User

Pretty sure you specify OUTEST in the HPLOGISTIC statement and capture the table using ODS output statement. 

Rick_SAS
SAS Super FREQ

It's always best to use one of the SASHELP sample data sets so that everyone can access the data and run the code.

You are correct: that the OUTEST option in HPLOGISTIC works differently than for PROC LOGISTIC. However, what Reeza is saying is that you can use the statement

ODS OUTPUT ParameterEstimates=HPLogiPE;

to convert the ParameterEstimates table to a SAS data set. See the article "ODS OUTPUT: Store any statistic created by any SAS procedure."

 

Here is the comparison:

proc logistic data=sashelp.class outest=LogiPE;
model sex = height weight age;
run;

proc print data=LogiPE; run;

proc hplogistic data=sashelp.class outest;
ods output ParameterEstimates=HPLogiPE;
model sex = height weight age;
run;

proc print data=HPLogiPE; run;

Notice that if you want the HPLOGISTIC output to exactly match the LOGISTIC output, you can use PROC TRANSPOSE, as shown in the documentation:

 

proc transpose data=HPLogiPE out=inest(type=EST) label=_TYPE_;
   label Estimate=PARMS;
   var Estimate;
   id ParmName;
run;

proc print data=inest; run;
clarkchong1
Fluorite | Level 6

Thank you! It worked beautifully!

Thanks also for telling me about the SASHELP library, I didn't previously know what is in it 🙂

A follow-up question, does HPLOGISTIC has OUTMODEL or this can be implemented using ODS as well? Thanks!

sas-innovate-2024.png

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.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 2604 views
  • 1 like
  • 3 in conversation