Bookmark and Share

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: how to store all estimates of a regression by group


From   Riccardo Valboni <rvalboni@rsm.nl>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: how to store all estimates of a regression by group
Date   Sun, 23 Feb 2014 19:04:42 +0000

Got it again. I didn't know that, to denote one element of a local variable, I had to use two different apostrophes.

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Riccardo Valboni
Sent: domenica 23 febbraio 2014 19:52
To: statalist@hsphsun2.harvard.edu
Subject: RE: st: how to store all estimates of a regression by group

Got it. I was placing it after the fixed effect option of xtreg. But not it tells me that 'i' (enclosed in this way) is an invalid name. But I don't understand stata is saying this because the error is in the estimates store name or the error is in how I declared the if condition. My code is like this now. Can you tell me what's wrong?

levelsof abc, local(lev)

foreach i of local lev {
xtreg performance qualitya qualityb qualityc time if abc == `i', fe vce(robust)
    estimates store perf'i'
}

estimates dir


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Riccardo Valboni
Sent: domenica 23 febbraio 2014 19:39
To: statalist@hsphsun2.harvard.edu
Subject: RE: st: how to store all estimates of a regression by group

Roberto, thank you very mych for your answer. Your code doesn't work completely. Stata tells me at some point 'option if not allowed'. Are you sure it goes at the end of the line where the regression is specified?

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Roberto Ferrer
Sent: domenica 23 febbraio 2014 18:13
To: Stata Help
Subject: Re: st: how to store all estimates of a regression by group

Riccardo,

Another way:

*-------------------- begin code ---------------- clear all set more off

sysuse auto

levelsof foreign, local(lev)

foreach i of local lev {
    regress mpg weight displacement if foreign == `i'
    estimates store perf`i'
}

estimates dir

*------------------- end code --------------------


-foreign- would be your -group- variable.

On Sun, Feb 23, 2014 at 10:32 AM, Riccardo Valboni <rvalboni@rsm.nl> wrote:
> Dear Maarten,
>
> It did help, thank you very much. Using statsby I managed to run the regressions the way I wanted. The only drawback of statsby is that it gives back the results in a very strange format. I wanted to supply the coefficients and CI of the regressions to coefplot and estout but I am finding it very hard. Do you know if there is a way I can get these two packages recognize coefficients stored in a statsby table as regression coefficients?
>
> Thank you for your help.
> Riccardo
>
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Maarten
> Buis
> Sent: domenica 23 febbraio 2014 15:44
> To: statalist@hsphsun2.harvard.edu
> Subject: Re: st: how to store all estimates of a regression by group
>
> On Sun, Feb 23, 2014 at 11:24 AM, Riccardo Valboni wrote:
>> I am running a simple panel data regression with fixed effects. I am
>> running it by group using the following command
>>
>> by group: xtreg performance i.year i.type age size, fe
>>
>> estimates store perf1
>>
>> However, when I retrieve the estimates with estimates replay the stata gives back those for the last estimated group only. How can I get stata store and retrieve the coefficients for all groups? How can I then combine them in a unique table? Is estout suitable for this?
>
> See: -help statsby-.
>
> Hope this helps,
> Maarten
>
> ---------------------------------
> Maarten L. Buis
> WZB
> Reichpietschufer 50
> 10785 Berlin
> Germany
>
> http://www.maartenbuis.nl
> ---------------------------------
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
>
> Disclaimer
> ________________________________
> De informatie verzonden in dit e-mail bericht is vertrouwelijk en is
> uitsluitend bestemd voor de geadresseerde van dit bericht. Lees
> verder: www.eur.nl/email-disclaimer
> <http://www.eur.nl/email-disclaimer>
> The information in this e-mail message is confidential and may be
> legally privileged. Read more:
> www.eur.nl/english/email-disclaimer<http://www.eur.nl/english/email-di
> sclaimer>
> ________________________________
>
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

Disclaimer
________________________________
De informatie verzonden in dit e-mail bericht is vertrouwelijk en is uitsluitend bestemd voor de geadresseerde van dit bericht. Lees verder: www.eur.nl/email-disclaimer <http://www.eur.nl/email-disclaimer>
The information in this e-mail message is confidential and may be legally privileged. Read more: www.eur.nl/english/email-disclaimer<http://www.eur.nl/english/email-disclaimer>
________________________________


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

Disclaimer
________________________________
De informatie verzonden in dit e-mail bericht is vertrouwelijk en is uitsluitend bestemd voor de geadresseerde van dit bericht. Lees verder: www.eur.nl/email-disclaimer <http://www.eur.nl/email-disclaimer>
The information in this e-mail message is confidential and may be legally privileged. Read more: www.eur.nl/english/email-disclaimer<http://www.eur.nl/english/email-disclaimer>
________________________________


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

Disclaimer
________________________________
De informatie verzonden in dit e-mail bericht is vertrouwelijk en is uitsluitend bestemd voor de geadresseerde van dit bericht. Lees verder: www.eur.nl/email-disclaimer <http://www.eur.nl/email-disclaimer>
The information in this e-mail message is confidential and may be legally privileged. Read more: www.eur.nl/english/email-disclaimer<http://www.eur.nl/english/email-disclaimer>
________________________________


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index