Announcement

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

  • Is Stata able to do Bayesian analysis?

    Well, hello guys, I am learning Bayesian analysis. It's not easy to understand the logic behind it. Stata can do Bayesian analysis?

  • #2
    Hi Tom
    You can watch some example as following link:
    https://www.youtube.com/watch?v=76K1...ature=youtu.be
    https://www.youtube.com/watch?v=0F0Q...ature=youtu.be
    https://www.youtube.com/watch?v=OTO1...ature=youtu.be
    Last edited by Myo Win; 14 Jun 2018, 07:52.

    Comment


    • #3
      Thank you, Myo!

      Comment


      • #4
        Welcome Tom.... May be the following code useful for you...
        webuse oxygen
        bayesmh change age group, likelihood(normal({var})) prior({change:}, flat) prior({var}, jeffreys) saving(bayes1)
        bayesmh change age group, likelihood(normal({var})) prior({change:}, flat) prior({var}, jeffreys) saving(bayes2)
        clear
        append using bayes1 bayes2, gen(chain)
        describe eq*, varl
        xtset chain _index
        twoway tsline eq1_p1 if chain==1 || tsline eq1_p1 if chain==2


        Type this "help bma" in command window ...........


        use data_mpp_small

        . bma growth gdp60 equipinv confuc school60 life60 law tropics avelf, auxiliary(mining dpop pright malaria)

        . bma growth, auxiliary(gdp60 equipinv confuc school60 life60 law tropics avelf mining dpop pright malaria)


        Comment


        • #5
          sysuse cancer

          bayesmh died i.drug age, likelihood(logit) prior( {died:}, normal(0,10)) ///
          saving(both, replace)
          estimates store both

          bayesmh died age, likelihood(logit) prior( {died:}, normal(0,10)) ///
          saving(age_only, replace)
          estimates store age_only

          bayesmh died i.drug, likelihood(logit) prior( {died:}, normal(0,10)) ///
          saving(drug_only, replace)
          estimates store drug_only

          bayesmh died , likelihood(logit) prior( {died:}, normal(0,10)) ///
          saving(intercept, replace)
          estimates store intercept

          bayesstats ic intercept drug_only age_only both, basemodel(intercept)
          bayestest model intercept drug_only age_only both

          Credit to : Matt

          Comment


          • #6
            Well, the Bayesian analysis method to calculate the probability is quite quite different from conventional statistical procedures.

            Comment


            • #7
              If you have Stata 15.1, just type - help bayes - and you'll get great information.

              Also, there is a whole Stata Manual specifially on this matter, here.

              Logically, as it happens to the manuals, this manual approaches mostly the commands and results, hence a deep theoretical background shall be looked for elsewhere.
              Last edited by Marcos Almeida; 14 Jun 2018, 08:57.
              Best regards,

              Marcos

              Comment


              • #8
                Hello Tom,

                I would like to add to what Marcos and Myo said. For a good overview of Bayesian analysis in Stata, this is a great resource:

                https://www.stata.com/features/overv...sian-analysis/

                The information in the link above gives you a sense of the breadth of the tools for Bayesian analysis. You could use any of more than 50 likelihood-based estimators in Stata to do Bayesian analysis.

                https://www.stata.com/new-in-stata/bayes-prefix/

                The models you can fit not only include cross-sectional models but also multilevel models.

                https://www.stata.com/new-in-stata/b...ilevel-models/

                Another cool feature is that if none of the existing models is exactly what you want you can construct your own model.

                https://www.stata.com/features/overv...an-evaluators/

                Comment


                • #9
                  Thanks guys. I learned a lot these couple of days. The guy who invented Bayesian analysis was (is) a genius. The bayesian analysis is beautiful, mathematically.

                  Comment

                  Working...
                  X