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!
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;
Yes, In fact it's the same name as proc logistic.
HPLOGISTIC also has the OUTEST option.
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?
Pretty sure you specify OUTEST in the HPLOGISTIC statement and capture the table using ODS output statement.
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;
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!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.