nomogramEx: Extract Equations from a Nomogram

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

View source: R/nomogramEx.R

Description

A nomogram can not be easily applied, because it is difficult to calculate the points or even the survival probability. The package, including a function of nomogramEx(), is to extract the polynomial equations to calculate the points of each variable, and the survival probability corresponding to the total points.

Usage

1
nomogramEx(nomo,np,digit)

Arguments

nomo

a object of nomogram()

np

the number of predicitons in your nomogram, for example: if you predicted 3- and 6- month, np=2, default is 2

digit

the number of decimal digits, default is 9

Value

list

the result is a list including polynomial equations to calculate the points of each variable, and the polynomial equations to calculate the probability of points

Note

The polynomial equations extracted by this package are equal and less than cubic function.

Update:

Version 1.0: 1.the order of variables in the polynomial equations is opposite. 2.the number of the demical digits can not be controled.

Version 2.0: 1.the argument 'lp' from the 'nomogram' function can not be recognized.

Author(s)

Zhicheng Du<[email protected]>, Yuantao Hao<[email protected]>

See Also

nothing

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
if(require("rms")){
n <-1000
age <- rnorm(n,50,10)
sex <- factor(sample(c('female','male'),n,TRUE))
sex <- as.numeric(sex)
ddist <- datadist(age,sex)
options(datadist='ddist')
cens <- 15*runif(n)
time <- -log(runif(n))/0.02*exp(.04*(age-50)+.8*(sex=='Female'))
death <- ifelse(time <= cens,1,0)
time <- pmin(time,cens)
units(time)="month"
f <- cph(formula(Surv(time,death)~sex+age),x=TRUE,y=TRUE,surv=TRUE,time.inc=3)
surv <- Survival(f)
nomo <- nomogram(f, fun=list(function(x) surv(3,x),function(x) surv(6,x)),
  lp=TRUE,funlabel=c("3-Month Survival Prob","6-Month Survival Prob"))
nomogramEx(nomo=nomo,np=2,digit=9)
}

nomogramEx documentation built on Aug. 29, 2017, 9:02 a.m.