loggammacenslmrob: Robust estimation of an Accelerated Failure Time model with...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/loggammacenslmrob.R

Description

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.

Usage

1
2
3
4
5
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, ...)

Arguments

formula

a symbolic description of the model to be fit. See lm and formula for more details.

delta

numeric, 0 or 1. 0 indicated censored observations.

data

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.

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 in the fitting process (in addition to the robustness weights computed in the fitting process).

na.action

a function which indicates what should happen when the data contain NAs. 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.

method

string specifying the estimator-chain. Default is TML one step.

model, x, y

logicals. If TRUE the corresponding components of the fit (the model frame, the model matrix, the response) are returned.

singular.ok

logical. If FALSE (the default in S but not in R) a singular fit is an error.

contrasts

an optional list. See the contrasts.arg of model.matrix.default.

offset

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.

control

a list specifying control parameters; use the function loggammarob.control and see its help page.

init

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.

Value

An object of class lmrob; a list including the following components:

coefficients

The estimate of the coefficient vector for the regression part. First element is the intercept and it would be equals to the parameter mu.

mu

The estimate of the intercept parameter.

sigma

The estimate of the scale parameter.

lambda

The estimate of the shape parameter.

fitted.values

Fitted values associated with the estimator.

residuals

Residuals associated with the estimator.

cut.lower, cut.upper

Cut points for the method based on TML (missing for the other methods).

iter

number of iterations.

weights

the specified weights (missing if none were used).

errors

errors messages.

n.ret

number of non zero robust weights for the method based on TML.

control

control argument.

converged

TRUE if the procedure converged.

method

method used during the fit.

rank

the numeric rank of the fitted linear model.

rweights

the “robustness weights”.

df.residual

the residual degrees of freedom.

degree.freedom

the same as df.residual

delta

as in input.

df

a vector with 3 components: (number of linearly independent regressors, df.residual, number of regressors).

xlevels

(only where relevant) a record of the levels of the factors used in fitting.

call

the matched call.

terms

the terms object used.

model

if requested (the default), the model frame used.

x

if requested, the model matrix used.

y

if requested, the response used.

scale

square root of the sigma parameter.

na.action

(where relevant) information returned by model.frame on the special handling of NAs.

offset

the offset used (missing if none were used).

contrasts

(only where relevant) the contrasts used.

In addition, non-null fits will have qr relating to the linear fit, for use by extractor functions such as summary.

Author(s)

C. Agostinelli, A. Marazzi and V.J. Yohai

References

C. Agostinelli, I. Locatelli, A. Marazzi and V.J. Yohai (2015) Robust estimators of accelerated failure time regression with generalized log-gamma errors. Submitted.

See Also

loggammacensrob for the case of censored observations without covariates.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
  ## 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
    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)
  
## End(Not run)

Example output

Call:
loggammacenslmrob(formula = y ~ x1 + x2, delta = delta, data = x)
 \--> method = "oneTML"
Residuals:
     Min       1Q   Median       3Q      Max 
-10.4920  -3.9314  -1.7702   0.1927   2.7951 

Coefficients:
            Estimate Std. Error z value Pr(>|z|)    
(Intercept)   2.5424     0.8958   2.838  0.00454 ** 
x1            0.6750     0.1366   4.942 7.74e-07 ***
x2            0.9997     0.1458   6.856 7.09e-12 ***
Sigma         2.1807     0.4055                     
Lambda        1.5111     1.5087   1.002  0.31654    
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Robust residual standard error: 1.477 

Robustness weights: 
 2 observations c(50,64) are outliers with |weight| = 0 ( < 0.001); 
 98 weights are ~= 1.

robustloggamma documentation built on May 1, 2019, 9:20 p.m.