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

Re: st: Gllamm errors

From   Eva Poen <>
To   Statalist <>
Subject   Re: st: Gllamm errors
Date   Mon, 20 Apr 2009 19:20:00 +0100


David emailed me privately. My comments are below.

2009/4/20  <>:
> Thanks for your response! Not sure if I am posting to the list now or not.
>>my first question is if this is exactly the model you want to estimate:
>>gllamm investmentStage2 investment, i(id) nrf(1) family(gauss)
>>If it is, there is no need to employ -gllamm-. This is a linear model,
>>and it can be estimated in Stata using -xtmixed-:
>>xtmixed investmentStage2 investment || id:
> No, it is just a starting point, I will be doing fancier stuff later. [By the way, what's the difference between the command you propose and the xtreg, re ?]

-xtmixed- can do a lot more than -xtreg-, and I thought you wouldn't
fire up -gllamm- for a simple linear RE regression. If you tell us
what "fancy stuff" you want to do, we might be able to recommend other
estimators for your problem.

>>Looking at your data, however, reveals that you have very few distinct
>>values in both the dependent and the independent variable. There may
>>be some alternatives to the linear model which suit your type of data
> Yes, these were contributions to a charity from within a lab.  There are upper and lower bounds, and it is discrete (only integer responses were allowed).  So Poisson may be the way to go.

This may explain the computational difficulties. These are complicated
models, and I can imagine that having only 5 or so levels of the
dependent variable doesn't make it easier to identify the model,
especially if your independent variable doesn't move around much
either. How many decisions do you have per subject?

>>If you insist on using -gllamm-, omit the option nrf(1). -gllamm-
>>automatically adds a random intercept for each nested level that you
>>specify in the i() option. This is how you get the "__000003 not
>>found" error.
> So, I try  "gllamm investmentStage2 investment, i(id) family(gauss) link(identity)" and I get the errors
> "lnf equal to missing in last step ... initial values not feasible ... (error occured in ML computation ... use trace option and check the correctness of initial model) "
> The same occurs when I start with the matrix generated by glammm ... init.

As I said, this error might occur due to computational difficulty
associated with your type of data. I would try to fit some simple
models outside -gllamm- first. Start with -xtreg- and -xtpoisson-, and
see how they converge. Then proceed to -gllamm- using
-xtreg-/-xtpoisson- results as starting values. Depending on what
"fancy stuff" you want to do, you might not even need to use -gllamm-.

If using -gllamm-, use the adapt option, or increase the number of
integration points with the nip() option; see the manual for details.

>>Good initial values are going to help -gllamm- to converge. However,
>>be aware that -gllamm- differs from some -xt- estimation commands in
>>Stata w.r.t. the scale of the parameters. E.g. -gllamm- wants
>>log(sigma) for its coefficient vector for the main equation, and not
> What is the sigma you refer to? Do you mean that we should log each coefficient? I don't think that's what you meant (I tried it and it did not work).

No, I mean the estimated standard error of the residuals in a linear
model, commonly referred to as sigma. -gllamm- estimates log(sigma)
when using family(gauss), while many Stata commands will give you
sigma. So make sure you convert it for your initial matrix. Also pay
attention to the order of coefficients in -gllamm- as the position of
log(sigma) may vary from the position of sigma in some Stata commands.
Search the archives for examples of how to get initial values for
gllamm from another command; there are some posts where this is


*   For searches and help try:

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