+ Reply to Thread
Results 1 to 9 of 9

Thread: Bayes - need help informing priors

  1. #1
    Points: 29, Level: 1
    Level completed: 58%, Points required for next Level: 21

    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Bayes - need help informing priors




    Hi!

    Anyone here familiar with Bayesian inference?

    I would like to inform priors for an analysis. I have Odds Ratios and 95% CIs. How would I calculate the variance from the CIs. I know how to calculate SEs, but I don't think that is the custom for priors (its usually mean and variance).

    Example: I have to average two ORs (1.01 + 0.96)/2 = .99. The largest upper limit of the CIs =1.06 and the smallest lower limit of the CIs = .91. The SE = (1.06-0.91)/3.92 = 0.04. But, again, I don't think using SEs is the standard for priors. Can anyone use this information to calculate the variance?

    If you can, you will be my best friend forever.

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

    Re: Bayes - need help informing priors

    I had the same question a couple of months ago, see below:


    http://www.talkstats.com/showthread....es-(Logistic)?


    I will crunch your numbers in the morning when I am around a computer��
    Stop cowardice, ban guns!

  3. #3
    Points: 29, Level: 1
    Level completed: 58%, Points required for next Level: 21

    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Bayes - need help informing priors

    Oh, that's interesting. Thank you for the reply!


    Sometimes I have a little difficulty with the actual math part of the analysis.

    Do you know if it is even possible to work backwards from the data I have available?

    Thanks again!!

    Quote Originally Posted by hlsmith View Post
    I had the same question a couple of months ago, see below:


    http://www.talkstats.com/showthread....es-(Logistic)?


    I will crunch your numbers in the morning when I am around a computer��

  4. #4
    Points: 29, Level: 1
    Level completed: 58%, Points required for next Level: 21

    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Bayes - need help informing priors

    Oh, I thought I replied to this.

    Thank you so much for your response and the link. If you could crunch the numbers, I would be most grateful! That said, do you even know if it is possible to calculate variance from the data I have available to me? Thanks again!!

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

    Re: Bayes - need help informing priors

    So, per my notes, you have your possible prior ORs and you average to get the mean. Like you have already done.


    (log(0.96) + log(1.01)) / 2
    = -0.01543






    Now for the standard deviation you flip the order of the two ORs and subtract them and divide by 4. So...


    ( log(OR) - log(OR) ) / 4 =
    (0.00995 - (-0.04082)) / 4 =
    =0.0126925


    Then variance, you square it.
    If you need precision: 1/variance.


    I guess it comes down to how the program you are using wants you to format priors. The above puts them into log odds, equivalent to the beta coefficientts. And as you probably noticed, your priors seem pretty close to the null and have reasonable variance, so they will likely pull any non-null estimates down toward the null.
    Stop cowardice, ban guns!

  6. #6
    Points: 29, Level: 1
    Level completed: 58%, Points required for next Level: 21

    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Bayes - need help informing priors

    Wow, that was amazing. I don't think I have that in my notes.

    The SD = 0.0126925, so the variance is that number squared (0.0001611). If that is the case, my priors don't have reasonable variance. Am I missing something? I mean, I know I am because I don't fully understand the 1/variance. Any insight there? I promise I won't bother you too much more after this!!

    Thank you so much for your time and feedback. I really appreciate it!

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

    Re: Bayes - need help informing priors

    To my knowledge, precision is just another measure of dispersion some programs may use. Ignore it if you haven't seen it before.


    Bug me all you want, I need to better hone this stuff myself. I have only used Bayes logistic regression once a couple of months ago. But, I plan to incorporate it in the future as relevant projects arise. I am in the medical field, so most outcomes I have are binary, but I am looking forward to trying it out with other outcomes. Poisson didn't see too hard.


    Yeah, per the thread link I posted, I spent a whole day trying to figure it out myself, so I hear any struggles you have. I think a paper by Andrew Gelman may have also supported that variance calculation. I think there is just some basic logic behind it related to the number of standard deviations perhaps.


    I meant your variance seams reasonable since non-informative priors for odds ratios are typically mean 0 and variance 1000+, and yours are pretty tight or small. Though the effect itself is fairly small or null-ish.


    What program are you going to use? I used SAS, but I need to carve out some time to write out and figure how to do it in R feeding into JAGS.
    Stop cowardice, ban guns!

  8. #8
    Devorador de queso
    Points: 95,819, Level: 100
    Level completed: 0%, Points required for next Level: 0
    Awards:
    Posting AwardCommunity AwardDiscussion EnderFrequent Poster
    Dason's Avatar
    Location
    Tampa, FL
    Posts
    12,935
    Thanks
    307
    Thanked 2,629 Times in 2,245 Posts

    Re: Bayes - need help informing priors

    Quote Originally Posted by raske2 View Post
    Oh, I thought I replied to this.
    You did. But for some reason the response was caught in the spam filter. I released it so now you've replied twice.
    I don't have emotions and sometimes that makes me very sad.

  9. #9
    Points: 29, Level: 1
    Level completed: 58%, Points required for next Level: 21

    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Bayes - need help informing priors


    So sorry about the delay!

    I use SAS and Mplus. I am NO statistician, so I like Mplus. I feel like there are a lot of default options and you just have to adjust what you need to for a particular analysis.

    Thank you again for your response and calculations!!

+ Reply to Thread

           




Tags for this Thread

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