Skip to content
Prev 387387 / 398502 Next

poLCA problem

Dear Scott,

I think the issue here is you need to 
form a correct formula poLCA::poLCA can 
accept.

The help page ?poLCA::election has this 
example:

	# Latent class models with one (loglinear independence) to three classes
	data(election)
	f <- cbind(MORALG,CARESG,KNOWG,LEADG,DISHONG,INTELG,
	           MORALB,CARESB,KNOWB,LEADB,DISHONB,INTELB)~1
	nes1 <- poLCA(f,election,nclass=1)  # log-likelihood: -18647.31
	nes2 <- poLCA(f,election,nclass=2)  # log-likelihood: -17344.92
	nes3 <- poLCA(f,election,nclass=3)  # log-likelihood: -16714.66

Perhaps if you export df first using 
data() and try to use cbind(x1, x2)~1 as 
the formula ... 

	data(df2)
	f <- cbind(x1, x2)~1
	poLCA(f, df2, nclass=2, maxiter=100, nrep=10, verbose =TRUE)

Best,
Rasmus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20210309/6d3664f7/attachment.sig>