Statalist


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

Re: st: Predicting Random Effects from a Crossed-Level Model using xtmelogit


From   [email protected] (Roberto G. Gutierrez, StataCorp)
To   [email protected]
Subject   Re: st: Predicting Random Effects from a Crossed-Level Model using xtmelogit
Date   Tue, 29 Dec 2009 09:09:40 -0600

Albert Lee <[email protected]> asks:

> I'm estimating a logistic model with crossed-level random effects.  The
> outcome binary variable is fail with one fixed-effect independent binary
> variable refinance.  The three crossed-level random effects are VAR1, VAR2
> and VAR3.  The STATA command I u sed is as below:

> xtmelogit fail refinance || _all:R.VAR1 || _all:R.VAR2 || _all:R.VAR3 

> After estimating this model, I tried to recover the random effects of VAR3
> using:

> predict u, reffects level(VAR3)

> However, u only contains missing values.

> I would very much appreciate if someone can help me recovering these
> predicted random effects.

As pointed out by Joseph Coveney <[email protected]> on another post in
this thread, Albert's syntax above is incorrect because there is no "VAR3"
level in the model, but instead only one overall "_all:" level.  As such, to
recover the random effects for the levels of -VAR3-, type

   . predict u1 u2 u3, reffects 

Given the order of the terms in the model, variable -u3- will contain the
random effects for -VAR3-.

That said, it is curious that what you typed produced missing values for -u-
instead of a syntax error, as my attempts at reproducing this produce gave the
expected syntax error.  If Albert can send me his data and a do file that
reproduces the missing values for -u-, I'll be glad to take a closer look.

--Bobby
[email protected]
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index