Three different type of robust procedures are provided for the estimation of the parameters in an Accelerated Failure Time model with extended Log Gamma errors in presence of censored observations. Maximum Likelihood is also provided.
loggammacenslmrob(formula, delta, data, subset, weights,
na.action, method = c("oneTML", "oneWL", "TWQTau", "TQTau",
"ML"), model = TRUE, x = !control$compute.rd, y = FALSE,
singular.ok = TRUE, contrasts = NULL, offset = NULL,
control = NULL, init = NULL, ...)
numeric, 0 or 1. 0 indicated censored observations.
an optional data frame, list or environment (or object
coercible by as.data.frame
to a data frame) containing the
variables in the model. If not found in data
, the variables
are taken from environment(formula)
, typically the
environment from which loggammacenslmrob
is called.
an optional vector specifying a subset of observations to be used in the fitting process.
an optional vector of weights to be used in the fitting process (in addition to the robustness weights computed in the fitting process).
a function which indicates what should happen when
the data contain NA
s. The default is set by the
na.action
setting of options
, and is
na.fail
if that is unset. The “factory-fresh”
default is na.omit
. Another possible value is
NULL
, no action. Value na.exclude
can be
useful.
string specifying the estimator-chain. Default is TML one step.
logicals. If TRUE
the corresponding
components of the fit (the model frame, the model matrix, the
response) are returned.
logical. If FALSE
(the default in S but not
in R) a singular fit is an error.
an optional list. See the contrasts.arg
of model.matrix.default
.
this can be used to specify an a priori known
component to be included in the linear predictor during fitting.
An offset
term can be included in the formula instead
or as well, and if both are specified their sum is used.
a list
specifying control parameters; use the
function loggammarob.control
and see its help page.
an optional argument to specify or supply the initial estimate. See Details.
additional arguments can be used to specify control
parameters directly instead of (but not in addition to!) via
control
.
An object of class lmrob
; a list including the following
components:
The estimate of the coefficient vector for the
regression part. First element is the intercept and it would be
equals to the parameter mu
.
The estimate of the intercept parameter.
The estimate of the scale parameter.
The estimate of the shape parameter.
Fitted values associated with the estimator.
Residuals associated with the estimator.
Cut points for the method based on TML (missing for the other methods).
number of iterations.
the specified weights (missing if none were used).
errors messages.
number of non zero robust weights for the method based on TML.
control
argument.
TRUE
if the procedure converged.
method used during the fit.
the numeric rank of the fitted linear model.
the “robustness weights”.
the residual degrees of freedom.
the same as df.residual
as in input.
a vector with 3 components: (number of linearly independent regressors, df.residual, number of regressors).
(only where relevant) a record of the levels of the factors used in fitting.
the matched call.
the terms
object used.
if requested (the default), the model frame used.
if requested, the model matrix used.
if requested, the response used.
square root of the sigma
parameter.
(where relevant) information returned by
model.frame
on the special handling of NA
s.
the offset used (missing if none were used).
(only where relevant) the contrasts used.
C. Agostinelli, I. Locatelli, A. Marazzi and V.J. Yohai (2015) Robust estimators of accelerated failure time regression with generalized log-gamma errors. Submitted.
loggammacensrob
for the case of censored observations
without covariates.
# NOT RUN {
# }
# NOT RUN {
n <- 50
p <- 2
set.seed(1234)
X <- matrix(rnorm(p*n, sd=2), ncol=p)
mu <- 2
beta <- rep(2,p)
sigma <- 2
lambda <- 1
linear <- mu + X<!-- %*%beta -->
y <- rloggamma(n=n, mu=linear, sigma=sigma, lambda=lambda)
cens <- rloggamma(n=n, mu=linear+3, sigma=sigma, lambda=lambda)
delta <- as.numeric(y <= cens)
y[delta==0] <- cens[delta==0]
x <- data.frame(y=as.vector(y), x1=X[,1], x2=X[,2])
res <- loggammacenslmrob(y~x1+x2, delta=delta, data=x)
summary(res)
# }
Run the code above in your browser using DataLab