Plot.peperr.curves: Plot method for prediction error curves of a peperr object

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

View source: R/peperr_glmnet.R

Description

Plots individual and aggregated prediction error estimates based on bootstrap samples.

Usage

1
2
Plot.peperr.curves(x, at.risk=TRUE, allErrors=FALSE, 
bootRuns=FALSE, bootQuants=TRUE, bootQuants.level=0.95, leg.cex=0.7,...)

Arguments

x

peperr object.

at.risk

number at risk to be display. default is TRUE.

allErrors

Display .632, no information and average out-of-bag error in addition. default is FALSE.

bootRuns

Display individual out-of-bag bootstrap samples. default is FALSE.

bootQuants

Display pointwise out-of-bag bootstrap quantiles as shaded area. default is TRUE.

bootQuants.level

Quantile probabilities for pointwise out-of-bag bootstrap quantiles. default is 0.95, i.e. 2.5% and 97.5% quantiles.

leg.cex

size of legend text

...

additional arguments, not used.

Details

This function is literally taken from plot.peperr in the peperr package. The display of prediction error curves is adapted to allow for numbers at risk and pointwise bootstrap quantiles.

Author(s)

Thomas Hielscher t.hielscher@dkfz.de

References

Sill M., Hielscher T., Becker N. and Zucknick M. (2014), c060: Extended Inference with Lasso and Elastic-Net Regularized Cox and Generalized Linear Models, Journal of Statistical Software, Volume 62(5), pages 1–22. https://www.jstatsoft.org/v62/i05/

See Also

peperr

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
26
27
28
29
30
31
## Not run: 

# example from glmnet package
set.seed(10101)
library(glmnet)
library(survival)
library(peperr)

N=1000;p=30
nzc=p/3
x=matrix(rnorm(N*p),N,p)
beta=rnorm(nzc)
fx=x[,seq(nzc)]
hx=exp(fx)
ty=rexp(N,hx)
tcens=rbinom(n=N,prob=.3,size=1)# censoring indicator
y=Surv(ty,1-tcens)

peperr.object <- peperr(response=y, x=x, 
                        fit.fun=fit.glmnet, args.fit=list(family="cox"), 
                        complexity=complexity.glmnet,  
                        args.complexity=list(family="cox",nfolds=10),
                        indices=resample.indices(n=N, method="sub632", sample.n=10))

# pointwise bootstrap quantiles and all error types
Plot.peperr.curves(peperr.object, allErrors=TRUE)

# individual bootstrap runs and selected error types
Plot.peperr.curves(peperr.object, allErrors=FALSE, bootRuns=TRUE)

## End(Not run)

Example output

Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-16

Loading required package: snowfall
Loading required package: snow
snowfall 1.84-6.1 initialized: sequential execution, one CPU.

Loading required package: codetools
Kaplan-Meier, step 1Kaplan-Meier, step 2Kaplan-Meier, step 3Kaplan-Meier, step 4Kaplan-Meier, step 5Kaplan-Meier, step 6Kaplan-Meier, step 7Kaplan-Meier, step 8Kaplan-Meier, step 9Kaplan-Meier, step 10Kaplan-Meier, step 11Warning messages:
1: In peperr(response = y, x = x, fit.fun = fit.glmnet, args.fit = list(family = "cox"),  :
  You are using a parallel random number generator ('RNGstream') with its default seed. See Details of documentation for other options.
2: In sfClusterSetupRNG(type = RNG) :
  Uniform random number streams (currently) not available in serial execution. Random numbers may differ in serial & parallel execution.
3: In sfExport(character(0), debug = FALSE) :
  sfExport() writes to global environment in sequential mode.

4: In sfExport(character(0), debug = FALSE) :
  sfExport() writes to global environment in sequential mode.

5: In sfExport("fit.fun") :
  sfExport() writes to global environment in sequential mode.

6: In sfExport("complexity") :
  sfExport() writes to global environment in sequential mode.

7: In sfExport("response", "x", "sample.index.full", "sample.n", "not.in.sample.full",  :
  sfExport() writes to global environment in sequential mode.

8: In sfExport("km.weight") :
  sfExport() writes to global environment in sequential mode.

c060 documentation built on March 16, 2021, 9:06 a.m.