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: Naming Equations in Stata


From   Ian Li <ian.li@uwa.edu.au>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Naming Equations in Stata
Date   Wed, 21 Sep 2011 13:08:31 +0800

Hi Partho,

thanks, that FAQ helped a bit. 

I should clarify a little. The 4 samples I referred to were sub-samples of my dataset. So in effect, suppose I am trying to estimate the same model for four age groups, I would enter the code as:

reg y x1 x2 x3 if agegroup == 1
reg y x1 x2 x3 if agegroup == 2
reg y x1 x2 x3 if agegroup == 3
reg y x1 x2 x3 if agegroup == 4

How should I test for the equality of the X1s across the four estimations? The FAQ you posted helps, but it would be much simpler and straightforward if I could understand how to use the -test- function properly. To do that, it would be desirable if anyone could advise on how equations are named in Stata, or what the proper syntax is for the -test- function. 

Regards
Ian
________________________________________
From: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] On Behalf Of Partho Sarkar [partho.ss+lists@gmail.com]
Sent: Wednesday, September 21, 2011 12:54 PM
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: Naming Equations in Stata

Maybe this FAQ article would help:

http://www.stata.com/support/faqs/stat/testing.html




On Wed, Sep 21, 2011 at 9:50 AM, Ian Li <ian.li@uwa.edu.au> wrote:
> Dear Statalisters,
>
> I am running an OLS regression across four different samples. The estimating equation is exactly the same for all the samples, for example, I run:
>
> y = a+b1X1+b2X2+e
>
> I would like to run an F-test to determine if the estimated beta coefficient b1 in the first sample is equal to b1 in the second sample, and so on for all four samples. I understand that this can be done using syntax 4 in the -test- function. The syntax is given as:
>
> test [eqno=eqno[=...]] [: coeflist]      (Syntax 4)
>
> where eqno is the name of the equation. However, the help file does not describe how equations are named in Stata.
>
> The Statalist archive shows that this question has been posed before, see:
>
> http://www.stata.com/statalist/archive/2010-09/msg01294.html
>
> The solution given was to use the -sureg- function (seemingly unrelated regression). However, I do not think that this gives me what I want, as the vce (robust) function is not compatible with -sureg- (which I would like to use), and does not seem appropriate given that all I want is to test the equality of coefficients across equations. The Statalister who posted the original questions also did not indicate if the solution was adequate and gave her what she wanted.
>
> Would anyone be able to suggest how I can name equations in Stata, or an alternative way to get this F-test done, or how -sureg- is appropriate for my needs?
>
> Regards
> Ian
> *
> *   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/


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