Briefly, let

be an

matrix with element

, where the indicator function

takes the value one if observation

belongs to group

with

, and zero otherwise (we drop the columns for the groups with

to avoid singularity). Let

be the

matrix of the contributions to the score

. The Andrews test statistic is

times the

from regressing a constant (one) on each column of

and

. Under the null hypothesis that the model is correctly specified,

is asymptotically distributed

with

degrees of freedom.