Learn R Programming

elrm (version 1.2.6)

plot.elrm: Plot Diagnostics for an elrm Object

Description

Produces both a trace plot and histogram of the sampled values of each sufficient statistic of interest. Sampled values within the burn-in period are also plotted.

Usage

# S3 method for elrm
plot(x, p = 1, breaks = "Sturges", ask=FALSE, ...)

Arguments

x

an object of class elrm, resulting from a call to elrm() or a previous call to update().

p

the sampling fraction of points to be plotted. A random sample consisting of p*100% of all the observations in the Markov chain is plotted; default=1.

breaks

a vector giving the number of cells to use for the histogram of each sufficient statistic of interest or a single number giving the number of cells for each histogram or the character string naming an algorithm to compute the number of cells.

ask

the graphics parameter ask: see par for details. If set to TRUE will ask between plots corresponding to each sufficient statistic; default=FALSE.

...

additional arguments to the plot function (currently unused).

Author

David Zamar, Jinko Graham, Brad McNeney

Details

The default for breaks is "Sturges": see nclass.Sturges. Other names for which algorithms are supplied are "Scott" and "FD".

References

Zamar David. Monte Carlo Markov Chain Exact Inference for Binomial Regression Models. Master's thesis, Statistics and Actuarial Sciences, Simon Fraser University, 2006.

Zamar D, McNeney B and Graham J. elrm: Software Implementing Exact-like Inference for Logistic Regression Models. Journal of Statistical Software 2007, 21(3).

See Also

update.elrm, summary.elrm, elrm.

Examples

Run this code
# Drug dataset example with sex and treatment as the variables of interest
data(drugDat);
drug.elrm = elrm(formula=recovered/n~sex+treatment, interest=~sex+treatment, r=4, 
	iter=40000, burnIn=1000, dataset=drugDat);

# Plot the sampled values of the sufficient statistic for each parameter of 
# interest (sex and treatment)
plot(drug.elrm,p=0.10,ask=TRUE);

Run the code above in your browser using DataLab