Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# st: xtmelogit variance estimates, conversion to MOR, inserting MORs into xtmelogit estimates, and then replacing them: a tale of two questions

 From Jamie Fagg To statalist@hsphsun2.harvard.edu Subject st: xtmelogit variance estimates, conversion to MOR, inserting MORs into xtmelogit estimates, and then replacing them: a tale of two questions Date Fri, 14 May 2010 15:28:55 +0100

```Dear all,

I've just been experimenting with esttab and the associated commands
(estadd, estpost etc) and using to tabulate some xtmelogit models that
I've fitted in Stata 10. I've got a number of queries.

First, considering the variance estimates from the following three
level logistic variance components model :

Random-effects Parameters  |   Estimate   Std. Err.     [95% Conf. Interval]
-----------------------------+------------------------------------------------
neigh: Identity       |
var(_cons) |    .579824   .1686844      .3278398    1.025488
-----------------------------+------------------------------------------------
pid: Identity                |
var(_cons) |    2.55512   .3073848      2.018415    3.234537

I'd like to use the estimates to make a table which includes the
median odds ratio (MOR). Drawing on Sophia Rabe Hesketh and Anders
between-individual (pid) MOR and between-neighbourhood (neigh) MOR to
the variance components model estimates using the following:

estadd scalar bimor =   exp(sqrt(2*(0.58+2.56))*invnormal(3/4)), :BYPVarComp2
estadd scalar bnmor = exp(sqrt(2*(0.58))*invnormal(3/4)), :BYPVarComp2

I can then display the estimates using esttab

esttab BYPVarComp2, stats(bimor bnmor)

What I'd like to do now is not have to rely on automatically adding in
the variance estimates (0.58 and 2.56 in this case) to these
statements. So question 1 is, how would I retrieve the estimates for
var(_cons) from xtmelogit (I couldn't see them in the list at the end

Once I've added the scalars (i.e. bamor or bnmor) to the xtmelogit
estimates, I cannot then replace or delete them. So question 2 is, how
would I go about replacing them if I make a mistake in the
calculations?