s-news
[Top] [All Lists]

use the MMLCR package for latent class regression

To: s-news@lists.biostat.wustl.edu
Subject: use the MMLCR package for latent class regression
From: "Hongjie Wang" <hwang@fulcrumanalytics.com>
Date: Tue, 28 Oct 2003 17:20:59 -0500
Dear Friends:

I am trying to learn using the MMLCR package in R (or S) for latent class
regression analysis.

I simulated data where y=4*x+error from population A and y=-4*x+error from
population B and then mixed A, B together.

I then tried to use the package to

1. uncover the latent segment
2. estimate two regression modesl, one per segment.

For some reason, (maybe due to my silly unfamiliarity with the package), I
was not able to do either with simple simulated data.

I have attached the data (very small population) and the code and hope
someone can give me some tips.

Thanks a lot.

(See attached file: TEST.dat)

read.table("c:/temp/TEST.dat",header=TRUE,sep=",")
summary(test)

lm(y~x,data=test,subset=(gender==1))
lm(y~x,data=test,subset=(gender==0))
check <-mmlcr(outer=~1|id,
component=list(list(formula=y~x,class="cnormonce")),data=test,n.groups=2)
summary(check)
check
mmlcrclassify(check)



Hongjie Wang

Fulcrum Analytics
(203) 254-5306

Attachment: TEST.dat
Description: Binary data

<Prev in Thread] Current Thread [Next in Thread>
  • use the MMLCR package for latent class regression, Hongjie Wang <=