Discussion:
SAS Proc Logistic - Stepwise : how to fix a variable to be included in all models
(too old to reply)
Pete
2005-08-26 22:45:42 UTC
Permalink
Hello,

Is there anyway to include a set of variables that have to stay in the
model when you use a proc logistic with a selection method such as
stepwise?

I want the best model with variables A & B in all models and the
"best" selection from a set of other variables.


I did only find a sequential option, but that doesn't what i want.

Thanks in advance,

Pete
Vadim Pliner
2005-08-29 15:12:51 UTC
Permalink
Post by Pete
Hello,
Is there anyway to include a set of variables that have to stay in the
model when you use a proc logistic with a selection method such as
stepwise?
I want the best model with variables A & B in all models and the
"best" selection from a set of other variables.
I did only find a sequential option, but that doesn't what i want.
Thanks in advance,
Pete
Pete,

I am almost afraid :-) to give an advice on stepwise regression at this
forum where a lot of criticism on the use of this method have been
expressed. I assume you heard all the warnings and know what you are
doing. To force independent variables A & B into the model, use the
'include=' option, and list your independent variables on the model
statement in such an order that A & B are the first two. Here is an
example:


proc logistic;
model y=A B C D E F / selection=stepwise include=2; run;


HTH,
Vadim Pliner
Pete
2005-08-29 16:06:38 UTC
Permalink
Thx

I will handle it with care.
Post by Vadim Pliner
Post by Pete
Hello,
Is there anyway to include a set of variables that have to stay in the
model when you use a proc logistic with a selection method such as
stepwise?
I want the best model with variables A & B in all models and the
"best" selection from a set of other variables.
I did only find a sequential option, but that doesn't what i want.
Thanks in advance,
Pete
Pete,
I am almost afraid :-) to give an advice on stepwise regression at this
forum where a lot of criticism on the use of this method have been
expressed. I assume you heard all the warnings and know what you are
doing. To force independent variables A & B into the model, use the
'include=' option, and list your independent variables on the model
statement in such an order that A & B are the first two. Here is an
proc logistic;
model y=A B C D E F / selection=stepwise include=2; run;
HTH,
Vadim Pliner
Vadim Pliner
2005-08-29 15:13:13 UTC
Permalink
Post by Pete
Hello,
Is there anyway to include a set of variables that have to stay in the
model when you use a proc logistic with a selection method such as
stepwise?
I want the best model with variables A & B in all models and the
"best" selection from a set of other variables.
I did only find a sequential option, but that doesn't what i want.
Thanks in advance,
Pete
Pete,

I am almost afraid :-) to give an advice on stepwise regression at this
forum where a lot of criticism on the use of this method have been
expressed. I assume you heard all the warnings and know what you are
doing. To force independent variables A & B into the model, use the
'include=' option, and list your independent variables on the model
statement in such an order that A & B are the first two. Here is an
example:


proc logistic;
model y=A B C D E F / selection=stepwise include=2; run;


HTH,
Vadim Pliner
Paul Thompson
2005-08-29 20:43:36 UTC
Permalink
Post by Pete
Hello,
Is there anyway to include a set of variables that have to stay in the
model when you use a proc logistic with a selection method such as
stepwise?
I want the best model with variables A & B in all models and the
"best" selection from a set of other variables.
I did only find a sequential option, but that doesn't what i want.
Thanks in advance,
Pete
one of the advantages of the SAS system is that it includes the macro
system. Using macros, it is simple to write your own stepwise
regression approach, in which variables are forced in, and then other
variables are allowed to stay in or drop out. Many statisticians,
myself included, do things like this and don't find them objectionable -
others find these problematic as well.

The key to writing such a macro would be to 1) find a way to include
variables in groups 2) find a way to evaluate the outcomes or fit values
from variables and 3) retain results as you go along.

Using the ODS system, results from each analysis can be obtained. At
this point, you can decide if the variable adds to the others or does not.

Writing this macro is a pretty easy exercise in macro writing.

Loading...