Function Reference: regression_ftest

statistics: [h, pval, stats] = regression_ftest (y, x, fm)
statistics: […] = regression_ftest (y, x, fm, rm)
statistics: […] = regression_ftest (y, x, fm, rm, Name, Value)
statistics: […] = regression_ftest (y, x, fm, [], Name, Value)

F-test for General Linear Regression Analysis

Perform a general linear regression F test for the null hypothesis that the full model of the form y = b_0 + b_1 * x_1 + b_2 * x_2 + … + b_n * x_n + e, where n is the number of variables in x, does not perform better than a reduced model, such as y = b'_0 + b'_1 * x_1 + b'_2 * x_2 + … + b'_k * x_k + e, where k < n and it corresponds to the first k variables in x. Explanatory (dependent) variable y and response (independent) variables x must not contain any missing values (NaNs).

The full model, fm, must be a vector of length equal to the columns of x, in which case the constant term b_0 is assumed 0, or equal to the columns of x plus one, in which case the first element is the constant b_0.

The reduced model, rm, must include the constant term and a subset of the variables (columns) in x. If rm is not given, then a constant term b’_0 is assumed equal to the constant term, b_0, of the full model or 0, if the full model, fm, does not have a constant term. rm must be a vector or a scalar if only a constant term is passed into the function.

Name-Value pair arguments can be used to set statistical significance. "alpha" can be used to specify the significance level of the test (the default value is 0.05). If you want pass optional Name-Value pair without a reduced model, make sure that the latter is passed as an empty variable.

If h is 1 the null hypothesis is rejected, meaning that the full model explains the variance better than the restricted model. If h is 0, it can be assumed that the full model does NOT explain the variance any better than the restricted model.

The p-value (1 minus the CDF of this distribution at f) is returned in pval.

Under the null, the test statistic f follows an F distribution with ’df1’ and ’df2’ degrees of freedom, which are returned as fields in the stats structure along with the test’s F-statistic, ’fstat’

See also: regression_ttest, regress, regress_gp

Source Code: regression_ftest