I don't know of any R package that can match all the functionality of LEM eg fitting equality constraints to model parameters a la LISREL. WRT dumping tables, I would have thought that as.data.frame.table does pretty much what you want, [not tested] newtab <- as.data.frame(table(a,b,c)) cat("dim\n") for(i in seq(1, ncol(newtab)-1) { cat(nlevels(newtab[,1]," ") } cat("\nlab ") for(i in seq(1, ncol(newtab)-1) { cat(letters[i], " ") } cat("\ndat [", newtab[,"Freq"], " ]\n") -- | David Duffy (MBBS PhD) ,-_|\ | email: davidD at qimr.edu.au ph: INT+61+7+3362-0217 fax: -0101 / * | Epidemiology Unit, Queensland Institute of Medical Research \_,-._/ | 300 Herston Rd, Brisbane, Queensland 4029, Australia GPG 4D0B994A v
depmixS4 can fit equality constraints in latent class and latent markov models, best, Ingmar On Wed, May 11, 2011 at 1:04 PM, David Duffy <davidD@qimr.edu.au> wrote:> I don't know of any R package that can match all the functionality of LEM > eg fitting equality constraints to model parameters a la LISREL. > > WRT dumping tables, I would have thought that as.data.frame.table does > pretty much what you want, [not tested] > > newtab <- as.data.frame(table(a,b,c)) > cat("dim\n") > for(i in seq(1, ncol(newtab)-1) { > cat(nlevels(newtab[,1]," ") > } > cat("\nlab ") > for(i in seq(1, ncol(newtab)-1) { > cat(letters[i], " ") > } > cat("\ndat [", newtab[,"Freq"], " ]\n") > > > > > -- > | David Duffy (MBBS PhD) ,-_|\ > | email: davidD@qimr.edu.au ph: INT+61+7+3362-0217 fax: -0101 / * > | Epidemiology Unit, Queensland Institute of Medical Research \_,-._/ > | 300 Herston Rd, Brisbane, Queensland 4029, Australia GPG 4D0B994A v > > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]
Thanks for the info. It would be nice to transition LEM to R (make it a package), but I don't know how much work that would take. It's not updated anymore and as far as I know it's not open source. Perhaps Vermunt would be open to share his code. In R it's just a question of finding the right packages for running similar functions as LEM, hence my original question. Best, David Joubert> From: htr@UDel.Edu > Subject: Vermunt's LEM in R > To: joubd@hotmail.com > CC: "Cc: r-help"@r-project.org > Date: Tue, 10 May 2011 17:43:43 -0400 > > In addition to other suggestions, have you looked at gnm, which does (or can do) many of the things LEM does? Also vcd and vcdExtra provide additional tools. > > I stopped using LEM and similar packages because I found R has roughly similar tools. In fact, has LEM been updated or revised recently? I thought its authors were pushing Latent Gold, which seems to be more actively developed than LEM. > > I hope this helps.[[alternative HTML version deleted]]
Thanks, I will definitely give it a try. David J> Date: Wed, 11 May 2011 21:04:23 +1000 > From: davidD@qimr.edu.au > To: r-help@r-project.org > CC: joubd@hotmail.com > Subject: Re: [R] Vermunt's LEM in R > > I don't know of any R package that can match all the functionality of LEM > eg fitting equality constraints to model parameters a la LISREL. > > WRT dumping tables, I would have thought that as.data.frame.table does > pretty much what you want, [not tested] > > newtab <- as.data.frame(table(a,b,c)) > cat("dim\n") > for(i in seq(1, ncol(newtab)-1) { > cat(nlevels(newtab[,1]," ") > } > cat("\nlab ") > for(i in seq(1, ncol(newtab)-1) { > cat(letters[i], " ") > } > cat("\ndat [", newtab[,"Freq"], " ]\n") > > > > > -- > | David Duffy (MBBS PhD) ,-_|\ > | email: davidD@qimr.edu.au ph: INT+61+7+3362-0217 fax: -0101 / * > | Epidemiology Unit, Queensland Institute of Medical Research \_,-._/ > | 300 Herston Rd, Brisbane, Queensland 4029, Australia GPG 4D0B994A v[[alternative HTML version deleted]]