Last data update: 2014.03.03

R: Posterior distribution of the regression coefficients for a...
sample.betaR Documentation

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.

Author(s)

Benoit Liquet, b.liquet@uq.edu.au,
Marc Chadeau-Hyam m.chadeau@imperial.ac.uk,
Leonardo Bottolo l.bottolo@imperial.ac.uk,
Gianluca Campanella g.campanella11@imperial.ac.uk

Examples

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")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(R2GUESS)
Loading required package: fields
Loading required package: spam
Loading required package: grid
Spam version 1.3-0 (2015-10-24) is loaded.
Type 'help( Spam)' or 'demo( spam)' for a short introduction 
and overview of this package.
Help for individual functions is also obtained by adding the
suffix '.spam' to the function name, e.g. 'help( chol.spam)'.

Attaching package: 'spam'

The following objects are masked from 'package:base':

    backsolve, forwardsolve

Loading required package: maps

 # maps v3.1: updated 'world': all lakes moved to separate new #
 # 'lakes' database. Type '?world' or 'news(package="maps")'.  #


Loading required package: MCMCpack
Loading required package: coda
Loading required package: MASS
##
## Markov Chain Monte Carlo Package (MCMCpack)
## Copyright (C) 2003-2016 Andrew D. Martin, Kevin M. Quinn, and Jong Hee Park
##
## Support provided by the U.S. National Science Foundation
## (Grants SES-0350646 and SES-0350613)
##
Loading required package: mixOmics
Loading required package: lattice
Loading required package: ggplot2

Loaded mixOmics 6.0.0

Visit http://www.mixOmics.org for more details about our methods.
Any bug reports or comments? Notify us at mixomics at math.univ-toulouse.fr or https://bitbucket.org/klecao/package-mixomics/issues

Thank you for using mixOmics!

Attaching package: 'mixOmics'

The following object is masked from 'package:maps':

    map

Loading required package: mvtnorm
Loading required package: snowfall
Loading required package: snow
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/R2GUESS/sample.beta.Rd_%03d_medium.png", width=480, height=480)
> ### Name: sample.beta
> ### Title: Posterior distribution of the regression coefficients for a
> ###   chosen model
> ### Aliases: sample.beta
> 
> ### ** Examples
> 
> modelY_Hopx <- example.as.ESS.object()
The run is ok 
You can now analyse the results 
> 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")
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>