BookmarkSubscribeRSS Feed
Angmar
Obsidian | Level 7

Hello,

I have two questions I need help with:

 

1. What is the code in PROC HPGENSELECT that is equivalent to PROC GENMOD for selecting entry and exit criteria during stepwise selection? For example, it would be slentry= 0.2 and slexit=0.05 in PROC GENMOD,.

 

2. Also, I'm trying to output the results from HPGENSELECT already converted from parameter estimates into lower and upper confidence intervals and the RR (see code below that I use for PROC GENMOD). I was able to in PROC GENMOD, but the same code does not work in HPGENSELECT.

Any help is greatly appreciated.

 

Below is my code:

 

ODS TRACE ON;

PROC HPGENSELECT DATA=WORKING;

CLASS SEX (REF="1")/PARAM=REF;

MODEL HEART (EVENT="1") SEX AGE ASTHMA/DIST=BINOMIAL LINK=LOG;

SELECTION METHOD=STEPWISE DETAILS=ALL;

ODS OUTPUT PARAMETERESTIMATES=OUT;

RUN;

 

DATA=OUT_EXP;

SET OUT;

RR=EXP(ESTIMATE)

LCL=EXP(LOWERLRCL)

UCL;=EXP(UPPERLRCL)

RUN;

 

PROC PRINT DATA=OUT_EXP;

RUN;

 

5 REPLIES 5
ballardw
Super User

From the online documentation:

For methods other than LASSO, the only effect-selection criterion that the HPGENSELECT procedure supports is SELECT= SL, in which effects enter and leave the model based on an evaluation of the significance level. To determine the level of significance for each candidate effect, PROC HPGENSELECT calculates an approximate chi-square test statistic. The SELECT= option is not supported by the LASSO method.

 

You can get some adjustment by changing the significance level by setting SL following the STOP option.

Angmar
Obsidian | Level 7
Thank you, I read this as well. I don't know where and how it should look in the code.
SAS_Rob
SAS Employee

Those options would appear in the SELECTION inside ()

 

SELECTION METHOD=STEPWISE(SLENTRY=.02 SLEXIT=.05) DETAILS=ALL;

 

For the second part of the code you would need to add the CL option to the MODEL statement and change the variable name in the data step to LOWERCL and UPPERCL

Angmar
Obsidian | Level 7

Thank you, but entering SLENTRY and SLEXIT did not work (in parentheses behind stepwise). Also, changing the variable names for the CLs in the data set did not work either. 

I am working with SAS 7.1 - this may be the problem.

ChrisHemedinger
Community Manager

@Angmar I assume you mean SAS Enterprise Guide 7.1, but your SAS version is likely something like SAS 9.4 (or 9.3...).

 

For more help, add the text from you SAS log that contains your code and errors you see.

Learn from the Experts! Check out the huge catalog of free sessions in the Ask the Expert webinar series.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 1904 views
  • 4 likes
  • 4 in conversation