Score computes the score test for Box-Cox transformation
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
Loyalty cards data.
load('loyalty.txt');
y=loyalty(:,4);
X=loyalty(:,1:3);
% la = vector containing the values of the transformation
% parameters that have to be tested.
la=[0.25 1/3 0.4 0.5];
[outSc]=Score(y,X,'la',la,'intercept',false);
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
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
.
'intercept',false
, 'la',[0 0.5]
, 'Lik',false
, 'nocheck',true
, 'tukey1df',true
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.boolean.If true 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',false
Data Types: logical
nocheck
—Check input arguments.boolean.If nocheck is equal to true 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=false.
Example: 'nocheck',true
Data Types: boolean
tukey1df
—Tukey's one df test.boolean.Tukey's one degree of freedome test for non-additivity.
The constructed variable is given by
where z(\lambda) is the transformed response, and \hat z(\lambda) are the fitted values on the transformed response. The t test on the constructed variable above provides a test from departures from the assumed linear model and is known in the literature as Tukey's one degree of freedome test for non-additivity.
If tukey1df is true the test is computed and returned inside output structure with fieldname ScoreT else (default) the value of the test is not computed.
Example: 'tukey1df',true
Data Types: boolean
outSC
— description
StructureContaining 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 specified 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. |
ScoreT |
value of the Tukey's one degree of freedome test for non-additivity. Scalar. This output is produced only if optional input tukey1df is true. |
Lik |
value of the likelihood. Scalar. This output is produced only if optional input Lik=1. |
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]
FSRfan
|
ScoreYJ
|
ScoreYJpn
|
normBoxCox
|
normYJ