# as.mcmc.blca.gibbs: Converts 'blca.gibbs' Objects to type 'mcmc' In BayesLCA: Bayesian Latent Class Analysis

## Description

Converts blca objects to mcmc objects. This is only to be used with the Gibbs sampling method.

## Usage

 1 2 3 4 ## S3 method for class 'blca.gibbs' as.mcmc(x, ...) blca2mcmc(x) 

## Arguments

 x An object of class blca.gibbs. An error is returned if this is not the case. ... Additional arguments to be passed to the mcmc function.

## Details

Whenever a Gibbs sampler is employed, it is always a good idea to ensure that parameter samples are being obtained correctly - that burn-in has been achieved, and that appropriate mixing is taking place, for example. as.mcmc.blca.gibbs converts an object of class blca to that of mcmc to avail of the diagnostic checks available in other R packages, particularly those in the coda package.

## Value

An N \times G*(M+1) matrix of class mcmc, where N is the number of data points, M the number of columns and G the number of classes. The first G columns (labelled ClassProb 1 , ..., ClassProb G) are class membership probability samples, the next G*M columns (labelled ItemProb 1 1 , ItemProb 1 2, ..., ItemProb G 1, ..., ItemProb G M) are item response probability samples.

## Note

This function replaces the function mcmc2blca, which appeared in the original version of the package, and which is retained as an internal function for backwards compatibility reasons.

## Author(s)

Arthur White

blca.gibbs, geweke.diag, raftery.diag
 1 2 3 4 5 6 7 data(Alzheimer) ## Not run: fit.gibbs <- blca.gibbs(Alzheimer, 2) ## Not run: raftery.diag(as.mcmc(fit.gibbs)) ## Not run: fit.gibbs <- blca.gibbs(Alzheimer, 2, K=100000, accept=0.1, burn.in=100) ## Not run: plot(as.mcmc(fit.gibbs))