score {fsdaR} | R Documentation |
Computes the score test for transformation in regression
Description
Computes the score test for transformation in regression
Usage
score(x, ...)
## S3 method for class 'formula'
score(
formula,
data,
subset,
weights,
na.action,
model = TRUE,
contrasts = NULL,
offset,
...
)
## Default S3 method:
score(
x,
y,
intercept = TRUE,
la = c(-1, -0.5, 0, 0.5, 1),
lik = FALSE,
nocheck = FALSE,
trace = FALSE,
...
)
Arguments
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. |
... |
potential further arguments passed to lower level functions. |
formula |
a |
data |
data frame from which variables specified in
|
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
weights |
an optional vector of weights to be used NOT USED YET. |
na.action |
a function which indicates what should happen
when the data contain |
model |
|
contrasts |
an optional list. See the |
offset |
this can be used to specify an a priori
known component to be included in the linear predictor
during fitting. An |
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 |
trace |
Whether to print intermediate results. Default is |
Value
An S3 object of class score.object
will be returned which is basically a list
containing the following elements:
-
la
: vector containing the values of lambda for which fan plot is constructed -
Score
: a vector containing the values of the score test for each value of the transformation parameter. -
Lik
: value of the likelihood. This output is produced only if lik=TRUE.
Author(s)
FSDA team, valentin.todorov@chello.at
References
Atkinson, A.C. and Riani, M. (2000), Robust Diagnostic Regression Analysis Springer Verlag, New York.
Examples
## Not run:
data(wool)
XX <- wool
y <- XX[, ncol(XX)]
X <- XX[, 1:(ncol(XX)-1), drop=FALSE]
(out <- score(X, y)) # call 'score' with all default parameters
(out <- score(cycles~., data=wool)) # use the formula interface
(out <- score(cycles~., data=wool, lik=TRUE)) # return the likelihood
data(loyalty)
head(loyalty)
## la is a vector containing the values of \lambda which have to be tested
(out <- score(amount_spent~., data=loyalty, la=c(0.25, 1/3, 0.4, 0.5)))
(out <- score(amount_spent~., data=loyalty, la=c(0.25, 1/3, 0.4, 0.5), lik=TRUE))
## End(Not run)