plot.ahazpen {ahaz}R Documentation

Plot an ahazpen object

Description

Plots regularization paths for fitted penalized semiparametric additive hazards model.

Usage

## S3 method for class 'ahazpen'
plot(x, xvar=c("norm","lambda"), labels=FALSE, df=TRUE,
                ylab="Regression coefficients", xlab=xname,...)

Arguments

x

The result of an ahazpen fit.

xvar

Scaling for first axis. Options are the L^1 norm of the vector of regression coefficients ("norm") or the penalty parameter on a log scale ("lambda").

labels

Try to display indices for the regression coefficients in the right-hand margin. Default is labels=FALSE.

df

Display number of nonzero parameters in top margin. Default is df=TRUE.

ylab

Label for y-axis.

xlab

Label for x-axis. The default is either "L1 norm" or \lambda, depending on xvar.

...

Additional graphical arguments passed to the plot function.

See Also

ahazpen, print.ahazpen, predict.ahazpen, coef.ahazpen.

Examples

data(sorlie)

# Break ties
set.seed(10101)
time <- sorlie$time+runif(nrow(sorlie))*1e-2

# Survival data + covariates
surv <- Surv(time,sorlie$status)
X <- as.matrix(sorlie[,3:ncol(sorlie)])

# Fit additive hazards regression model
fit <- ahazpen(surv, X, dfmax=50)
par(mfrow=c(1,2)); plot(fit); plot(fit,xvar="lambda")

# With labels only
plot(fit,labels=TRUE,df=FALSE)

[Package ahaz version 1.15 Index]