Sorry I am using GLLAMM package and I would like to do a for cycle to find the best BIIC.

I don't understand where is the problem.

"error in remcor

could not calculate numerical derivatives

missing values encountered

(error occurred in ML computation)

(use trace option and check correctness of initial model)

(probabilities will be stored in p_21 p_22 p_23 p_24 p_25 p_26 p_27 p_28)

cannot compute posterior probabilities for more than 1 continuous latent variable

r(301)"

Here is the code

forvalues i=2/10 {

* starting value

eq idc1:a

eq idc2:b

*the model

gllamm resp a b aHGE bsp blp bcp bgmr blog_Gov bequity agdp aupop afert_rate adependratio amav, /*

*/ i(id) nocons eqs(idc1 idc2) nrf(2) link(ident ident) family(gauss gauss) from(a) /*

*/ lv(var) fv(var) nip(`i') ip(f) skip

* defining a matrix equal to

matrix a_`i'=e(b)

matrix a_=e(b)

matrix loglik_`i'=e(ll)

matrix np_`i' = colsof(a_`i')

*posteriod values

gllapred p_`i', p

*predicted value

gllapred bivpre_`i', linpred

gllasim y_`i'

gllapred locaz`i',u

matrix locs`i'=e(zlc2)'

matrix lp`i' = e(zps2)'

}

I don't understand where is the problem.

"error in remcor

could not calculate numerical derivatives

missing values encountered

(error occurred in ML computation)

(use trace option and check correctness of initial model)

(probabilities will be stored in p_21 p_22 p_23 p_24 p_25 p_26 p_27 p_28)

cannot compute posterior probabilities for more than 1 continuous latent variable

r(301)"

Here is the code

forvalues i=2/10 {

* starting value

eq idc1:a

eq idc2:b

*the model

gllamm resp a b aHGE bsp blp bcp bgmr blog_Gov bequity agdp aupop afert_rate adependratio amav, /*

*/ i(id) nocons eqs(idc1 idc2) nrf(2) link(ident ident) family(gauss gauss) from(a) /*

*/ lv(var) fv(var) nip(`i') ip(f) skip

* defining a matrix equal to

matrix a_`i'=e(b)

matrix a_=e(b)

matrix loglik_`i'=e(ll)

matrix np_`i' = colsof(a_`i')

*posteriod values

gllapred p_`i', p

*predicted value

gllapred bivpre_`i', linpred

gllasim y_`i'

gllapred locaz`i',u

matrix locs`i'=e(zlc2)'

matrix lp`i' = e(zps2)'

}

## Comment