Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# RE: st: testing linear combination of means

 From "Rubil Ivica" To Subject RE: st: testing linear combination of means Date Thu, 22 Nov 2012 16:15:16 +0100

```Thanks, John.

--
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
irubil@eizg.hr || www.eizg.hr

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of John
Antonakis
Sent: 22. studeni 2012 14:52
To: statalist@hsphsun2.harvard.edu
Subject: Re: st: testing linear combination of means

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
__________________________________________

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
> irubil@eizg.hr || 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/

*
*   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/
```