Generalized linear latent and mixed model (GLLAMM) for crossed factors I'm looking for any reference about Generalized Linear Latent and Mixed Model (GLLAMM) for Crossed Factors involving both Measurement Model and Structured Model of GLLAMM (See the problem below). Any help in this regard will be highly appreciated.
Problem: A researcher observed four responses Y1, Y2, Y3, and Y4 along with three covariates X1, X2, and X3 from an experiment involving ab treatment combinations from a fixed factor A with a levels and a random factor B with b levels. Based on past experience, it is assumed four responses are correlated and Y1 is also influenced by the other three (Y2, Y3, and Y4). This data set can be analyzed by GLLAMM in Stata.
 A: Assuming the variable names are exactly as you specified them, this is the first approximation:
reshape long y , i(person) j(item)
* should create four lines per person, with y1 in the first line... y4 in the last line
* x1 through x3 should remain in their places

* create indicators of items
xi item, noomit 
* create the effects of y2, y3 and y4 on y1
forvalues j=2/4 {
   bysort person (item) : generate y`j'on1 = y[`j'] * (_n==1)
}
* create the latent factor equation
eq f1 : _Iitem1 _Iitem2 _Iitem3 _Iitem4
* create the fixed effects for each response
forvalues k=1/3 {
  forvalues j=1/4 {
     gen x`k'_`j' = x`k'*_Item`j'
  }
}
gllamm y _Iitem1 _Iitem2 _Item3 x*_* y*on1, eq(f1) i(person)

However, I don't think you need gllamm here. You can just as well fit this with
reg3 (y1 = y2 y3 y4 x1 x2 x3) (y2 y3 y4 = x1 x2 x3)

may be with corr(independent) option to make the error terms uncorrelated. It is, in fact, a different model from the one that gllamm fits: the latter assumes a factor model for correlations of the error terms.
