01-24-2013 03:36 PM
I really tried to figure this out by searching the internet and reading through different pages as well as the SAS support page, but I didn't come to a solution.
I want to analyse the association between different variables in groups/blocks and the outcome. Therefor I want to create a hierarchical linear regression model using proc reg. So for example, my variables are grouped in blocks like this:
Block1: Demographics (Variables A B C)
Block 2: Behaviors (Variables D E F)
Block 3: Parenting (Variables G H I)
So I want to create a SAS syntax/code using proc reg that first assesses the association between the variables of Block1 and the Outcome, and excludes all variables with a p-value over 0.05 in a backward elimination. Then only the variables that showed p<0.05 in Block1 are included in the model (e.g. only A and C) and the variables of Block2 are added (e.g. Out = A C (resulting out of the elimination process of the regression between Outcome and variables A B C of Block1) D E F (added variables of Block2) . Now, again only those variables which show p<0.05 stay in the model, except for the variables included from Block1, they shall stay in the model no matter how their p-value now changes (eg. A, E and F show p>0.05 the model will be Out = A C D because A is included from Block1 and is forced into the model where E and F are from Block2 and eliminated). The same will be done with Block3. The final model then might be Out = A C D H I (if only H and I showed p<0.05 in Block3).
It is kind of hard for me to describe my issue in a way that it hopefully makes sense to you. I tried a lot of different stuff but nothing worked the way it should... I created a syntax that assessed the association of the variables in the groups, also backward eliminated the variables, but then included the whole group into the next block anyway, not only those variables who showed p<0.05 in the step before... I really don't know how to fix that. I hope you can help me with my problem, I would really appreciate it,
01-24-2013 05:33 PM
Have you tried the INCLUDE=n option in the MODEL statement to force the first n variables to be kept in the variable elimination process?