Estimate a set of conditional expectiles or quantiles with semiparametric predictors in accelerated failure time models. For the estimation, the asymmetric loss functions are reformulated into auxiliary likelihoods.
expectreg.aft(
formula,
data = NULL,
smooth = c("cvgrid", "aic", "bic", "lcurve", "fixed"),
lambda = 1,
expectiles = NA, ci = FALSE)qureg.aft(
formula,
data = NULL,
smooth = c( "cvgrid", "aic", "bic", "lcurve", "fixed"),
lambda = 1,
quantiles = NA,
ci = FALSE)
An object of class 'expectreg', which is basically a list consisting of:
The final smoothing parameters for all expectiles and for all effects in a list.
The intercept for each expectile.
A matrix of all the coefficients, for each base element a row and for each expectile a column.
The fitted values for each observation and all expectiles, separately in a list for each effect in the model, sorted in order of ascending covariate values.
Vector of the response variable.
List with the values of the covariates.
The formula object that was given to the function.
Vector of fitted expectile asymmetries as given by argument expectiles.
List of characters giving the types of covariates.
List of additional parameters like neighbourhood structure for spatial effects or \(\phi\) for kriging.
Complete design matrix.
Bases components of each covariate.
Fitted values \( \hat{y} \).
Covariance matrix, estimated when ci = TRUE.
Diagonal of the hat matrix. Used for model selection criteria.
Original data
Unchanged original type of smoothing.
plot, predict, resid,
fitted, effects
and further convenient methods are available for class 'expectreg'.
An R formula object consisting of the response variable, '~' and the sum of all effects that should be taken into consideration. Each semiparametric effect has to be given through the function rb. The response needs to be a call of Surv.
Optional data frame containing the variables used in the model, if the data is not explicitely given in the formula.
There are different smoothing algorithms that tune lambda to prevent overfitting. Caution, the currently implemented smoothing algorithms can take a long time. Cross validation is done with a grid search ('cvgrid'). The function can also use a supplied fixed penalty ('fixed'). The numerical minimisation is also possible with AIC or BIC as score ('aic', 'bic'). The L-curve ('lcurve') is a new experimental grid search by Frasso and Eilers.
The fixed penalty can be adjusted. Also serves as starting value for the smoothing algorithms.
In default setting, the expectiles (0.01,0.02,0.05,0.1,0.2,0.5,0.8,0.9,0.95,0.98,0.99) are calculated. You may specify your own set of expectiles in a vector. The option may be set to 'density' for the calculation of a dense set of expectiles that enhances the use of cdf.qp and cdf.bundle afterwards.
Whether a covariance matrix for confidence intervals and a summary is calculated.
Quantiles for which the regression should be performed.
Fabian Otto-Sobotka
Carl von Ossietzky University Oldenburg
https://uol.de
For expectile regression, the LAWS loss function
$$ S = \sum_{i=1}^{n}{ w_i(p)(y_i - \mu_i(p))^2} $$
with
\( w_i(p) = p 1_{(y_i > \mu_i(p))} + (1-p) 1_{(y_i < \mu_i(p))} \)
is repackaged into the asymmetric normal distribution. Then, an accelerated failure time model is estimated. This function is based on the 'expectreg' package and uses the same functionality to include semiparametric predictors.
For quantile regression, the loss function is replaced with a likelihood from the asymmetric laplace distribution.
expectreg.ipc, expectreg.ls
data(colcancer)
ex <- c(0.05, 0.2, 0.5, 0.8, 0.95)
c100 <- colcancer[1:100,]
exfit <- expectreg.aft(Surv(logfollowup, death) ~ LNE, data = c100, expectiles = ex, smooth="f")
coef(exfit)
qu1 <- qureg.aft(Surv(logfollowup, death) ~ LNE + sex, data=c100, smooth="fixed")
coef(qu1)
if (FALSE) {
# takes some time
qu2 <- qureg.aft(Surv(logfollowup, death) ~ rb(LNE) + sex, data=colcancer[1:200,])
}
Run the code above in your browser using DataLab