help for ftest -------------------------------------------------------------------------------

Title

ftest -- compare two nested models using an F-test.

Syntax

ftest modelspec1 [modelspec2]

where modelspec is

name|.

where name is the name under which estimation results were saved using estimates store, and "." refers to the last estimation results, whether or not these were already stored.

Description

ftest compares two nested models estimated using regress and performs an F-test for the null hypothesis that the constraint implict in the restricted model holds. For example if a variable is left out of the restricted model, the implict constraint is that the coefficient for that variable equals zero. To conduct the test, both the unrestricted and the restricted models must be fitted using regress, and the results of at least one must be stored using estimates store.

modelspec1 and modelspec2 specify the restricted and unrestricted model in any order. If modelspec2 is not specified, the last estimation result is used; this is equivalent to specifying modelspec2 as a period (.).

Remarks

ftest is a convenience command; anything that can be done with ftest can be done with test, and it will produce exactly the same results. The difference is that with test the constraint needs to be explicitly specified, while with ftest the constraint is implicit. However, test will work with all vce types, while ftest will only work with the default vce type.

ftest requires that both models are estimated on exactly the same sample. This can easily be violated when the restricted model leaves a variable out that contains missing values. The solution is to use the if qualifier in regress when estimating the restricted model, see the Examples below.

Examples

Various ways specifying the models

sysuse auto, clear reg price mpg foreign est store a reg price mpg est store b ftest a b ftest a . ftest a

This test can also be performed using test

est restore a test foreign

this will cause an error because rep78 contains missing values

reg price mpg rep78 est store a reg price mpg est store b ftest a b

this is the solution

reg price mpg rep78 est store a reg price mpg if e(sample) est store b ftest a b

Author

Maarten L. Buis Vrije Universiteit Amsterdam Department of Social Research Methodology m.buis@fsw.vu.nl

Also see

Online: regress estimates test lrtest