Skip to content
Back to formatted view

Raw Message

Message-ID: <loom.20130508T150840-468@post.gmane.org>
Date: 2013-05-08T13:11:07Z
From: Ben Bolker
Subject: How to calculate Hightest Posterior Density (HPD) of coeficients in a simple regression (lm) in R?

Richard Asturia <richard.asturia <at> gmail.com> writes:

> 
> Hi!
> 
> I am trying to calculate HPD for the coeficients of regression models
> fitted with lm or lmrob in R, pretty much in the same way that can be
> accomplished by the association of mcmcsamp and HPDinterval functions for
> multilevel models fitted with lmer. Can anyone point me in the right
> direction on which packages/how to implement this?
> 
> Thanks for your time!
> 
> R.
> 

 Hmmm. 
  At least for lm(), if the assumptions of the model are met
then the sampling distribution of the parameters should be
multivariate normal, so with a flat prior the posterior distributions
should be symmetric and equivalent to the sampling distributions of
the parameters -- so I think that the highest 95% posterior density
interval should be equivalent to classical frequentist confidence
intervals [see confint()].

  You might be interested in the bayeslm() function from the arm
package.