Learn R Programming

R2GUESS (version 2.0)

sample.beta: Posterior distribution of the regression coefficients for a chosen model

Description

The sample.beta function generates the effect size estimates of a chosen model within the best models.

Usage

sample.beta(x, res.g, Nmonte.sigma = 1, Nmonte = 1)

Arguments

x

an object of class ESS

res.g

an object of class g.prior produced by get.g.sweep.

Nmonte.sigma

number of re-samples of the posterior variance covariance matrix of the outcomes (Sigma), for a given value of g among those observed for the model under investigation.

Nmonte

number of re-samples of the regression coefficient vector, for a given value of g and of the Sigma matrix.

Value

A list containing the sampled values of the regression coefficients. Re-samples for a given value of g among those observed for the model under investigation are presented in rows (Nmonte x Nmonte.sigma rows) and columns are arranged such that the k-th block of q values represents the regression coefficients of predictor k for all q outcomes.

Examples

Run this code
# NOT RUN {
modelY_Hopx <- example.as.ESS.object()
n.sweep <- get.sweep.best.model(modelY_Hopx,models=1:2)
res.g <- get.g.sweep(modelY_Hopx,n.sweep$result,model=1)
beta <- sample.beta(modelY_Hopx,res.g,Nmonte=5,Nmonte.sigma=5)
res.D14Mit3 <- boxplotbeta(modelY_Hopx,beta,variable="D14Mit3")
# }

Run the code above in your browser using DataLab