Builds a nomogram for a survey-weighted Cox model
Builds a nomogram for a survey-weighted Cox model.
represents a survey design object obtained with the package "survey"
indicates a Cox model specification
contains the data on which the model is to be fit (can not contain NAs)
specifies the time point at which the nomogram prediction axis will be drawn
designate the label of the prediction axis
In addition to the inputs, this function expects the following: 1) the input dataset (.data) cannot contain NAs. You can accomplish this using the na.omit function. See example. 2) datadist must be set. See examples and the documentation for the rms package. 3) survey design must have been saved in .design All of these requirements are explained in Capanu & Gonen (2015) in detail
A list including elements
A nomogram object
predicted values from the model
In addition to what is listed below, the design and the fitted survey weighted Cox model (svy.cox), as well as the timepoint at which the nomogram prediction axis will be drawn (pred.at) are stored
Marinela Capanu, Mithat Gonen (2015). Building a Nomogram for Survey-Weighted Cox Models Using R. Journal of Statistical Software, Code Snippets, 64(1), 1-17. URL https://www.jstatsoft.org/v64/c01/.
library(survey) library(rms) data(noNA) dd=datadist(noNA) options(datadist="dd") dstr2=svydesign(id=~1, strata=~group, prob=~inv_weight, fpc=~ssize, data=noNA) mynom=svycox.nomogram(.design=dstr2, .model=Surv(survival,surv_cens)~ECOG+liver_only+Alb+Hb+Age+ Differentiation+Gt_1_m1site+lymph_only, .data=noNA, pred.at=24, fun.lab="Prob of 2 Yr OS") #> Error in Design(X, formula = formula): dataset dd not found for options(datadist=) plot(mynom$nomog) #> Error in plot(mynom$nomog): object 'mynom' not found