Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Obtaining individual estimates after xtlogit

From   "Scott Merryman" <>
To   <>
Subject   st: Re: Obtaining individual estimates after xtlogit
Date   Tue, 22 Jul 2003 20:08:19 -0500

----- Original Message -----
From: "Lisa H. Green" <>
To: <>
Sent: Tuesday, July 22, 2003 12:05 PM
Subject: st: Obtaining individual estimates after xtlogit

> I would appreciate some guidance on how to obtain predicted values for
> each individual in my sample for each year of data, after running
> xtlogit (random effects). Specifically, my dataset has a cohort of
> individuals followed over 20 years and I would like to obtain
> individual predicted values for each person for each of the 20 years.
> I am able to do this in STATA 7 for my continuous variables with the
> following:
> .xtreg Y X, re i(ID)
> .predict varname
> .predict varname2, u
> Is there an equivalent approach for binary outcomes, as the "u" option
> is not allowed under xtlogit? So far I am only able to obtain
> population averages by year, but not for individuals (random effect)
> within each year.
> Thank you in advance for your help.
> Lisa Green

A similar question, dealing with -xtprobit- and predicting individual random
effects, was asked in April.   Sophia Rabe-Hesketh <>

"If your xtprobit command was

xtprobit y x1 x2, i(id) re,

you can estimate the model in gllamm using

gllamm y x1 x2, i(id) link(probit) fam(binom) adapt

Then use

predict res, u

to get empirical Bayes predictions of the random
effects. The posterior means will be stored in
resm1 and the posterior standard deviations in

The latest version of gllamm is available from SSC,
see also "

Hope this helps,

*   For searches and help try:

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