sas.cmprsk: generate prediction equation for a competing risks regression...

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

View source: R/sas.cmprsk.R

Description

Generate an equation to calculate X beta from a crr model fit If specify a time point, the function also generates the subcumulative rate at the time point.

Usage

1
sas.cmprsk(f, time = NA, baseonly = FALSE, file = "", append = FALSE)

Arguments

f

a model fit from the competing risks regression.

time

time point

baseonly

logical variable. If true, only base survival probability will be printed.

file

A connection, or a character string naming the file to print to

append

logical. Only used if the argument file is the name of file. If TRUE output will be appended to file; otherwise, it will overwrite the content of file

Details

f should be fitted by the function crr.fit

Value

out

a character vector that can be output as a formula by function cat

Rout

same as out except replacing "max","min","=" and "**" with "pmax","pmin", "==" and "^" respectively so that the formula can be pasted to R session and compute X beta directly without any further modification

Author(s)

changhong

See Also

sascode,Function, crr.fit

Examples

1
2
3
4
5
6
7
8
9
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)
sas.cmprsk(prostate.crr, time = 60)

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