Bookmark and Share

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


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

RE: st: suest equivalent for areg.


From   "Schaffer, Mark E" <M.E.Schaffer@hw.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: suest equivalent for areg.
Date   Fri, 20 May 2011 21:32:30 +0100

Sumedha,

Why not partial out the fixed effects by hand and then use -regress-?  An easy way to do this is with Ben Jann's -center- command.  Then do your estimations on the transformed data.

If you're planning on using -suest-, you'll probably need to use the undocumented -dof- option of -regress- when you do your estimations before invoking -suest-.  This is because you will have to tell -regress- that you've lost X degrees of freedom because of the X individual effects.  The syntax is easy, e.g.,

regress y x1 x2, dof(25)

tells -regress- that there are 25 degrees of freedom, i.e., the macro e(df_r) will have 25 in it.

HTH,
Mark

> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu 
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of 
> Gupta, Sumedha
> Sent: 20 May 2011 17:34
> To: statalist@hsphsun2.harvard.edu
> Subject: RE: st: suest equivalent for areg.
> 
> Hi Jorge,
> 
> 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? 
> 
> Many thanks.
> Sumedha.
> 
> 
> ________________________________________
> From: owner-statalist@hsphsun2.harvard.edu 
> [owner-statalist@hsphsun2.harvard.edu] on behalf of Jorge 
> Eduardo Pérez Pérez [perez.jorge@ur.edu.co]
> Sent: Wednesday, May 18, 2011 5:52 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: suest equivalent for areg.
> 
> 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)
> 
> _______________________
> Jorge Eduardo Pérez Pérez
> 
> 
> 
> 
> On Wed, May 18, 2011 at 3:13 PM, Gupta, Sumedha 
> <sugupta@iupui.edu> wrote:
> > Dear All,
> >
> > 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?
> >
> > Many thanks.
> > Sumedha.
> >
> >
> >
> >
> >
> >
> >
> >
> > *
> > *   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/
> >
> 
> *
> *   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/
> 
> *
> *   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/
> 


-- 
Heriot-Watt University is a Scottish charity
registered under charity number SC000278.


*
*   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/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index