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;
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.
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
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.
@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.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.