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]

AW: st: SUREG: Testing sum of coefficients


From   "Martin Weiss" <martin.weiss1@gmx.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   AW: st: SUREG: Testing sum of coefficients
Date   Thu, 25 Feb 2010 09:26:11 +0100

<> 

" is there a way to loop them since I have 88 equations with the same
variable?"

Sure you can:


*************
sysuse auto, clear

sureg (price foreign weight length turn) ///
     (mpg foreign weight length turn)          ///
      (displacement foreign weight length turn)
         
foreach var of varlist foreign weight length turn{
	di in r "Now at: `var'"
	te _b[price:`var']+_b[mpg:`var']+_b[displacement:`var']=0
}      
      
//all jointly   
te [price=mpg=displacement], common
*************



HTH
Martin


-----Ursprüngliche Nachricht-----
Von: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von mai7777
Gesendet: Donnerstag, 25. Februar 2010 07:24
An: statalist@hsphsun2.harvard.edu
Betreff: Re: st: SUREG: Testing sum of coefficients

Brilliant, many thanks!
is there a way to loop them since I have 88 equations with the same
variable?


On Thu, Feb 25, 2010 at 1:12 AM, Maarten buis <maartenbuis@yahoo.co.uk>
wrote:
> --- On Thu, 25/2/10, mai7777 wrote:
>> I'm running a SUREG, and in addition to testing that the
>> coefficients are jointly equal to zero, I want to test
>> that the sum of the coefficients on the same variable
>> across all the equations in the system is equal to zero.
>
> *------------------------ begin example ------------------------
> sysuse auto, clear
> sureg (price foreign weight length) ///
>      (mpg foreign weight)          ///
>          (displacement foreign weight)
> test _b[price:foreign]+_b[mpg:foreign]+_b[displacement:foreign]=0
> *-------------------------- end example -------------------------
> ( For more on how to use examples I sent to statalist see:
>  http://www.maartenbuis.nl/stata/exampleFAQ.html )
>
> Hope this helps,
> Maarten
>
> --------------------------
> Maarten L. Buis
> Institut fuer Soziologie
> Universitaet Tuebingen
> Wilhelmstrasse 36
> 72074 Tuebingen
> Germany
>
> http://www.maartenbuis.nl
> --------------------------
>
>
>
>
> *
> *   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