Learn R Programming

eggCounts (version 1.4)

stan2mcmc: Convert a Stanfit object to MCMC object

Description

Converts a large stanfit object into a MCMC object for easier analysis, it extracts the relevant MCMC samples of the model from stanFit including the baseline mean epg, dispersion, pre- and post-treatment zero-inflation parameters and the calculated reduction.

Usage

stan2mcmc(stanFit)

Arguments

stanFit

A stanfit object from the output of either fecr_stan() or fec_stan()

Value

A MCMC object with a list of relevant parameters depending on the chosen model.

Details

The output can be analyzed as a typical MCMC object with the functions from the coda package. NOTE: The resulting MCMC object does not contain warm-up samples and is already thinned.

Examples

Run this code
# NOT RUN {
data(epgs)

## apply zero-infation model for the paired design to the data vector
model <- fecr_stan(epgs[,1], epgs[,2], rawCounts=FALSE, preCF=10, paired=TRUE, zeroInflation=TRUE)
samples <- stan2mcmc(model$stan.samples)
summary(samples)
# }

Run the code above in your browser using DataLab