BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Reeza
Super User

Variable female coded as (0= male , 1= female)

Variable anyproc1 coded as (0= no, 1= yes)

Variable noproc1 coded as (0= no, 1= yes)

For these variables

what happens when run the following? ie are the variables essentially the same thing coded? 

proc freq data=your_data;

table anyproc1*noproc1;

run;

Ashwini_uci
Obsidian | Level 7


I didnot quite understand your reply, Reeza. Would you please be more elaborate?

I want to check the above interactions..stated in my previous post..

Thanks

Reeza
Super User

My question is how are the two variables anyproc1 and noproc1 related.

If noproc1=1 then a patient has no procedure and anyproc1 would always be 0?

And if noproc1=0 then anyproc1 would always be 1?

It doesn't sound like you'd need both of those variables in your model unless they happen to be measuring different things. 

You can check for this by running a proc freq on the variables and see how the variables are coded.  If they are coded as I'm guessing then you've overparameterized your model.

Ashwini_uci
Obsidian | Level 7

yes, you are absoulutely right as to  how they are coded.

But i would like to see the results for both so that I would be able to choose which result to be used in my discussion section. Even though the final conclusion is the same, i want to see which one makes more sense so that it can be reported in the paper.

Reeza
Super User

Then you only need one variable in the model. If you want to see the other way you flip your reference level and/or odds ratio. Odds ratio have an invertibility property that makes this easy, basically you go 1/oddsratio to get the new one Smiley Happy.

So in your code in the model include noproc1*female and then in a separate lines include oddsratio noproc1/diff=ref; oddsratio female/diff=ref;

You get the p-value for the interaction terms from the parameter estimates and the odds ratio will be in separate tables.

Ashwini_uci
Obsidian | Level 7

Thanks Reeza, I understand what you are trting to say; i could do that too.

But how do construct the model to get the following effects

I want to check the interactions between women*anyproc1=1(women who underwent any procedure) , women*noproc1=1, and  men*noproc1=1 as compared to (men*anyproc=1.) this intyeraction term will be a reference term.

I just want tobe careful with the number so what to obtain these 3 Odds ratios seprately.

How should I go about this?

How do i inlcude all 3 interactions terms in the model and compare them with the ref (men*anyproc=1)?

I hope I a making sense.

Variable female coded as (0= male , 1= female)

Variable anyproc1 coded as (0= no, 1= yes)

Variable noproc1 coded as (0= no, 1= yes)

Reeza
Super User

This is the same:

women*anyproc1=1, women*anyproc1=0, men*anyproc1=0 vs men*anyproc1=1

So set your reference level for female variable to men and anyproc to 1 and the Odds ratio statement indicated will produce the 3 odds ratio desired.

I'd suggest trying it and seeing what you get...

Ashwini_uci
Obsidian | Level 7

this is my code, could you please if it is correct. I havenot set the reference level here. It gives me 4 odds ratios. i want to share the output with you. How do i convert the html output result to pdf? Which file name should i mention in the proc print statement in the ods pdf code?

where do i write the ods pdf statement ?

Proc logistic data=library.nismicathcabg4 descending ;

Class female  (ref= first) dm dmcx htn_c  aids alcohol ANEMDEF arth race1(ref=first)   ZIPINC_QRTL(ref=first) hosp_location h_contrl(ref=first) hosp_teach bldloss chf chrnlung coag depress drug hypothy liver lymph lytes mets neuro obese para perivasc psych pulmcirc renlfail tumor anyproc1 ulcer valve wghtloss cararrhythmia  /param=ref;

Model died = age female  dm dmcx htn_c  aids alcohol ANEMDEF arth race1 zipinc_qrtl hosp_location h_contrl hosp_teach  TOTAL_DISC bldloss chf chrnlung coag depress drug hypothy liver lymph lytes mets neuro obese para perivasc psych pulmcirc renlfail  anyproc1 tumor ulcer valve wghtloss cararrhythmia female*anyproc1 ;

oddsratio anyproc1 / diff=ref; oddsratio female/diff=ref;

weight discwt;

title 'Logi Reg interaction between anyproc vs gender in overall patients using "where" option with RACE ';

run;

Ashwini_uci
Obsidian | Level 7

okay, i got it.

here i am attaching the output for the following program..

could you please help in interpreting it and if all it is correct ..

thanks

Ashwini_uci
Obsidian | Level 7

it is the interaction1.pdf file..

Reeza
Super User

Give it a try first, write it out here and I'll help you double check it...but I do have to do work :smileysilly:

Ashwini_uci
Obsidian | Level 7
LabelEstimate95% Confidence Limits
anyproc1 0 vs 1 at FEMALE=0: Male4.8694.6685.078
anyproc1 0 vs 1 at FEMALE=1: Female3.1823.0373.334
FEMALE 1: Female vs 0: Male at anyproc1=00.7610.7280.796
FEMALE 1: Female vs 0: Male at anyproc1=11.1651.1191.212


Okay... it seems simple to interprete but i guess this is not i want, as i donot see the comparison of

women*anyproc1=1(women who underwent any procedure) , women*noproc1=1, and  men*noproc1=1 as compared to (men*anyproc=1.)

first row: males with no proc compared with men with any procs. The men with no proc are 4.9 times likely to die compared to men with anyproc. same for 2nd row

3rd row women with no proc 0.76 (24 % less likely) to die compared to men with no proc.

same for 4th row.

so for all these comparisons above how can i set the ref as men with anyproc?

Reeza
Super User

Two of the ones above should be ones you were interested in.

Now, check the docs on how to set the specifics in the odds ratio statement to get what you want.You probably need to set the oddsratio female /at()...

Ashwini_uci
Obsidian | Level 7

any idea how to get the odds ratio for other variables? I am getting the Odds ratios for the interaction terms, but not for the othes.; after running the above posted program.. (the output file attached..)

Ashwini_uci
Obsidian | Level 7

s the p value is common for all 4 odds ratios?

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 36 replies
  • 25142 views
  • 0 likes
  • 4 in conversation