[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

# st: GLLAMM

 From "arosella" To statalist@hsphsun2.harvard.edu Subject st: GLLAMM Date Fri, 12 Feb 2010 16:33:38 +0100

Dear Stata Listers, I am trying to estimate a model using GLLAMM. I have an unobserved response variable (performance) that is comprised of three numerical items (perf1, perf2,perf3). This unobserved response shoul be regressed on two latent variables (iute, iure) each comprised of four and two numerical items respectively. There are moreover eight covariates with direct effect on unobserved response variable and on both iure and iute. I have written some code (and have pasted it below) to build a responde variable but I cannot figure out how to construc the DV as latent variable and the other latent variable. It's too complicated for me. Does anyone have any advice? Any help would be greatly appreciated. Thanks a lot already .

ren reg1 iuti1
ren reg2 iuti2
ren inf1 iuti3
ren inf2 iuti4
reshape long iuti, i(id) j(occasion)
ren occasion t
replace perf1=. if t>=2
replace perf2=. if t>=2
replace perf3=. if t>=2
gen n=_n
ren perf1 resp1
ren perf2 resp2
ren perf3 resp3
ren iuti  resp4
ren imp   resp5
ren imt   resp6
reshape long resp, i(n) j(var)
drop if resp==.
sort id  var t
tab var, gen(i)
gen perf=0
replace perf=1 if var<4
gen iuti=0
replace iuti=1 if var==4
gen iure=0
replace iure=1 if var>4
gen respN=0
replace respN=1 if perf==1
replace respN=2 if iuti==1
replace respN=3 if iure==1
// Interactions between latent variables (outcome and others) and fixed effect
gen lpt1p=lpt1*perf
gen lpt1iu=lpt1*iuti
gen lpt1iure=lpt1*iure
// Question: Are these equations right as established by graphical model (GraphicAS.xls)
eq uno:  perf iuti
eq dos:  perf iure
eq f1:  lpt1iu
gllamm resp perf iuti iure lpt1p lpt1iu, i(id) eqs(uno dos) ///
link(ident ident ident) family(gauss gauss gauss) lv(respN) ///
fv(respN) nrf(2) adap geqs(f1) trace

Alberto Osella Laboratorio di Epidemiologia e Biostatistica IRCCS Saverio de Bellis Via Turi 27 Castellana Grotte (BA) Italia e-mail: arosella@irccsdebellis.it .

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

 © Copyright 1996–2017 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index