Hi
I am looking for a SAS macro to perform stepwise model selection for PROC GENMOD when the data is longitudinal (i.e. REPEATED statement in PROC GENMOD).
I found the below article which describes a SAS macro.
Does anyone have code to full macro? Or code to a similar macro doing the model selection?
https://www.pharmasug.org/proceedings/2012/SP/PharmaSUG-2012-SP09.pdf
Best regards
Ali
You should check out this article from the SAS Global Forum:
chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://support.sas.com/resources/papers/proceedings14/1822-2014.pdf
It deals with stepwise selection using GLIMMIX. In GLIMMIX you can basically fit most of the models of GENMOD, and many more. But the syntax of GLIMMIX is different for repeated measures/longitudinal data (similar, but different enough to be confusing).
But I must say: be very cautious when doing stepwise selection (using these traditional approaches). There are a lot of statistical reasons why this may not be a good idea. The newer methods in GLMSELECT, etc, are much better (but as you noticed, no way to deal with correlated data).
Use HPGENSELECT instead !
Koen
Hi Koen
Thank you for your reply.
For longitudinal binary data "REPEATED" option needs to used in PROC GENMOD in order to analyze such data.
I can't see the "REPEATED" option offered in HPGENSELECT.
How can I use HPGENSELECT for longitudinal data?
Best regards
Ali
You are right:
PROC HPGENSELECT does not support a REPEATED statement.
Sorry I had overlooked that.
I have just looked into the GEE procedure. That's the generalized estimating equations (GEE) approach (Liang and Zeger
1986), which extends the generalized linear model to handle longitudinal data.
But also there I cannot see effect selection and model selection capabilities.
PROC GLIMMIX is also not offering this.
Maybe @StatDave can help you out?
NB: in my previous post , I should also have given this example/article as well:
Home > Programming > Code examples
High-Performance Variable Selection for Generalized Linear Models: PROC HPGENSELECT
Started 3 weeks ago | Modified 3 weeks ago
https://communities.sas.com/t5/SAS-Code-Examples/High-Performance-Variable-Selection-for-Generalized...
Koen
@Ksharp wrote:
In PROC GENMOD , you could check ASSCEE statement, but I am not sure if that is what you are looking for.
I think @Ksharp refers to the ASSESS|ASSESSMENT statement.
It's for Assessment of Models Based on Aggregates of Residuals.
Thanks @Ksharp , it's a nice discovery ... I have never used that statement (and never noticed its existence).
Koen
You should check out this article from the SAS Global Forum:
chrome-extension://efaidnbmnnnibpcajpcglclefindmkaj/https://support.sas.com/resources/papers/proceedings14/1822-2014.pdf
It deals with stepwise selection using GLIMMIX. In GLIMMIX you can basically fit most of the models of GENMOD, and many more. But the syntax of GLIMMIX is different for repeated measures/longitudinal data (similar, but different enough to be confusing).
But I must say: be very cautious when doing stepwise selection (using these traditional approaches). There are a lot of statistical reasons why this may not be a good idea. The newer methods in GLMSELECT, etc, are much better (but as you noticed, no way to deal with correlated data).
Thank you all for providing responses to my question. Much appreciated.
I will look into https://support.sas.com/resources/papers/proceedings14/1822-2014.pdf and see how to modify for my need.
I also came across this article which deals with Backward Selection method, and I also want to modify this macros for Forward/Stepwise Selection method:
https://www.lexjansen.com/nesug/nesug07/cc/cc26.pdf
Best regards
Ali
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.