Statalist


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

Re: st: Gllamm errors


From   Eva Poen <eva.poen@gmail.com>
To   Statalist <statalist@hsphsun2.harvard.edu>
Subject   Re: st: Gllamm errors
Date   Fri, 17 Apr 2009 21:55:26 +0100

<>

David,

my first question is if this is exactly the model you want to estimate:

gllamm investmentStage2 investment, i(id) nrf(1) family(gauss) link(identity)

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:

For the linear model (family(gauss) link(identity)), -xtmixed- is the
way to go. It can handle random coefficients and slopes in nested and
crossed designs. See -help xtmixed-.

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
better.


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.

Also, I can't see how the adoonly option will do any good. It is very
likely to slow -gllamm- down.

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
sigma. With the initial values for random effects, it gets even more
complicated (the estimated parameters are the individual elements of
the cholesky decomposition of the variance-covariance matrix for the
random effects). If you put together a matrix for the initial values,
you also need to specify the copy option.

The excellent manual for -gllamm-, which you can download from the
web, has many worked examples for you to look at.

Hope this helps,
Eva



2009/4/17 david reinstein <daaronr@gmail.com>:
> OK, I now figured out I may not have been using the most recent
> version of Glamm. But with the newest version I still have problems.
>
> When I start off with a command such as:
> gllamm investmentStage2 investment, i(id) adapt adoonly trace
> ... I get the error "junk not found."
>
> I can get it to run successfully with the "init" option:
> gllamm investmentStage2 investment, i(id) nrf(1) family(gauss)
> link(identity) nip(4) trace init
> ...but this just yields the results of the simple OLS regression: (reg
> investmentStage2 investment_
>
> So, I try to use these initial values to get further, and I get
> another  "not found" error:
> . mat init=e(b)
> . gllamm investmentStage2 investment, i(id) from(init) adoonly trace
>
> General model information
> ------------------------------------------------------------------------------
> dependent variable:         investmentStage2
> family:                     gauss
> link:                       ident
> equation for fixed effects  investment _cons
> Random effects information for 2 level model
> ------------------------------------------------------------------------------
>
> ***level 1 equation:
>   log standard deviation
>   lns1: _cons
>
> ***level 2 (id) equation(s):
>   standard deviation of random effect
>   id1: _cons
> __000003 not found
> r(111);
>
> If I try it slightly differently:
> gllamm investmentStage2 investment, i(id) from(init) trace
> ...I get
> "
> there are 0 values of likelihood, should be 150 ...
> lnf equal to missing in last step ... initial values not feasible ...
> (error occurred in ML computation) ... (use trace option and check
> correctness of initial model)"
>
> gllamm investmentStage2 investment, i(id) from(init) adapt trace
> ... yields "junk not found" again.
>
> Any thoughts? I have been spending hours just to try to get Gllamm to
> run somehow (to analyse experimental economic data)!
>
> Thanks for your help.
> Once again, a list of some of the data follows.
> -David
>
> . list  id investment  investmentStage2  in 1/20
>
>     +---------------------------+
>     |  id   invest~t   invest~2 |
>     |---------------------------|
>  1. | 201          3          2 |
>  2. | 201          2          0 |
>  3. | 201          1          3 |
>  4. | 201          2          2 |
>  5. | 201          0          1 |
>     |---------------------------|
>  6. | 201          2          2 |
>  7. | 201          3          4 |
>  8. | 201          4          4 |
>  9. | 201          0          3 |
>  10. | 201          0          2 |
>     |---------------------------|
>  11. | 201          3          1 |
>  12. | 201          0          2 |
>  13. | 201          2          5 |
>  14. | 201          0          2 |
>  15. | 201          3          1 |
>     |---------------------------|
>  16. | 202          2          2 |
>  17. | 202          2          5 |
>  18. | 202          2          4 |
>  19. | 202          0          4 |
>  20. | 202          1          5 |
>     +---------------------------+

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index