Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Credible interval (95%) based on a Bayesian estimation

    Dear all,

    I am working on a project using the Bayesian model to predict a binary outcome based on six binary indicators within a two-level random intercept framework (using Stata 17 SE).

    I used "bayesmh" command for more flexible parameter specifications. After running the mode, I used "bayespredict" to retrieve the mean and 95% credible interval for the predicted outcome probability for each participant (n=2000) in my analytical dataset. I was able to get reasonable predicted means of the outcome (ranging from ~18% to 60%), but the associated 95% credible interval always was (0, 1) for all participants. I reviewed Stata's instructions but did not find a solution.

    Below is my code (with modifications for variable names for simplicity):

    bayesmh anyadhd i.a_bi i.b_bi i.c_bi i.d_bi i.e_bi i.f_bi U[stratum], likelihood(logit) ///
    prior({anyadhd:}, normal(0 100)) prior({var_U}, igamma(0.01, 0.01)) block({var_U}, gibbs) ///
    mcmcsize(20000) burnin(5000) rseed(12345) saving(m2_S64_final,replace)

    bayespredict {_ysim}, saving(anyadhd_pred) rseed(12345)
    bayesstats summary {_ysim} using anyadhd_pred

    Posterior summary statistics MCMC sample size = 20,000

    ------------------------------------------------------------------------------
    | Equal-tailed
    | Mean Std. dev. MCSE Median [95% cred. interval]
    -------------+----------------------------------------------------------------
    _ysim1_1 | .18015 .384322 .002718 0 0 1
    _ysim1_2 | .18 .3841971 .002752 0 0 1
    _ysim1_3 | .1785 .3829427 .002708 0 0 1
    _ysim1_4 | .1805 .384613 .00272 0 0 1
    _ysim1_5 | .1804 .3845299 .002719 0 0 1
    _ysim1_6 | .17645 .3812121 .002696 0 0 1
    _ysim1_7 | .1806 .384696 .002679 0 0 1
    _ysim1_8 | .17815 .3826485 .002706 0 0 1
    _ysim1_9 | .179 .3833619 .002711 0 0 1
    _ysim1_10 | .1819 .3857717 .002758 0 0 1


    The above output represents the predicted results for the first 10 participants.

    Any of your thoughts and guidance are greatly appreciated.

    Thank you,
    Mengmeng
Working...
X