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

Re: st: RE: Shrinkage factor

From   Evans Jadotte <>
Subject   Re: st: RE: Shrinkage factor
Date   Thu, 15 Oct 2009 15:34:12 +0200

Hi Maarten,
I am probably having some syntax problem in Stata to get around this issue. My original estimation is:

. xi: quietly xtmixed  logequiv $vul_list ||strata: ||cluster:, var

. matrix list e(b)

*Output for the random part is as follows:

        lns1_1_1:      lns2_1_1:       lnsig_e:
           _cons          _cons          _cons
y1     -.92050985     -.61957299      .01258646

*So, I believe the the way to get the shrinkage factor per number of cases is:

. local Rjs=[lns1_1_1]_cons^2/([lns1_1_1]_cons^2+exp([lnsig_e]_cons)^2/nj)

* All seem clear, except the nj (unbalanced). Trying to way you suggested, I am not sure which variables the vars (neither the ids) stand for since what I got is the following message

. gen miss = missing(lns1_1_1, lns2_1_1, lnsig_e)
lnsig_e not found

Any additional help would be much appreciated.

Thanks a lot,


Maarten buis wrote:
--- On Thu, 15/10/09, Evans Jadotte wrote:
In fact, this is the formula I have. My problem is the
malleability of n_j. Since I have 496 clusters at level-2
with many unbalanced observations within each cluster, the
manual calculation can make one go crazy!

Getting those number of cases in unbalanced pannels is relatively easy when using -bys-:

gen miss = missing(var1, var2, var3)
bys miss id1 id2 id3: gen long nj = _N if miss == 0

Hope this helps,

Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen

Send instant messages to your online friends
*   For searches and help try:

*   For searches and help try:

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