Note: This page has been translated by MathWorks. Please click here

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

`p = coefTest(mdl)`

p = coefTest(mdl,H)

p = coefTest(mdl,H,C)

[p,F] =
coefTest(mdl,___)

[p,F,r]
= coefTest(mdl,___)

computes
the `p`

= coefTest(`mdl`

)*p*-value for an *F* test that
all coefficient estimates in `mdl`

are zero, except
for the intercept term.

performs
an `p`

= coefTest(`mdl`

,`H`

)*F* test that *H* × *B* =
0, where *B* represents the
coefficient vector.

performs
an `p`

= coefTest(`mdl`

,`H`

,`C`

)*F* test that *H* × *B* = *C*.

`[`

returns
the `p`

,`F`

] =
coefTest(`mdl`

,___)*F* test statistic, `F`

, using
any of the previous syntaxes.

`[`

returns
the numerator degrees of freedom, `p`

,`F`

,`r`

]
= coefTest(`mdl`

,___)`r`

, for the
test.

The *p*-value, *F* statistic,
and numerator degrees of freedom are valid under these assumptions:

The data comes from a model represented by the formula

`mdl`

`.Formula`

.The observations are independent conditional on the predictor values.

Suppose these assumptions hold. Let *β* represent
the (unknown) coefficient vector of the linear regression. Suppose *H* is
a full-rank matrix of size *r*-by-*s*,
where *s* is the number of terms in *β*.
Let *v* be a vector the same size as *β*.
The following is a test statistic for the hypothesis that *Hβ* = *v*:

$$F={\left(H\widehat{\beta}-v\right)}^{\prime}{\left(HC{H}^{\prime}\right)}^{-1}\left(H\widehat{\beta}-v\right).$$

Here $$\widehat{\beta}$$ is the estimate of the coefficient
vector *β* in `mdl.Coefs`

,
and *C* is the estimated covariance of the coefficient
estimates in `mdl.CoefCov`

. When the hypothesis is
true, the test statistic *F* has an F Distribution with *r* and *u* degrees
of freedom.

The values of commonly used test statistics are available in
the `mdl.Coefficients`

table.

`anova`

provides
a test for each model term.

Was this topic helpful?