找回密码
 立即注册
查看: 4494|回复: 0

how to set function of nomogram

[复制链接]
发表于 2014-5-6 09:41:47 | 显示全部楼层 |阅读模式
本帖最后由 pqz 于 2014-5-6 09:41 编辑

Dear all R users,
I want to draw a nomogram similar to the attached article. Can anybody konw how to draw such nomogram? thanks.
Below I gave an example from the rms package to illustrate this problem.

library(rms)
library(survival)
library(MASS)
n <- 1000   
set.seed(17)
age        <- rnorm(n, 50, 10)
blood.pressure    <- rnorm(n, 200, 25)
treatment    <- (sample(0:1, n,TRUE))
ddist <- datadist(age, blood.pressure, treatment)
options(datadist='ddist')
cens <- 15*runif(n)
h <- .02*exp(.04*(age-50)+.8*(treatment==1))
d.time <- -log(runif(n))/h
death <- ifelse(d.time <= cens,1,0)
d.time <- pmin(d.time, cens)
f <- psm(Surv(d.time,death) ~ age+blood.pressure+treatment, dist='lognormal')
surv <- Survival(f)
nom <-nomogram(f, fun=list(function(x) surv(3, x), function(x)surv(6, x)), funlabel=c("3-Month Survival Probability", "6-month Survival Probability"))
plot(nom, xfrac=.7)
#end
In this example, treatment, for example, can be hypotensive therapy. 0 denote not receiving treatment, 1 denote receiving treatment.
My problem:
I want to predict the benefit of hypotensive therapy for these high blood pressure populations. So I want to draw nomograms for receiving treatment (i.e., the variable = 1) or not receiving treatment (i.e., the variable = 0), respectively. Could anyone give me some methods to set the arguments in the nomogram function.

many thanks

Prediction Model for Estimating the Survival Bene

392.64 KB, 下载次数: 10

Model

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|R语言中文网

GMT+8, 2024-11-25 09:33 , Processed in 0.033444 second(s), 20 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表