Learn R Programming

bmeta (version 0.1.2)

traceplot.bmeta: Traceplot to assess convergence

Description

Function to display a plot of iteration vs. sample values for each variable in the chain

Usage

traceplot.bmeta(x,node,title="",lab="")

Arguments

x
a bmeta object with results of the model
node
variable to be displayed on the traceplot
title
title of the plot if specified
lab
name of the variable to be displayed on the traceplot

Examples

Run this code
### Read and format the data (binary)
data = read.csv(url("http://www.statistica.it/gianluca/bmeta/Data-bin.csv"))

### List data for binary outcome 
data.list <- list(y0=data$y0,y1=data$y1,n0=data$n0,n1=data$n1) 

### Select random-effects meta-analysis with t-distribution prior for binary
### data
x <- bmeta(data.list, outcome="bin", model="std.dt", type="ran")


### using output from bmeta to produce traceplot for a specific node
traceplot.bmeta(x,"mu")

### using output from bmeta to produce traceplot and specify the node used
traceplot.bmeta(x,"mu",lab="mu")

Run the code above in your browser using DataLab