[R] mixture models/latent class regression comparison

Carson Farmer carson.farmer at gmail.com
Mon Feb 28 15:38:02 CET 2011


Dear list,

I have been comparing the outputs of two packages for latent class
regression, namely 'flexmix', and 'mmlcr'. What I have noticed is that
the flexmix package appears to come up with a much better fit than the
mmlcr package (based on logLik, AIC, BIC, and visual inspection). Has
anyone else observed such behaviour? Has anyone else been successful
in using the mmlcr package? I ask because I am interested in latent
class negative binomial regression, which the mmlcr package appears to
support, however, the results for basic Poisson latent class
regression appear to be inferior to the results from flexmix. Below is
a simple reproducible example to illustrate the comparison:

library(flexmix)
library(mmlcr)
data(NPreg) # from package flexmix
m1 <- flexmix(yp ~ x, k=2, data=NPreg, model=FLXMRglm(family='poisson'))
NPreg$id <- 1:200 # mmlcr requires an id column
m2 <- mmlcr(outer=~1|id, components=list(list(formula=yp~x,
class="poisonce")), data=NPreg, n.groups=2)

# summary and coefficients for flexmix model
summary(m1)
summary(refit(m1))

# summary and coefficients for mmlcr model
summary(m2)
m2

Regards,

Carson

P.S. I have attached a copy of the mmlcr package with a modified
mmlcr.poisonce function due to errors in the version available here:
http://cran.r-project.org/src/contrib/Archive/mmlcr/. See also
http://jeldi.com/Members/jthacher/tips-and-tricks/programs/r/mmlcr
section "Bugs?" subsection "Poisson".

-- 
Carson J. Q. Farmer
ISSP Doctoral Fellow
National Centre for Geocomputation
National University of Ireland, Maynooth,
http://www.carsonfarmer.com/


More information about the R-help mailing list