| scoreYJ | R Documentation |
Computes the score test for Yeo and Johnson transformation
scoreYJ(
x,
y,
intercept = TRUE,
la = c(-1, -0.5, 0, 0.5, 1),
lik = FALSE,
nocheck = FALSE,
tukey1df = FALSE,
trace = FALSE,
...
)
x |
An Missing values (NA's) and infinite values (Inf's) are allowed, since observations (rows) with missing or infinite values will automatically be excluded from the computations. |
y |
Response variable. A vector with |
intercept |
wheather to use constant term (default is |
la |
values of the transformation parameter for which it is necessary
to compute the score test. Default value of lambda is
|
lik |
likelihood for the augmented model. If true the value of the likelihood for the augmented model will be calculated and returend otherwise (default) only the value of the score test will be given |
nocheck |
Whether to check input arguments. If |
tukey1df |
Tukey's one degree of freedome test for non-additivity. The constructed variable is given by
where |
trace |
Whether to print intermediate results. Default is |
... |
potential further arguments passed to lower level functions. |
An S3 object of class scoreYJ.object will be returned which is basically a list
containing the following elements:
Score: score test. A vector of length length(lambda) which
contains the value of the score test for each value of lambda specified
in the 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. This output is produced only if tukey1df=TRUE.
Lik: value of the likelihood. This output is produced only if lik=TRUE.
FSDA team, valentin.todorov@chello.at
Yeo, I.K. and Johnson, R. (2000), A new family of power transformations to improve normality or symmetry, "Biometrika", Vol. 87, pp. 954-959.
## Not run:
## ScoreYJ with all default options for the wool data.
## Load the wool data.
data(wool)
XX <- wool
y <- XX[, ncol(XX)]
X <- XX[, 1:(ncol(XX)-1), drop=FALSE]
(out <- scoreYJ(X, y)) # call 'scoreYJ' with all default parameters
(out <- scoreYJ(X, y, lik=TRUE)) # return the likelihood
data(loyalty)
head(loyalty)
y=loyalty[, 4]
X=loyalty[, 1:3]
## la is a vector containing the values of \lambda which have to be tested
(out <- scoreYJ(X, y, la=c(0.25, 1/3, 0.4, 0.5)))
(out <- scoreYJ(X, y, la=c(0.25, 1/3, 0.4, 0.5), lik=TRUE))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.