Last data update: 2014.03.03

R: Plot random effects of model
plot.random.effectsR Documentation

Plot random effects of model

Description

Plot the estimates of random effects with confidence intervals

Usage

	## S3 method for class 'random.effects'
plot(x, by = NULL, interval="confidence", level = 0.95, xlab = NULL, ylab = NULL, 
				      xlim = NULL, ylim = NULL, pch=19, col.points='red', col.seg=gray(0.5), ...)

Arguments

x

"random.effects" object

by

defines the element to be plotted

interval

Define the interval to be used. See details

level

the confidence level required

xlab

a title for the x axis

ylab

a title for the y axis

ylim

the x limits of the plot

xlim

the y limits of the plot

pch

either an integer specifying a symbol or a single character to be used as the default in plotting points

col.points

a specification for the default plotting color points

col.seg

a specification for the default plotting color segments

...

Arguments to be passed to method, such as plot

Details

interval

If interval='hpd' is plotted the posterior mean of the random effects with credibility interval. The credibility interval for this case is obtained from the sample using the function HPDinterval of the package coda. If interval='confidence', the credibility interval is obtained from normal distribution quantile (qnorm((1-level)/2,mean,sd). By default is interval='confidence'

Examples


# Not run
data(sensory)

Consumer <- factor(sensory$consumer)
Sacarose <- factor(sensory$sacarose)

#### Model 
# Not run
dex1 <- Bayesthresh(cor ~ (1|Consumer) + Sacarose, Write=TRUE, 
																			burn = 10, jump = 2, ef.iter = 10, data=sensory) 

rand <- random.effects(dex1, HPDinterval=TRUE)
plot(rand, interval='hpd')
plot(rand)

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(Bayesthresh)
Loading required package: lme4
Loading required package: Matrix
Loading required package: MASS
Loading required package: VGAM
Loading required package: stats4
Loading required package: splines
Loading required package: mvtnorm
Loading required package: matrixcalc
Loading required package: coda

Attaching package: 'coda'

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

    nvar

> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Bayesthresh/plot.random.effects.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot.random.effects
> ### Title: Plot random effects of model
> ### Aliases: plot.random.effects
> ### Keywords: plot.random.effects random.effects
> 
> ### ** Examples
> 
> 
> # Not run
> data(sensory)
> 
> Consumer <- factor(sensory$consumer)
> Sacarose <- factor(sensory$sacarose)
> 
> #### Model 
> # Not run
> dex1 <- Bayesthresh(cor ~ (1|Consumer) + Sacarose, Write=TRUE, 
+ 																			burn = 10, jump = 2, ef.iter = 10, data=sensory) 
> 
> rand <- random.effects(dex1, HPDinterval=TRUE)
> plot(rand, interval='hpd')
> plot(rand)
> 
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>