Newlabels.cmprsk: Change predictor labels for a model fit

Description Usage Arguments Details Value Examples

View source: R/Newlabels.cmprsk.R

Description

Change labels of predictors

Usage

1
2
## S3 method for class 'cmprsk'
Newlabels(fit, labels, ...)

Arguments

fit

a model fit

labels

a character vector specifying new labels for variables in a fit. To give new labels for all variables, you can specify labels of the form labels=c("Age in Years","Cholesterol"), where the list of new labels is assumed to be the length of all main effect-type variables in the fit and in their original order in the model formula. You may specify a named vector to give new labels in random order or for a subset of the variables, e.g., labels=c(age="Age in Years",chol="Cholesterol")

...

other arguments

Details

This method function was written for competing risks regression model for facilitating to change the labels of predictors when construct a nomogram. It is used for the generic function Newlabels

Value

a new model fit object with the levels adjusted.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
data(prostate.dat)
dd <- datadist(prostate.dat)
options(datadist = "dd")
prostate.f <- cph(Surv(TIME_EVENT,EVENT_DOD == 1) ~ TX  + rcs(PSA,3) +
           BX_GLSN_CAT +  CLIN_STG + rcs(AGE,3) +
           RACE_AA, data = prostate.dat,
           x = TRUE, y= TRUE, surv=TRUE,time.inc = 144)
prostate.crr <- crr.fit(prostate.f,cencode = 0,failcode = 1)
prostate.g <- Newlabels.cmprsk(
    prostate.crr,
    c(
        TX = 'Treatment options', 
        BX_GLSN_CAT = 'Biopsy Gleason Score Sum',
        CLIN_STG = 'Clinical stage'
    )
)

jixccf/QHScrnomo documentation built on Dec. 21, 2021, 12:08 a.m.