Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
AW: st: xtprobit clustered standard errors or gllamm
From
<[email protected]>
To
<[email protected]>
Subject
AW: st: xtprobit clustered standard errors or gllamm
Date
Mon, 27 Aug 2012 16:05:38 +0100
-xtprobit- doesn't allow computation of clustered SEs by any method
(even though there is a suggestion somewhere in the manual -- not to
hand -- that bootstrap SEs are possible).
So, you'll have to use -gllamm- (on SSC). Because of long estimation
times with -gllamm-, I recommend that you first estimate your model with
-xtprobit-, and then use the estimated parameters as starting values for
-gllamm-, that is using and manipulating saved matrix e(b). Note that
-gllamm- and -xtprobit- report the random effects variance in different
metrics: the former uses the variance of the RE; the latter uses the log
of the standard deviation of the RE (if I recall correctly). So, before
using -gllamm-'s from() option, you need to rename the column of the
starting values vector that corresponds to the RE (to the name that
-gllamm- expects), and also transform -xtprobit-'s estimate of the log
of the SD of the RE.
Example of code from my own work follows below. Note that the "cluster"
variable in my case is called "pid", so you'll need to change some names
in your own application appropriately:
mat b = e(b) // derived from -xtprobit-
mat li b
matrix b[rownumb(b,"y1"), colnumb(b,"lnsig2u:_cons")] = sqrt( exp(
_b[lnsig2u:_cons]) )
mat li b
local n: colfullnames b
di "`n'"
local nnames : word count `n'
local last : word `nnames' of `n'
local n : subinstr local n "`last'" "pid1:_cons"
matrix colnames b = `n'
mat li b
di "`c(current_time)' on `c(current_date)'"
gllamm bu_SA $ind_var $bu_var $waves ///
Lbu_SA $ind_var1 $bu_var1 $interw ///
$avgetvar2 bu_SA_1 if wave > wavefirst, i(pid) adapt
from(b) family(binomial) link(probit)
di "`c(current_time)' on `c(current_date)'"
mat list e(b)
------------------------------
Date: Thu, 23 Aug 2012 16:13:11 +0200
From: "Petra Nieken" <[email protected]>
Subject: AW: st: xtprobit clustered standard errors or gllamm
Dear Gordon,
thank you so much for your help. However, vce(bootstrap) does not allow
me
to declare a cluster when using xtprobit. Do you think gllamm would be a
better solution?
Kind regards,
Petra
===================
Please access the attached hyperlink for an important electronic communications disclaimer: http://lse.ac.uk/emailDisclaimer
*
* 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/