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: testing linear combination of means


From   John Antonakis <[email protected]>
To   [email protected]
Subject   Re: st: testing linear combination of means
Date   Thu, 22 Nov 2012 14:51:57 +0100

Hi:

This should be relatively straightforward.

Run this code to give you an idea of what to do:

clear
set seed 123
set obs 1000

*generate y1-y4
foreach var of newlist y1-y4 {
gen `var'= 10 + rnormal()
}

*repeated regressions to estimate intercept (mean)
foreach var of varlist y1-y4 {
reg `var'
est store `var'
}
*combine estimators with suest
suest y1 y2 y3 y4

*the test you are looking for
test 0.5*([y1_mean]_cons - [y2_mean]_cons) - 0.5*([y3_mean]_cons -[y4_mean]_cons) = 0

which in this case gives:

( 1) .5*[y1_mean]_cons - .5*[y2_mean]_cons - .5*[y3_mean]_cons + .5*[y4_mean]_cons = 0

           chi2(  1) =    0.01
         Prob > chi2 =    0.9069

HTH,
John.

__________________________________________

Prof. John Antonakis
Faculty of Business and Economics
Department of Organizational Behavior
University of Lausanne
Internef #618
CH-1015 Lausanne-Dorigny
Switzerland
Tel ++41 (0)21 692-3438
Fax ++41 (0)21 692-3305
http://www.hec.unil.ch/people/jantonakis

Associate Editor
The Leadership Quarterly
__________________________________________

On 22.11.2012 14:23, Rubil Ivica wrote:
> Dear Statalist members:
>
> Suppose there are four variables: var1, var2, var3, var4. I need to test
> whether
>
> 0.5 * [mean(var1) - mean(var2)] - 0.5 * [mean(var3) - mean(var4)]
>
> is significantly different from zero.
>
> Is there any idea how to perform the test?
>
> Thanks in advance,
> Ivica
>
>
>
>
>
>
>
>
>
> --
> Ivica Rubil
> Ekonomski institut || The Institute of Economics, Zagreb
> Trg J. F. Kennedyja 7, 10 000 Zagreb, Croatia
> tel. +385-1-2362-269 || fax. +385-1-2335-165
> [email protected] || www.eizg.hr
>
>
> *
> *   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/


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