Hi,
I would appreciate any help from the experienced here. I have alcohol drinking as the dependent variable. I need OR for Age, Sex, cigarette smoking, depression as independent variables. All are categorical variables as they have been coded When I used Alcohol vs each of the above variables, my OddsRatios were Age group 1 1.02 Age group 2 0.97 Age group 3  reference group in this category ______________ Sex (Male/ Female): 0.85 _____________ Cigarette (Yes/No): 3.54 _____________ depression (Yes/No) 1.74 I used cross tabs, checked risk in the crosstab statistics  I got the above odds ratios thus. ______________________________________________________ I wanted adjusted ratios for the same variable in the same order. I used click Analyze > click Regression > click Binary logistic > enter in Dependent variable ( alcohol) > enter in covariates (age, sex, cigarette smoking, depression as independent variables) > click categorical > enter in categorical covariates age, sex, cigarette smoking, depression > last as reference category > click continue > In options check CI for exp (B) 95% > check display at each step > In probability for stepwise entry (0.05) , removal (0.10) (default values) > in classification cutoff 0.5 (default value this one also) > Maximum Iterations (20) (default value)  > check include constant in model > click on continue > click on ok > from output, I am choosing Exp(B) as adjusted odds ratio From the output the adjusted odds ratios were (I am giving the numbers below Exp(B) in the output tables) Age group1 1.12 Age group2 1.06 Sex 1.08 cigarette smoking 0.73 depression 0.71 My questions for the group: 1, Am I doing the correct procedure in SPSS by using cross tabs (risk) for odds ratios and logistic regression (for adjusted odds ratios)? All I need are the odds ratios and the adjusted odds ratios. 2, Obviously the main problem is the numbers for cigarette smoking and depression are so different for odds ratio and adjusted odds ratio. Can the adjusted ratio be so much different than odds ratio? I am using the same dataset. The sample size of the total data set is big (n=5500) and the n for each of the answers of each variables are big enough. There is no problem with the sample sizes for each variable. I am using point and click buttons in SPSS 19 version, unfortunately I don't know coding to use syntax for output. I will appreciate any help. Thanks, John ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
Administrator

For logistic regression, it is conventional to code the dependent variable 1=Yes and 0=No. For CROSSTABS, it usually works out better (meaning you get the odds ratio you want) to have 1=Yes and 2=No. So it may be that you're getting loused up by that difference. Why not use LOGISTIC REGRESSION to get both your crude and adjusted odds ratios? To get the crude (unadjusted) OR for a variable, enter it as the only explanatory variable.
HTH.

Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." NOTE: My Hotmail account is not monitored regularly. To send me an email, please use the address shown above. 
See below for an example of how to estimate both unadjusted and adjusted odds ratios using syntax via LOGISTIC:
Ryan
On Sat, Dec 10, 2011 at 8:13 PM, Bruce Weaver <[hidden email]> wrote: For logistic regression, it is conventional to code the dependent variable 
In reply to this post by John3
My understanding is that the cross tabs risk ratio only works for 2 x 2. Sent from my iPhone

In reply to this post by John3
Thanks, Bruce and Ryan.
Bruce, I have a question for you please. Thanks for mentioning me to code 1 and 0 for the dependent variable. I coded 1 and 2. How about for the independent variables? Should I use 0 for independent variables also? My codes at the time of my 1st post are: Age group 1 = 1 Age group 2 = 2 Age group 3 = 3 Age group 4 = 4 Sex Male = 1 Female = 2 Cigarette Yes = 1 No = 2 depression yes = 1, no =2 I did not code 0 for any variable, if you please clarify that I will code that and report the results back to the list serv. Thanks in advance to you. On Sat, 10 Dec 2011 17:13:55 0800, Bruce Weaver <[hidden email]> wrote: >For logistic regression, it is conventional to code the dependent variable >1=Yes and 0=No. For CROSSTABS, it usually works out better (meaning you get >the odds ratio you want) to have 1=Yes and 2=No. So it may be that you're >getting loused up by that difference. Why not use LOGISTIC REGRESSION to >get both your crude and adjusted odds ratios? To get the crude (unadjusted) >OR for a variable, enter it as the only explanatory variable. > >HTH. > > > >John wrote >> >> Hi, >> >> I would appreciate any help from the experienced here. >> >> I have alcohol drinking as the dependent variable. I need OR for Age, >> cigarette smoking, depression as independent variables. >> >> All are categorical variables as they have been coded >> >> When I used Alcohol vs each of the above variables, my OddsRatios were >> Age group 1 1.02 >> Age group 2 0.97 >> Age group 3  reference group in this category >> ______________ >> Sex (Male/ Female): 0.85 >> _____________ >> Cigarette (Yes/No): 3.54 >> _____________ >> depression (Yes/No) 1.74 >> >> I used cross tabs, checked risk in the crosstab statistics  I got the >> above odds ratios thus. >> >> ______________________________________________________ >> I wanted adjusted ratios for the same variable in the same order. I used >> >> click Analyze > click Regression > click Binary logistic > enter in >> Dependent variable ( alcohol) > enter in covariates (age, sex, >> smoking, depression as independent variables) > click categorical > >> enter in categorical covariates age, sex, cigarette smoking, depression > >> last as reference category > click continue > In options check CI for >> exp >> (B) 95% > check display at each step > In probability for stepwise entry >> (0.05) , removal (0.10) (default values) > in classification cutoff 0.5 >> (default value this one also) > Maximum Iterations (20) (default value)  >>> check include constant in model > click on continue > click on ok > >> from output, I am choosing Exp(B) as adjusted odds ratio >> >> From the output the adjusted odds ratios were (I am giving the numbers >> below Exp(B) in the output tables) >> Age group1 1.12 >> Age group2 1.06 >> Sex 1.08 >> cigarette smoking 0.73 >> depression 0.71 >> >> My questions for the group: >> >> 1, Am I doing the correct procedure in SPSS by using cross tabs (risk) >> for odds ratios and logistic regression (for adjusted odds ratios)? All >> need are the odds ratios and the adjusted odds ratios. >> 2, Obviously the main problem is the numbers for cigarette smoking and >> depression are so different for odds ratio and adjusted odds ratio. Can >> the adjusted ratio be so much different than odds ratio? >> >> I am using the same dataset. The sample size of the total data set is big >> (n=5500) and the n for each of the answers of each variables are big >> enough. There is no problem with the sample sizes for each variable. I am >> using point and click buttons in SPSS 19 version, unfortunately I don't >> know coding to use syntax for output. >> >> I will appreciate any help. Thanks, >> >> John >> >> ===================== >> To manage your subscription to SPSSXL, send a message to >> LISTSERV@.UGA (not to SPSSXL), with no body text except the >> command. To leave the list, send the command >> SIGNOFF SPSSXL >> For a list of commands to manage subscriptions, send the command >> INFO REFCARD >> > > > > >Bruce Weaver >[hidden email] >http://sites.google.com/a/lakeheadu.ca/bweaver/ > >"When all else fails, RTFM." > >NOTE: My Hotmail account is not monitored regularly. >To send me an email, please use the address shown above. > > >View this message in context: http://spssx tp5065253p5065283.html >Sent from the SPSSX Discussion mailing list archive at Nabble.com. > >===================== >To manage your subscription to SPSSXL, send a message to >[hidden email] (not to SPSSXL), with no body text except the >command. To leave the list, send the command >SIGNOFF SPSSXL >For a list of commands to manage subscriptions, send the command >INFO REFCARD Thanks, Bruce and Ryan. Bruce, I have a question for you please. Thanks for mentioning me to code 1 and 0 for the dependent variable. I coded 1 and 2. How about for the independent variables? Should I use 0 for independent variables also? My codes are: Age group 1 = 1 Age group 2 = 2 Age group 3 = 3 Age group 4 = 4 Sex Male = 1 Female = 2 Cigarette Yes = 1 No = 2 depression yes = 1, no =2 ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
You are specifying via LOGISTIC REGRESSION that all of your predictors are categorical, from what I recall. You just need to know which category for each predictor is being treated as the reference. I believe LOGISTIC REGRESSION gives the option of specifying either the first or last category as the reference.
Ryan
On Sat, Dec 10, 2011 at 11:09 PM, John <[hidden email]> wrote: Thanks, Bruce and Ryan. 
In reply to this post by John3
Why do you have such a coarse DV for alcohol use?
How was it measured in the original data gathering?
Art Kendall Social Research Consultants On 12/10/2011 11:09 PM, John wrote: ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARDThanks, Bruce and Ryan. Bruce, I have a question for you please. Thanks for mentioning me to code 1 and 0 for the dependent variable. I coded 1 and 2. How about for the independent variables? Should I use 0 for independent variables also? My codes at the time of my 1st post are: Age group 1 = 1 Age group 2 = 2 Age group 3 = 3 Age group 4 = 4 Sex Male = 1 Female = 2 Cigarette Yes = 1 No = 2 depression yes = 1, no =2 I did not code 0 for any variable, if you please clarify that I will code that and report the results back to the list serv. Thanks in advance to you. On Sat, 10 Dec 2011 17:13:55 0800, Bruce Weaver [hidden email] wrote:For logistic regression, it is conventional to code the dependent variable 1=Yes and 0=No. For CROSSTABS, it usually works out better (meaning yougetthe odds ratio you want) to have 1=Yes and 2=No. So it may be that you're getting loused up by that difference. Why not use LOGISTIC REGRESSION to get both your crude and adjusted odds ratios? To get the crude(unadjusted)OR for a variable, enter it as the only explanatory variable. HTH. John wroteHi, I would appreciate any help from the experienced here. I have alcohol drinking as the dependent variable. I need OR for Age,Sex,cigarette smoking, depression as independent variables. All are categorical variables as they have been coded When I used Alcohol vs each of the above variables, my OddsRatios were Age group 1 1.02 Age group 2 0.97 Age group 3  reference group in this category ______________ Sex (Male/ Female): 0.85 _____________ Cigarette (Yes/No): 3.54 _____________ depression (Yes/No) 1.74 I used cross tabs, checked risk in the crosstab statistics  I got the above odds ratios thus. ______________________________________________________ I wanted adjusted ratios for the same variable in the same order. I used click Analyze > click Regression > click Binary logistic > enter in Dependent variable ( alcohol) > enter in covariates (age, sex,cigarettesmoking, depression as independent variables) > click categorical > enter in categorical covariates age, sex, cigarette smoking,depression >last as reference category > click continue > In options check CI for exp (B) 95% > check display at each step > In probability for stepwiseentry(0.05) , removal (0.10) (default values) > in classification cutoff 0.5 (default value this one also) > Maximum Iterations (20) (defaultvalue) check include constant in model > click on continue > click on ok >from output, I am choosing Exp(B) as adjusted odds ratio From the output the adjusted odds ratios were (I am giving the numbers below Exp(B) in the output tables) Age group1 1.12 Age group2 1.06 Sex 1.08 cigarette smoking 0.73 depression 0.71 My questions for the group: 1, Am I doing the correct procedure in SPSS by using cross tabs (risk) for odds ratios and logistic regression (for adjusted odds ratios)? AllIneed are the odds ratios and the adjusted odds ratios. 2, Obviously the main problem is the numbers for cigarette smoking and depression are so different for odds ratio and adjusted odds ratio. Can the adjusted ratio be so much different than odds ratio? I am using the same dataset. The sample size of the total data set isbig(n=5500) and the n for each of the answers of each variables are big enough. There is no problem with the sample sizes for each variable. Iamusing point and click buttons in SPSS 19 version, unfortunately I don't know coding to use syntax for output. I will appreciate any help. Thanks, John ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD  Bruce Weaver [hidden email] http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." NOTE: My Hotmail account is not monitored regularly. To send me an email, please use the address shown above.  View this message in context: http://spssxdiscussion.1045642.n5.nabble.com/OddsRatioAdjustedOR tp5065253p5065283.htmlSent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARDThanks, Bruce and Ryan. Bruce, I have a question for you please. Thanks for mentioning me to code 1 and 0 for the dependent variable. I coded 1 and 2. How about for the independent variables? Should I use 0 for independent variables also? My codes are: Age group 1 = 1 Age group 2 = 2 Age group 3 = 3 Age group 4 = 4 Sex Male = 1 Female = 2 Cigarette Yes = 1 No = 2 depression yes = 1, no =2 ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD
Art Kendall
Social Research Consultants 
In reply to this post by John3
"My understanding is that the cross tabs risk ratio only works for 2 x 2"
Right. I selected seperate 2x2 tables for each IV to calculate odds ratio. SPSS gives odds ratio in the cross tabs, I don't think that is risk ratio given by cross tabs in SPSS. On Sat, 10 Dec 2011 19:12:19 0800, lori.andersen <[hidden email]> wrote: >My understanding is that the cross tabs risk ratio only works for 2 x 2. > ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
In reply to this post by John3
"I believe LOGISTIC REGRESSION gives the option of specifying either the
first or last category as the reference." In my 1st post, I have detailed all the steps that I completed. Yes, I selected the last category as the reference. Thanks though. ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
In reply to this post by John3
1. I followed Bruce's suggestion and changed the dependent variable
(Alcohol use) 's codes to 0 (=Yes) and 1 (=No) and changed the codes of all IV so that 0 is present as the first category in each variable. I got the same results as before. No change. 2. I could do OR for each one of the IVs from logistic regression also. But, that's not the problem here. When I did ORs from cross tabs, I verified it using hand calculator  the ORs from cross tabs were correct. In short, the OR numbers are correct. What I am trying to achieve is correct AORs. The obvious problem is  I haven't seen such a big difference between OR and AOR ever. I am not fairly experienced, but experienced statisticians and SPSS masters here know better than me. That's why I approached you all. Group, Please suggest. In short, I am presenting my problem again: Is a difference of 2.8 (OR = 3.54, AOR = .74) for cigarette smoking and 0.8 (OR = 1.74, AOR = 0.83) possible? Have you seen such big differences before? ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
Regardless of the size of the OR, we have seen many IV pointed out by
the 2X2 losing their significance when put into LR in multivariate analysis. This is why, those statisticians working in medicine or medical research would never recommend anything to be quoted as a "finding" without performing multivariate analysis, which makes sense. Secondly, you should use the results in accordance with the scientific sense of the problem at hand. Here it seems the two IV's are in favour of "No Alcohol" use in LR. If you are confident that your data is clean, the procedure your performed is correct, underlysing assumptions for the tests are met, report the results with the scientific sense. On 11/12/2011, John <[hidden email]> wrote: > 1. I followed Bruce's suggestion and changed the dependent variable > (Alcohol use) 's codes to 0 (=Yes) and 1 (=No) and changed the codes of > all IV so that 0 is present as the first category in each variable. > > I got the same results as before. No change. > > > 2. I could do OR for each one of the IVs from logistic regression also. > But, that's not the problem here. When I did ORs from cross tabs, I > verified it using hand calculator  the ORs from cross tabs were correct. > In short, the OR numbers are correct. > > What I am trying to achieve is correct AORs. The obvious problem is  I > haven't seen such a big difference between OR and AOR ever. I am not > fairly experienced, but experienced statisticians and SPSS masters here > know better than me. That's why I approached you all. > > > Group, Please suggest. In short, I am presenting my problem again: Is a > difference of 2.8 (OR = 3.54, AOR = .74) for cigarette smoking and 0.8 (OR > = 1.74, AOR = 0.83) possible? Have you seen such big differences before? > > ===================== > To manage your subscription to SPSSXL, send a message to > [hidden email] (not to SPSSXL), with no body text except the > command. To leave the list, send the command > SIGNOFF SPSSXL > For a list of commands to manage subscriptions, send the command > INFO REFCARD > ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
In reply to this post by John3
The reason people are telling you to get your OR from the logistic
is so that you can demonstrate to yourself that you are defining the groups backwards in the LR, compared to the crosstabs and your hand calculation. Also, you want to make sure that you are getting the OR as one group relative to the other, and not as relative to their *mean* (which I think is a possibility). You could also try running the LR with the dichotomies defined as Scaled, just to see what difference it makes. You are still trying to figure out how to use and read the program  don't waste the opportunity. To see better what is going on, you really ought to generate some of the 2way tables between your predictors, and some 3way tables including the outcome. Predictors will *not* confound each other if they are uncorrelated. That works in LR about the same as it does in ordinary least squares. I agree that the 3.74 OR should not disappear, nor should it be reversed. Smoking with drinking is so conventional that I would have high suspicions about the data if it did not appear. As it is, I do wonder about the nature of the sample or the exact nature of the criterion when you fail to see higher drinking for Males. The 3way tables should illuminate something about how much reduction of effects you should expect. You can also run your LR with subsets of your predictors in order to see which ones are confounding each other the most.  Rich Ulrich > Date: Sun, 11 Dec 2011 11:57:35 0500 > From: [hidden email] > Subject: Re: Odds Ratio  Adjusted OR > To: [hidden email] > > 1. I followed Bruce's suggestion and changed the dependent variable > (Alcohol use) 's codes to 0 (=Yes) and 1 (=No) and changed the codes of > all IV so that 0 is present as the first category in each variable. > > I got the same results as before. No change. > > > 2. I could do OR for each one of the IVs from logistic regression also. > But, that's not the problem here. When I did ORs from cross tabs, I > verified it using hand calculator  the ORs from cross tabs were correct. > In short, the OR numbers are correct. > > What I am trying to achieve is correct AORs. The obvious problem is  I > haven't seen such a big difference between OR and AOR ever. I am not > fairly experienced, but experienced statisticians and SPSS masters here > know better than me. That's why I approached you all. > > > Group, Please suggest. In short, I am presenting my problem again: Is a > difference of 2.8 (OR = 3.54, AOR = .74) for cigarette smoking and 0.8 (OR > = 1.74, AOR = 0.83) possible? Have you seen such big differences before? > 
In reply to this post by John3
Khanwer, For some reason when I do the ORs for each of the IV using
logistic regression, the results are inverse. For example, for Alcohol vs cigarette smoking (without using any other variable), I am getting 0.38 as opposed to the 2.74 OR obtained by conventional 2x2 cross tabs. In the cross tabs, I have dependent variable in columns and independent in the rows. I am doing exactly what I am describing here. I am describing the most basic thing in statistics so that you can be confident that I am not committing basic errors. I don't think I am doing anything wrong. I explained the logistic regression procedure step by step in detail in my 1st post of the thread. It is definitely not confounding in this case. The output given by SPSS is wrong via logistic regression. I need to verify with SAS and find out why the SPSS output is wrong. I changed the reference categories to first now as opposed to the reference categories being last. The OR (when I use individual DV vs IV) AOR (when I use DV vs multiple IVs) outputs come closer to the "desired" results. It seems to be ExpB is the inverse of the OR and AOR. No? SPSS masters, Clarify this doubt to me. In SPSS, using logistic regression does ExpB = AOR? I think at this point, my question is simple. I need to know what ExpB is! Did anyone have the same problem with SPSS? You may say my coding is wrong (inverse) as in yes for no and no for yes. If coding is wrong, then the results should be consistent when I use cross tabs also. Nah! John ===================== To manage your subscription to SPSSXL, send a message to [hidden email] (not to SPSSXL), with no body text except the command. To leave the list, send the command SIGNOFF SPSSXL For a list of commands to manage subscriptions, send the command INFO REFCARD 
Administrator

Perhaps you would be so kind as to do yourself a favor (and potential respondents) by posting the actual crosstab of the problematic situation (along with SYNTAX to reproduce the ?anomalous? results)!
"The output given by SPSS is wrong via logistic regression." GRRRRRR! If this were the case, the proverbial shitstorm would have hit a LONG time ago! Please post your tables and most importantly the syntax. It is likely a very simple misunderstanding on your part re what is being calculated . HTH, David
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.  "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" 
Perhaps this example (I just made up) will help the OP... Directions for the OP: Open SPSS. Go to the drop down menu and click File>New>Syntax. Copy the code below my name in this post and paste it into the new syntax file. Then go back to the drop down menu and click Run>All.
You will see that the odds ratio produced by CROSSTABS equals the "Exp(B)" for "group(1)" value produced by the LOGISTIC REGRESSION procedure. Note that the odds ratio of interest is calculated by:
odds(cancersmoker) / odds(no cancernonsmoker) where odds(cancersmoker) = pr(cancersmoker) / pr(no cancersmoker) and odds(cancernonsmoker) = pr(cancernonsmoker) / pr(no cancernonsmoker) Ryan set seed 9876452. new file. inp pro. loop ID= 1 to 1000. comp p1 = 0.65. comp p2 = 0.45 comp logodds1 = ln(p1/(1p1)). comp logodds2 = ln(p2/(1p2)). comp b0 = logodds2. comp b1 = logodds1  logodds2. comp group = rv.bernoulli(0.5).
comp eta = b0 + b1*(group=0). comp p = exp(eta) / (1+exp(eta)). comp y1 = rv.bernoulli(p). end case. end loop. end file.
end inp pro. exe. delete variables p1 p2 logodds1 logodds2 b0 b1 eta p. RECODE y1 (0=1) (1=0) INTO y2.
EXECUTE. VALUE LABELS y1 1 'cancer' 0 'no cancer' / y2 1 'no cancer' 0 'cancer' / group 0 'smoker' 1 'nonsmoker'. CROSSTABS
/TABLES=group BY y2 /FORMAT=AVALUE TABLES /STATISTICS=CHISQ RISK /CELLS=COUNT ROW /COUNT ROUND CELL. LOGISTIC REGRESSION VARIABLES y1
/METHOD=ENTER group /CONTRAST (group)=Indicator /CRITERIA=PIN(.05) POUT(.10) ITERATE(20) CUT(.5). On Tue, Dec 13, 2011 at 8:11 PM, David Marso <[hidden email]> wrote: Perhaps you would be so kind as to do yourself a favor (and potential 
Small correction to a statement I made. The "odds ratio of interest" is defined as:
"odds(cancersmoker) / odds(cancernonsmoker)" Everything else is correct. Hope this clears things up for the OP.
Ryan
On Tue, Dec 13, 2011 at 10:18 PM, R B <[hidden email]> wrote:

Free forum by Nabble  Edit this page 