In Stata (version 15) I used:
Code:
gsem (a b c d e f g h i j k <- ,logit) ///
, lclass(C 2) nocapslatent ///
startvalues(randomid, draws(100) seed(15)) emopts(iter(20))
Code:
/*
. di e(ll) -26958.644
. di BIC 54119.589
number of obersvations 6606
In R (version 3.5.1) I used first the option where missing values are retained
Code:
library(poLCA)
f<- cbind(a,b,c,d,e,f,g,h,i,,j,k)
lc2<-poLCA(f, data=datsubset, nclass=2, maxiter=20, tol=1e-5, na.rm=FALSE, nrep=100, verbose=TRUE, calc.se=TRUE)
Code:
/*
. di e(ll) -26958.644
. di BIC 54120.46
number of observations 6860
number of fully observed cases 5872
Code:
library(poLCA)
f<- cbind(a,b,c,d,e,f,g,h,i,,j,k)
lc2<-poLCA(f, data=datsubset, nclass=2, maxiter=20, tol=1e-5, na.rm=TRUE, nrep=100, verbose=TRUE, calc.se=TRUE)
Code:
.di e(ll) -24396.64 .di BIC 48992.87 .number of fully observations 5872
|
gsem’s method ML is sometimes able to use more observations in the presence of missing values than can sem’s method ML. Meanwhile,gsem does not provide the MLMV methodprovided by sem for explicitly handling missing values. |
I checked the overall sample and the missings values in each variable and they don't differ. There must be something in the code or algorithm to exclude a different number of cases. Any suggestions how to figure out what is happening?
Thanks in advance,
Susanne
0 Response to Missing values in Latent class analysis with gsem in Stata 15 - different results in comparison with R's package poLCA
Post a Comment