<< Regression Regression criterionAkaike >>

stixbox >> stixbox > Regression > cmpmod

cmpmod

Compare linear submodel versus larger one

Calling Sequence

[z,p] = cmpmod(Y, Xsub, X)

Parameters

Y :

a m-by-1 matrix of doubles, the dependent variates vector

Xsub :

a m-by-n1 matrix of doubles, controlled variates "X" matrix for the submodel

X :

a m-by-n2 matrix of doubles, controlled variates "X" matrix for the model

z :

a double, the F-test statistic value

p :

a double, the p-value Prob(F variate > z)

Description

Compare linear submodel versus larger one. The cmpmod function computes the F-test of a linear model against a smaller one.

If the two models are very different, then the F-statistic is large, leading to a p-value close to 0. If the two models are similar, then the F-statistic is small, leading to a p-value close to 1.

Examples

// Longley.dat
[data,txt] = getdata(24);
Y=data(:,1);
X=data(:,2:7);
m=size(X,"r");
X=[ones(m,1),X];
// Create sub-model, close to the full model
Xsub=X(:,[1,2,3,4,5,7]);
[z,p] = cmpmod(Y, Xsub, X)
// Create sub-model, far away from the full model
Xsub=X(:,[1,3,5,7]);
[z,p] = cmpmod(Y, Xsub, X)

See also

Authors


Report an issue
<< Regression Regression criterionAkaike >>