Thread: Calculating the standard error of an odds ratio from the standard errors of 2 logits

1. Re: Calculating the standard error of an odds ratio from the standard errors of 2 log

Here's some example code and the resulting figure for plotting the OR estimates and confidence band using the macro and the output from the lsmestimate statement:

Code:
``````proc sgplot data=data;
title 'Plot X1=2 v X1=1, at X2';
series x=X2 y=ExpEstimate / lineattrs=(color=black);refline 1 / axis=y;
band x=X2 lower=LowerExp upper=UpperExp / transparency=0.5 legendlabel="95% CI";
yaxis type=log logstyle=logexponent logbase=e;
label X2='X2';
label ExpEstimate='log Odds Ratio';
run;``````

2. Re: Calculating the standard error of an odds ratio from the standard errors of 2 log

I am hoping to get time tomorrow to play around with some code and produce my own. Shouldn't the bands be non-existent at the reference value. I could see why they may not be given our approach, but not sure if that is correct.

3. Re: Calculating the standard error of an odds ratio from the standard errors of 2 log

you have a label "log odds ratio"??? Also you may want to add the following to your code:

Code:
``````
REFLINE 1.0;
``````
I guess, I am not following what you are trying to graph since your Y-axis doesn't go from 0 to infinity.

4. Re: Calculating the standard error of an odds ratio from the standard errors of 2 log

That figure was comparing levels of the categorical variable at each level of the continuous variable. I've attached a figure comparing the continuous variable at a reference level of the continuous variable (in this case, the bands are nonexistent at the reference level). The code has a refline=1 statement already, it's just hidden towards the end of the third line. I labeled the y-axis "log odds ratio" because the scale of the axis is base e, since toward the upper range of X2 the confidence limits on the original scale are quite large and make it difficult to see the bands at the lower range.

5. Re: Calculating the standard error of an odds ratio from the standard errors of 2 log

Great stuff. I will likely not update much tomorrow, not until next week. I am going attempt to create a comparable plot. Also the graph from post 31 might be achievable just using the effectsplot option in your Proc surveylogistic.

6. Re: Calculating the standard error of an odds ratio from the standard errors of 2 log

Good to know, I wasn't aware of the effectsplot option, I'm still learning all the details of proc surveylogistic.