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 <[email protected]>
To   "[email protected]" <[email protected]>
Subject   RE: st: how to store all estimates of a regression by group
Date   Sun, 23 Feb 2014 18:52:08 +0000

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: [email protected] [mailto:[email protected]] On Behalf Of Riccardo Valboni
Sent: domenica 23 febbraio 2014 19:39
To: [email protected]
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: [email protected] [mailto:[email protected]] 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 <[email protected]> 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: [email protected]
> [mailto:[email protected]] On Behalf Of Maarten
> Buis
> Sent: domenica 23 febbraio 2014 15:44
> To: [email protected]
> 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/


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