How to control variables in logistic regression.

KRS

New Member
#1
Hello!
I have a DV with two outcomes. Several IVs (categorical and continuous). I want to predict the DV using the IVs, but I also have control variables (categorical and continuous) that I need to put in the equation first.

I found this code:
PROC LOGISTIC < options >;
BY variables ;
CLASS variable <(v-options)> <variable <(v-options)>... >
< / v-options >;
CONTRAST ’label’ effect values <,... effect values>< =options >;
FREQ variable ;
MODEL response = < effects >< / options >;
MODEL events/trials = < effects >< / options >;
OUTPUT < OUT=SAS-data-set >
< keyword=name:::keyword=name > / < option >;
< label: > TEST equation1 < , ::: , < equationk >>< /option >;
UNITS independent1 = list1 < :::

However, I 'm not sure where to place the control variables. Any help would be greatly appreciated.

Thanks and Happy Thanksgiving!
 

hlsmith

Not a robit
#2
Have you not used SAS for logistic regression before? Something like this:


Code:
[FONT=Courier New][SIZE=2][COLOR=#000080][FONT=Courier New][SIZE=2][COLOR=#000080][FONT=Courier New][SIZE=2][COLOR=#000080][B]PROC [/B][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][B][FONT=Courier New][SIZE=2][COLOR=#000080][FONT=Courier New][SIZE=2][COLOR=#000080][FONT=Courier New][SIZE=2][COLOR=#000080]LOGISTIC [/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/B][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]DATA[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] = Data_set_name[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2];[/SIZE][/FONT][/SIZE][/FONT]
[FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]CLASS[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] /*categorical IVs and control variables go here*/;[/SIZE][/FONT][/SIZE][/FONT]
[FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]MODEL[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2] Y ([/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff][FONT=Courier New][SIZE=2][COLOR=#0000ff]EVENT[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2]=[/SIZE][/FONT][/SIZE][/FONT][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080][FONT=Courier New][SIZE=2][COLOR=#800080]"1")= /*Categorical and continuous IVs and control variables go here */[/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2];[/SIZE][/FONT][/SIZE][/FONT]
[FONT=Courier New][SIZE=2][COLOR=#000080][FONT=Courier New][SIZE=2][COLOR=#000080][FONT=Courier New][SIZE=2][COLOR=#000080][B]run[/B][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][/COLOR][/SIZE][/FONT][FONT=Courier New][SIZE=2][FONT=Courier New][SIZE=2];[/SIZE][/FONT][/SIZE][/FONT]
It is as easy as that. If you have other questions, fire away.
 

KRS

New Member
#3
Well, that doesn't seem too hard. I'm just learning SAS so trying to make sure I'm doing everything right. Thanks for your help!
 

hlsmith

Not a robit
#4
Great. I regularly use SAS, let me know if you have any other questions. The only other thing would be to make sure you know what group is being used as the reference (for categoric variables).