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]
RE: st: suest equivalent for areg.
From
Nick Cox <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
RE: st: suest equivalent for areg.
Date
Fri, 20 May 2011 18:09:54 +0100
I don't have any positive suggestions of how to continue in your intended path, as my understanding is that the way ahead is blocked. But what precisely is the main statistical problem here? It seems that you want to compare the merits of a model predicting A from B and of one predicting A from C. In most statistical contexts, it seems easiest to do that directly by comparing three models, with predictors B alone, C alone and B and C together. In other words, if the problem is that -suest- won't play, then one answer is to do without that altogether.
Nick
[email protected]
Gupta, Sumedha
Thank you for your reply but I am running into exactly the problem you anticipated. Suest doesn't allow areg and xtreg and running ols with individual dummies is not an option with svy as that does not allow vce (cluster id).
Does anybody else have any thoughts on this please?
Jorge Eduardo Pérez Pérez [[email protected]]
As -xtreg- will not work with -suest- either, the only workaround that
comes to mind is to use ols with dummy variables. This might not be
computationaly feasible if you have too many individuals. See the code
below. It works with the caveat that -suest- requires the models to be
estimated with iweights and the constants obtained are different from
the -areg- case, but the coefficients on the independent variables are
the same.
I don't know if this approach produces correct standard errors due to
your survey data structure. Notice that suest does not allow the use
of -cluster- and -svy- at the same time. Maybe someone else on the
list can provide more information on this matter.
clear
set seed 20
set matsize 1000
webuse nlswork
keep if id<500
xtset idcode
gen w=uniform()
bys id: replace w=w[1]
xi i.occ i.ind i.id
areg age _Iocc* if south==1 [pweight=w], absorb (id) vce(cluster id)
areg age _Iind* if south==1 [pweight=w], absorb (id) vce(cluster id)
qui eststo R1: reg age _Iocc* _Iid* [iw=w] if south==1
unab a: _Iocc*
est tab, b se keep(`a' _cons)
qui eststo R2: reg age _Iind* _Iid* [iw=w] if south==1
unab b: _Iind*
est tab, b se keep (`b' _cons)
qui suest R1 R2, vce(cluster id)
est tab, b se keep(`a' `b' R1_mean:_cons R2_mean:_cons)
_______________________
On Wed, May 18, 2011 at 3:13 PM, Gupta, Sumedha <[email protected]> wrote:
> I am trying to estimate a linear fixed effects model with survey data. Post estimation I want to use esttab to make my tables. I try the following code (sorry for not using the standard data code for this):
>
> . quietly eststo R1: xi: areg A B if subpop1==1 [pweight=wt], absorb (id) vce(cluster id)
>
> . quietly eststo R2: xi: areg A C if subpop1==1 [pweight=wt], absorb (id) vce(cluster id)
>
> . quietly suest R1 R2
>
> But then I get the following error message:
>
> areg is not supported by suest
> r(322);
>
> Can somebody please advise me on a way around this?
*
* 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/