Learn R Programming

elrm (version 1.2.6)

update.elrm: Update Method for Objects of Class elrm.

Description

An update method for objects created by elrm(). Extends the Markov chain of an elrm object by a specified number of iterations.

Usage

# S3 method for elrm
update(object, iter, burnIn = 0, alpha = 0.05, ...)

Value

An object of class elrm.

Arguments

object

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

iter

an integer representing the number of Markov chain iterations to make.

burnIn

the burn-in period to use when conducting inference. Values of the Markov chain in the burn-in period are discarded; default=0.

alpha

determines the level used for confidence intervals; default=0.05.

...

additional arguments to the update function (currently unused).

Author

David Zamar, Jinko Graham, Brad McNeney

Details

Extends the Markov chain of an elrm object by creating a new Markov chain of the specified length using the last sampled value as the starting point. The newly created chain is then appended to the original. Subsequent inference is based on the extended Markov chain.

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

summary.elrm, plot.elrm, elrm.

Examples

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

# Summarize the results
summary(drug.elrm);

# Call update and extend the chain by 500 iterations and set the burn-in 
# period to 100 iterations
drug.elrm = update(drug.elrm, iter=500, burnIn=100);

# Summarize the results
summary(drug.elrm);

# Now change the burn-in to 200
drug.elrm = update(drug.elrm, iter=0, burnIn=200);

# Summarize the results
summary(drug.elrm);

Run the code above in your browser using DataLab