Announcement

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

  • Obtaining marginal effects after using the "bayes" prefix

    Dear all,

    Assume that you run a model with the "bayes" prefix. For the sake of the argument, let us assume this very simple example.

    Code:
    sysuse auto
    bayes: reg mpg
    The results are:

    HTML Code:
    Burn-in ...
    Simulation ...
    
    Model summary
    ------------------------------------------------------------------------------
    Likelihood:
      mpg ~ regress({mpg:_cons},{sigma2})
    
    Priors:
      {mpg:_cons} ~ normal(0,10000)
         {sigma2} ~ igamma(.01,.01)
    ------------------------------------------------------------------------------
    
    Bayesian linear regression                       MCMC iterations  =     12,500
    Random-walk Metropolis-Hastings sampling         Burn-in          =      2,500
                                                     MCMC sample size =     10,000
                                                     Number of obs    =         74
                                                     Acceptance rate  =      .4189
                                                     Efficiency:  min =      .1705
                                                                  avg =      .1924
    Log marginal likelihood = -244.88981                          max =      .2144
     
    ------------------------------------------------------------------------------
                 |                                                Equal-tailed
                 |      Mean   Std. Dev.     MCSE     Median  [95% Cred. Interval]
    -------------+----------------------------------------------------------------
    mpg          |
           _cons |  21.30411   .6781437   .014646   21.32258   19.96519   22.60581
    -------------+----------------------------------------------------------------
          sigma2 |  34.45136   5.848324   .141647   33.74739   24.79315    47.5186
    ------------------------------------------------------------------------------
    Note: Default priors are used for model parameters.
    
    When I try to get marginal effects I get:

    HTML Code:
    . margins, dydx(*) atmeans post
    last estimates not found
    r(301);
    Is there a way to retrieve marginal effects after Bayesian analysis in Stata?
Working...
X