# Score

Score computes the score test for transformation

## Syntax

• outSC=Score(y,X)example
• outSC=Score(y,X,Name,Value)example

## Description

 outSC =Score(y, X) Score with all default options.

 outSC =Score(y, X, Name, Value) Score with optional arguments.

## Examples

expand all

### Score with all default options.

Wool data.

XX=load('wool.txt');
y=XX(:,end);
X=XX(:,1:end-1);
% Score test using the five most common values of lambda
[outSC]=Score(y,X);
disp('Values of the score test')
disp({'la=-1' 'la=-0.5' 'la=0' 'la=0.5' 'la=1'})
disp(outSC.Score')
Values of the score test
{'la=-1'}    {'la=-0.5'}    {'la=0'}    {'la=0.5'}    {'la=1'}

17.7059    7.4927   -0.9122   -9.5511  -18.5576



### Score with optional arguments.

Loyalty cards data.

load('loyalty.txt');
y=loyalty(:,4);
X=loyalty(:,1:3);
% la = vector containing the values of the transformation
% parameters which have to be tested
la=[0.25 1/3 0.4 0.5];
[outSc]=Score(y,X,'la',la,'intercept',0);

## Input Arguments

### y — Response variable. Vector.

A vector with n elements that contains the response variable. It can be either a row or a column vector.

Data Types: single| double

### X — Predictor variables. Matrix.

Data matrix of explanatory variables (also called 'regressors') of dimension (n x p-1). Rows of X represent observations, and columns represent variables.

Missing values (NaN's) and infinite values (Inf's) are allowed, since observations (rows) with missing or infinite values will automatically be excluded from the computations.

Data Types: single| double

### Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as  Name1,Value1,...,NameN,ValueN.

Example:  'intercept',false , 'la',[0 0.5] , 'Lik',0 , 'nocheck',1 

### intercept —Indicator for constant term.true (default) | false.

Indicator for the constant term (intercept) in the fit, specified as the comma-separated pair consisting of 'Intercept' and either true to include or false to remove the constant term from the model.

Example:  'intercept',false 

Data Types: boolean

### la —transformation parameter.vector.

It specifies for which values of the transformation parameter it is necessary to compute the score test.

Default value of lambda is la=[-1 -0.5 0 0.5 1]; that is the five most common values of lambda

Example:  'la',[0 0.5] 

Data Types: double

### Lik —likelihood for the augmented model.scalar.

If 1 the value of the likelihood for the augmented model will be produced else (default) only the value of the score test will be given

Example:  'Lik',0 

Data Types: double

### nocheck —Check input arguments.scalar.

If nocheck is equal to 1 no check is performed on matrix y and matrix X. Notice that y and X are left unchanged. In other words the additional column of ones for the intercept is not added. As default nocheck=0.

Example:  'nocheck',1 

Data Types: double

## Output Arguments

### outSC — description Structure

containing the following fields:

Value Description
Score

score test. Vector. Vector of length length(lambda) which contains the value of the score test for each value of lambda specfied in optional input parameter la. If la is not specified, the vector will be of length 5 and contains the values of the score test for the 5 most common values of lambda.

Lik

value of the likelihood. Scalar. This output is produced only if input value Lik =1

## References

Atkinson, A.C. and Riani, M. (2000), "Robust Diagnostic Regression Analysis", Springer Verlag, New York. [see equation 2.30 for the expression for score test statistic]