# What is the restricted equation of a test including three variables?

What is the restricted equation of a test including three variables?

On gretl i've been try to test manually by f test

$$y_t = B_1 + B_2x_2 + B_3x_3 + B_4x_4 + e_i$$

That

$$H_0: B_2 + B_3 = B_4$$ $$H_1: B_2 + B_3 \ne B_4$$

So do i want to make a new variable $w= B_2 + B_3 - B_4$

Then regress $$y_t = B_1 + B_2x_2 + B_3x_3 + wx_4 + e_i$$

or maybe $m= B_2 + B_3$ $$y_t = B_1 + B_2x_2 + B_3x_3 + mx_4 + e_i$$

But i can't seem to we get the restricted model right because i keep ending up with a zero or gretl not letting me regres like with m.

I'm always way off

• A generalization of this question to one-tailed tests of linear combinations of coefficients is given at stats.stackexchange.com/questions/180478/…. – whuber Nov 10 '15 at 14:41
• Woah whuber i'm just looking for the restricted equation – Ivan Nov 10 '15 at 14:42
• Then please edit your question, because currently it states that you want to test $H_0$ against $H_1$ using an $F$ test (which is exactly what the screen shots are doing). – whuber Nov 10 '15 at 14:45
• On the title tho "What is the restricted equation of a test including three variables?" – Ivan Nov 10 '15 at 14:46

$y = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_3 x_3 + \varepsilon$

and constraint:

$\beta_1 + \beta_2 = \beta_3$

We replace $\beta_3$ with the constraint

$y = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + (\beta_1 + \beta_2) x_3 + \varepsilon$

Write it out

$y = \beta_0 + \beta_1 x_1 + \beta_2 x_2 + \beta_1 x_3 + \beta_2 x_3 + \varepsilon$

Collect the $x$s that share the same parameter

$y = \beta_0 + \beta_1 (x_1 + x_3) + \beta_2 (x_2 + x_3) + \varepsilon$

Trying this out in my favourite statistics program (Stata) gives me these results:

. sysuse auto, clear
(1978 Automobile Data)

. constraint 1 _b[mpg] + _b[rep78] = _b[foreign]
. cnsreg price mpg rep78 foreign, constraint(1)

Constrained linear regression                   Number of obs     =         69
F(   2,     66)   =      11.58
Prob > F          =     0.0000
Root MSE          =  2543.3814

( 1)  mpg + rep78 - foreign = 0
------------------------------------------------------------------------------
price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
mpg |  -282.4264   58.67858    -4.81   0.000    -399.5819   -165.2708
rep78 |   656.5643   271.0772     2.42   0.018     115.3413    1197.787
foreign |   374.1379   246.6847     1.52   0.134     -118.384    866.6599
_cons |   9808.867   1192.953     8.22   0.000     7427.059    12190.68
------------------------------------------------------------------------------

. gen m1 = mpg + foreign
. gen m2 = rep78 + foreign
(5 missing values generated)

. reg price m1 m2

Source |       SS           df       MS      Number of obs   =        69
-------------+----------------------------------   F(2, 66)        =     11.58
Model |   149856884         2  74928441.8   Prob > F        =    0.0000
Residual |   426940075        66  6468789.02   R-squared       =    0.2598
Total |   576796959        68  8482308.22   Root MSE        =    2543.4

------------------------------------------------------------------------------
price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
m1 |  -282.4264   58.67858    -4.81   0.000    -399.5819   -165.2708
m2 |   656.5643   271.0772     2.42   0.018     115.3413    1197.787
_cons |   9808.867   1192.953     8.22   0.000     7427.059    12190.68
------------------------------------------------------------------------------

. lincom m1 + m2

( 1)  m1 + m2 = 0

------------------------------------------------------------------------------
price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
(1) |   374.1379   246.6847     1.52   0.134     -118.384    866.6599
------------------------------------------------------------------------------

• Thanks Maarten, that's basically to what i did on my out put. But applying the f-test formula got me an obscene number. Rather than 11.5158 – Ivan Nov 10 '15 at 8:57