help for

ftest-------------------------------------------------------------------------------

Title

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

Syntax

ftestmodelspec1[modelspec2]where

modelspecis

name|.where

nameis the name under which estimation results were saved usingestimates store, and "." refers to the last estimation results, whether or not these were already stored.

Description

ftestcompares two nested models estimated usingregressand 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 usingregress, and the results of at least one must be stored usingestimates store.

modelspec1andmodelspec2specify the restricted and unrestricted model in any order. Ifmodelspec2is not specified, the last estimation result is used; this is equivalent to specifyingmodelspec2as a period (.).

Remarks

ftestis a convenience command; anything that can be done withftestcan be done withtest, 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,testwill work with all vce types, whileftestwill only work with the default vce type.

ftestrequires 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 inregresswhen estimating the restricted model, see the Examples below.

Examples

Various ways specifying the modelssysuse 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 usingtestest restore a test foreign

this will cause an error because rep78 contains missing valuesreg price mpg rep78 est store a reg price mpg est store b ftest a b

this is the solutionreg price mpg rep78 est store a reg price mpg if e(sample) est store b ftest a b

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

Also seeOnline:

regressestimatestestlrtest