lca                  package:e1071                  R Documentation

_L_a_t_e_n_t _C_l_a_s_s _A_n_a_l_y_s_i_s (_L_C_A)

_D_e_s_c_r_i_p_t_i_o_n:

     A latent class analysis with 'k' classes is performed on the data
     given by 'x'.

_U_s_a_g_e:

     lca(x, k, niter=100, matchdata=FALSE, verbose=FALSE)

_A_r_g_u_m_e_n_t_s:

       x: Either a data matrix of binary observations or a list of
          patterns as created by 'countpattern'

       k: Number of classes used for LCA

   niter: Number of Iterations

matchdata: If 'TRUE' and 'x' is a data matrix, the class membership of
          every data point is returned, otherwise the class membership
          of every pattern is returned.

 verbose: If 'TRUE' some output is printed during the computations.

_V_a_l_u_e:

     An object of class '"lca"' is returned, containing 

       w: Probabilities to belong to each class

       p: Probabilities of a `1' for each variable in each class

matching: Depending on 'matchdata' either the class membership of each
          pattern or of each data point

logl, loglsat: The LogLikelihood of the model and of the saturated
          model

bic, bicsat: The BIC of the model and of the saturated model

   chisq: Pearson's Chisq

  lhquot: Likelihood quotient of the model and the saturated model

       n: Number of data points.

      np: Number of free parameters.

_A_u_t_h_o_r(_s):

     Andreas Weingessel

_R_e_f_e_r_e_n_c_e_s:

     Anton K. Formann: ``Die Latent-Class-Analysis'', Beltz Verlag 1984

_S_e_e _A_l_s_o:

     'countpattern', 'bootstrap.lca'

_E_x_a_m_p_l_e_s:

     ## Generate a 4-dim. sample with 2 latent classes of 500 data points each.
     ## The probabilities for the 2 classes are given by type1 and type2.
     type1 <- c(0.8,0.8,0.2,0.2)
     type2 <- c(0.2,0.2,0.8,0.8)
     x <- matrix(runif(4000),nr=1000)
     x[1:500,] <- t(t(x[1:500,])<type1)*1
     x[501:1000,] <- t(t(x[501:1000,])<type2)*1

     l <- lca(x, 2, niter=5)
     print(l)
     summary(l)
     p <- predict(l, x)
     table(p, c(rep(1,500),rep(2,500)))

