BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mmagnuson
Quartz | Level 8

Attached is the cross tab of my dependent variable DONOR and independent variable BEC. If someone is in the BEC then they seem to donate 18.67 times more than if someone is not in the BEC.  I ran a logistic regression:

proc logistic data=work.work;
class BEC (ref='0');
model donor(event='1') = BEC;
run; 

and came up with 18.67 odds ratio and a C statistic of .50

Then, I included 19 more variables and ran the logistic regression again.  This time, the odds ratio was .426 and the c statistic was .77.

Is something wrong with my model? It doesn't seem like .426 makes sense if you look at the cross tab.

 

Thank you for any help!


cross tab.JPG
1 ACCEPTED SOLUTION

Accepted Solutions
StatDave
SAS Super FREQ

By including other potential predictors of Donor in the model, along with your BEC predictor, the resulting parameter estimate and odds ratio estimate for BEC tells you the effect of BEC after adjusting for the effects of the other predictors.  If some of the other predictors in the model are associated with the Donor response, this gives you a better idea of what the separate effect of BEC is after accounting for those other predictors.  As Rick says, the effect of BEC will obviously change if you change the other predictors that are being adjusted for by adding or deleting predictors from the model.

View solution in original post

7 REPLIES 7
Ksharp
Super User

That is 2x2 contingency table, you should not put PROC LOGISTIC on this data, use PROC FREQ or CATMOD instead.

 

data class;
 set sashelp.class;
 x=age>14;
run;
proc freq data=class;
 table sex*x/ relrisk riskdiff;
run;
mmagnuson
Quartz | Level 8

Wouldn't proc logistic tell me the odds if  my dependent variable is binary = Donor (0/1) and then i have a dummy variable?

Ksharp
Super User

If you only include one independent variable, that is called perfect predicted model.

Model would not  be trusted .

mmagnuson
Quartz | Level 8

That makes sense since the c statistic was .50 which seems like a flip of a coin.  I added more variables and it showed an odds ratio of .426 which would mean that if someone was IN the BEC then they have .42 times less liklihood of being a donor.  Does this coincide with the cross tab referece though?

Rick_SAS
SAS Super FREQ

These are very different models. If several of the other 19 variables are correlated with BEC, they will explain much of the same variation as BEC. Also, when you include continuous variables, the odds ratio for BEC is now calculated at the mean value of the continuous variables. In short, you should not expect the odds ratio for BEC in the 20-variable model to match the odds ratio in the one-variable model.

mmagnuson
Quartz | Level 8

Ah this makes a lot of sense!! I took out two continuous variables and was left with only 18 binary variables and the output gave me 3.5 odds ratio which makes more sense. If i want to include continuous varibales in ivs' should I run a separate logistic regression model with only continuous iv?

StatDave
SAS Super FREQ

By including other potential predictors of Donor in the model, along with your BEC predictor, the resulting parameter estimate and odds ratio estimate for BEC tells you the effect of BEC after adjusting for the effects of the other predictors.  If some of the other predictors in the model are associated with the Donor response, this gives you a better idea of what the separate effect of BEC is after accounting for those other predictors.  As Rick says, the effect of BEC will obviously change if you change the other predictors that are being adjusted for by adding or deleting predictors from the model.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is ANOVA?

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.

Discussion stats
  • 7 replies
  • 1806 views
  • 2 likes
  • 4 in conversation