+ Reply to Thread
Page 3 of 3 FirstFirst 1 2 3
Results 31 to 36 of 36

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

  1. #31
    Points: 3,730, Level: 38
    Level completed: 54%, Points required for next Level: 70

    Posts
    155
    Thanks
    7
    Thanked 30 Times in 29 Posts

    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;
    Attached Images  

  2. #32
    Omega Contributor
    Points: 38,432, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    7,006
    Thanks
    398
    Thanked 1,186 Times in 1,147 Posts

    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.
    Stop cowardice, ban guns!

  3. #33
    Omega Contributor
    Points: 38,432, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    7,006
    Thanks
    398
    Thanked 1,186 Times in 1,147 Posts

    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.
    Stop cowardice, ban guns!

  4. #34
    Points: 3,730, Level: 38
    Level completed: 54%, Points required for next Level: 70

    Posts
    155
    Thanks
    7
    Thanked 30 Times in 29 Posts

    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.
    Attached Images  

  5. #35
    Omega Contributor
    Points: 38,432, Level: 100
    Level completed: 0%, Points required for next Level: 0
    hlsmith's Avatar
    Location
    Not Ames, IA
    Posts
    7,006
    Thanks
    398
    Thanked 1,186 Times in 1,147 Posts

    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.
    Stop cowardice, ban guns!

  6. #36
    Points: 3,730, Level: 38
    Level completed: 54%, Points required for next Level: 70

    Posts
    155
    Thanks
    7
    Thanked 30 Times in 29 Posts

    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.

+ Reply to Thread
Page 3 of 3 FirstFirst 1 2 3

           




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts






Advertise on Talk Stats