From: Oliver Kuss on 4 Dec 2009 03:24 On 3 Dez., 22:52, stringplaye...(a)YAHOO.COM (Dale McLerran) wrote: > --- On Thu, 12/3/09, Oliver Kuss <Oliver.K...(a)MEDIZIN.UNI-HALLE.DE> wrote: > > > Ryan, > > Sorry for wasting your time while waiting for Dave's > > brilliant code ... ;-)) > > > I checked Dale's code without the random effect (Dale, this was not > > for controlling you, just to make sure that I understand what's going > > on ;-))) with the first example of PROC LCA and it worked fine. I > > didn't even need a BOUNDS-Statement. Moreover, the %LCR-macro of D. > > Miglioretti also yielded the same results. > > > Oliver > > Oliver, > > I'm glad that you did! I posted without testing, so I could > not guarantee that I got everything correct. > > Just out of curiosity, how does the NLMIXED version do as with > respect to computational efficiency? I have not yet gotten > access to the site at PSU to enable me to use PROC LCA. > Thus, if you wouldn't mind reporting on efficiency, that > would be of interest. > > Also, I would that computational efficiency can be gained > for problems in which the manifest variables can be > aggregated. I reported again today with code that operated > on aggregated data as found on John Uebersax's website. > Basically, for aggregated data, all that is necessary is > to multiply the log likelihood by the frequency of > occurrence of the manifest vars combination. > > Dale > > --------------------------------------- > Dale McLerran > Fred Hutchinson Cancer Research Center > mailto: dmclerra(a)NO_SPAMfhcrc.org > Ph: (206) 667-2926 > Fax: (206) 667-5977 > --------------------------------------- Dale, here's my little efficiency experiment. I took the first example from PROC LCA (four binary indicators, two latent classes, 428 observations in aggregated form) and compared PROC LCA, your NLMIXED code (with the aggregated likelihood), and the %LCR macro. With the original data set, all three procedures were finished within less than a tenth of a second. After multiplying each observation by 1000, PROC LCA still needs only 0.01 seconds, NLMIXED 0.1 seconds, and %LCR 17.8 seconds. It feels that PROC LCA is programmed rather clever, while %LCR suffers from the fact that it does not allow aggregated data, so one has to explode the data set first. Then the involved matrices (%LCR is written in SAS/ IML) become somewhat large. Oliver
From: Dale McLerran on 4 Dec 2009 12:21 --- On Fri, 12/4/09, Oliver Kuss <Oliver.Kuss(a)MEDIZIN.UNI-HALLE.DE> wrote: > Dale, > here's my little efficiency experiment. I took the first example from > PROC LCA (four binary indicators, two latent classes, 428 observations > in aggregated form) and compared PROC LCA, your NLMIXED code (with the > aggregated likelihood), and the %LCR macro. > > With the original data set, all three procedures were finished within > less than a tenth of a second. > > After multiplying each observation by 1000, PROC LCA still needs only > 0.01 seconds, NLMIXED 0.1 seconds, and %LCR 17.8 seconds. It feels > that PROC LCA is programmed rather clever, while %LCR suffers from the > fact that it does not allow aggregated data, so one has to explode the > data set first. Then the involved matrices (%LCR is written in SAS/ > IML) become somewhat large. > > Oliver > Oliver, Thanks for looking at this. It is pretty much as I expected. The NLMIXED procedure can solve a wide variety of problems that require likelihood maximization. However, procedures which are dedicated to a particular class of problem will probably outperform NLMIXED. Still, if you structure the data appropriately (aggregate where possible) and structure your code to match, then the NLMIXED version is not doing too badly. Dale --------------------------------------- Dale McLerran Fred Hutchinson Cancer Research Center mailto: dmclerra(a)NO_SPAMfhcrc.org Ph: (206) 667-2926 Fax: (206) 667-5977 ---------------------------------------
From: Ryan on 5 Dec 2009 14:14 On Dec 4, 12:21 pm, stringplaye...(a)YAHOO.COM (Dale McLerran) wrote: > --- On Fri, 12/4/09, Oliver Kuss <Oliver.K...(a)MEDIZIN.UNI-HALLE.DE> wrote: > > > > > > > Dale, > > here's my little efficiency experiment. I took the first example from > > PROC LCA (four binary indicators, twolatentclasses, 428 observations > > in aggregated form) and compared PROC LCA, your NLMIXED code (with the > > aggregated likelihood), and the %LCR macro. > > > With the original data set, all three procedures were finished within > > less than a tenth of a second. > > > After multiplying each observation by 1000, PROC LCA still needs only > > 0.01 seconds, NLMIXED 0.1 seconds, and %LCR 17.8 seconds. It feels > > that PROC LCA is programmed rather clever, while %LCR suffers from the > > fact that it does not allow aggregated data, so one has to explode the > > data set first. Then the involved matrices (%LCR is written in SAS/ > > IML) become somewhat large. > > > Oliver > > Oliver, > > Thanks for looking at this. It is pretty much as I expected. > The NLMIXED procedure can solve a wide variety of problems > that require likelihood maximization. However, procedures > which are dedicated to a particularclassof problem will > probably outperform NLMIXED. Still, if you structure the > data appropriately (aggregate where possible) and structure > your code to match, then the NLMIXED version is not doing > too badly. > > Dale > > --------------------------------------- > Dale McLerran > Fred Hutchinson Cancer Research Center > mailto: dmclerra(a)NO_SPAMfhcrc.org > Ph: (206) 667-2926 > Fax: (206) 667-5977 > ---------------------------------------- Hide quoted text - > > - Show quoted text - Hey Dale, I decided to run the fixed effects LCA model through the nlmixed procedure using the code you presented in this thread. I then ran what I think is the same model on the same data in the demo version of the software program, "Latent Gold." Note that the data I used was obtained from an example data set provided in the demo version of Latent Gold. Anyway, the bottom line is that Latent Gold yielded pretty similar results to the results from the code you developed using the nlmixed procedure. I figured this might of interest to you. I also wanted to compare results from the same model with the inclusion of the random effects, but when I tried to run the random effects model including the ESTIMATE statements in the nlmixed procedure, I received an error that the "ESTIMATE statement expressions are not allowed to be dependent on the random effects." As a result, I was not able to validate results from the random effects model. For those interested, the demo version of the Latent Gold program can be downloaded here: http://www.statisticalinnovations.com/products/latentgold_v4.html Best, Ryan
First
|
Prev
|
Pages: 1 2 3 4 Prev: Smarter Text Qualifying Than Just DSD on Import Next: Error Handling |