plot.Coef: Plots the coefficient paths

Description Usage Arguments Details Value Author(s) Examples

View source: R/grpCoxPrep.R

Description

Plots the coefficient values as a function of the lambda values used.

Usage

1
2
3
## S3 method for class 'Coef'
plot(x, lambda, label=TRUE,xlab="log(Lambda)", 
ylab="Coefficients",title=NULL,...)

Arguments

x

A matrix of coefficients.

lambda

The lambda values used.

label

The indices of covariates. Default is TRUE.

xlab

The name of the x-axis.

ylab

The name of the y-axis.

title

The title of the plot.

...

further arguments to plot

Details

A plot is produced, and nothing is returned.

Value

No return value.

Author(s)

Xuan Dang <xuandang11289@gmail.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
set.seed(100001)
N <- 50
p <- 6
times <- 1:p
rho <- 0.5
H <- abs(outer(times, times, "-"))
C <- 1 * rho^H
C[cbind(1:p, 1:p)] <- C[cbind(1:p, 1:p)] 
sigma <- matrix(C,p,p)
mu <- rep(0,p)
x <- mvrnorm(n=N, mu, sigma)

beta <- c(0, .8, 1, 2, 1, 0)
hx <- exp(x %*% beta) 
ty <- rexp(N,hx) 
tcens <- 1 - rbinom(n=N, prob = 0.2, size = 1)
y <- data.frame(illt=ty, ills=tcens)
names(y) <- c("time", "status")

group <- list(g1 = c(1,2,3,4), g2 = c(1,2,6), g3 = c(2,3), g4 = c(4,5), g5 = c(5))
fit <- grpCoxOverlap(x, y, group, penalty="glasso", nlambda=50)
# plot the coefficient values in latent space
plot.gCoef(fit$aBetaLatent, fit$glatent, fit$lambda)
# plot the coefficient values in original space
plot.Coef(fit$aBetaOri, fit$lambda)

grpCox documentation built on Sept. 16, 2020, 9:07 a.m.