BayesLCA-package: Bayesian Latent Class Analysis

Description Details Author(s) References Examples

Description

Bayesian latent class analysis using several different methods.

Details

Package: BayesLCA
Type: Package
Version: 1.4
Date: 2015-04-09
License: GPL (>= 2)
LazyLoad: yes

Author(s)

Arthur White and Brendan Murphy Maintainer: Arthur White <arthur.white@ucdconnect.ie>

References

Arthur White, Thomas Brendan Murphy (2014). BayesLCA: An R Package for Bayesian Latent Class Analysis." Journal of Statistical Software, 61(13), 1-28. URL: http://www.jstatsoft.org/v61/i13/.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
type1 <- c(0.8, 0.8, 0.2, 0.2)
type2 <- c(0.2, 0.2, 0.8, 0.8)
x <- rlca(1000, rbind(type1, type2), c(0.4,0.6))
fit.em <- blca.em(x, 2)
plot(fit.em, which=1)
print(fit.em)
summary(fit.em)
data(Alzheimer)
fit.vb <- blca(Alzheimer, 2, method="vb")
par(mfrow=c(3,3))
plot(fit.vb, which=3:4)
summary(fit.vb)
par(mfrow=c(1,1))

Example output

Loading required package: e1071
Loading required package: coda
Restart number 1, logpost = -2461.54... 
New maximum found... Restart number 2, logpost = -2461.54... 
Restart number 3, logpost = -2461.54... 
Restart number 4, logpost = -2461.54... 
Restart number 5, logpost = -2461.54... 

MAP Estimates:
 

Item Probabilities:
 
        Col 1 Col 2 Col 3 Col 4
Group 1 0.189 0.208 0.760 0.811
Group 2 0.811 0.820 0.205 0.183

Membership Probabilities:
 
Group 1 Group 2 
  0.614   0.386 
Warning message:
Posterior standard deviations not returned. 
__________________

Bayes-LCA
Diagnostic Summary
__________________

Hyper-Parameters: 

 Item Probabilities:

 alpha: 
        Col 1 Col 2 Col 3 Col 4
Group 1     1     1     1     1
Group 2     1     1     1     1

 beta: 
        Col 1 Col 2 Col 3 Col 4
Group 1     1     1     1     1
Group 2     1     1     1     1

 Class Probabilities:

 delta: 
Group 1 Group 2 
      1       1 
__________________

Method: EM algorithm  

 Number of iterations: 19 

 Log-Posterior Increase at Convergence: 0.0003202069 

 Log-Posterior: -2461.538 

 AIC: -4941.076 

 BIC: -4985.246 
Restart number 1, logpost = -1367.12... 
__________________

Bayes-LCA
Diagnostic Summary
__________________

Hyper-Parameters: 

 Item Probabilities:

 alpha: 
        Hallucination Activity Aggression Agitation Diurnal Affective
Group 1             1        1          1         1       1         1
Group 2             1        1          1         1       1         1

 beta: 
        Hallucination Activity Aggression Agitation Diurnal Affective
Group 1             1        1          1         1       1         1
Group 2             1        1          1         1       1         1

 Class Probabilities:

 delta: 
Group 1 Group 2 
      1       1 
__________________

Method: Variational Bayes  

 Number of iterations: 54 

 Lower Bound Increase at Convergence: 0.0001725421 

 Lower Bound: -1367.115 

BayesLCA documentation built on July 2, 2020, 12:11 a.m.