fit2newdata | R Documentation |
Make a new data of mean value or most frequent value
fit2newdata(
fit,
xnames = NULL,
pred.values = list(),
maxy.lev = 5,
median = TRUE,
digits = 1
)
fit |
An object of class "coxph" |
xnames |
character Names of explanatory variable to plot |
pred.values |
A list A list of predictor values |
maxy.lev |
Integer Maximum unique length of a numeric variable to be treated as categorical variables |
median |
logical If TRUE, select median value for numerical variable. Otherwise select most frequent value |
digits |
integer indicating the number of decimal places |
A data.frame
require(survival)
data(cancer,package="survival")
fit=coxph(Surv(time,status)~rx+sex+age,data=colon)
fit=coxph(Surv(time,status)~rx+age+strata(sex),data=colon)
fit=survreg(Surv(time, status) ~ ph.ecog + age + sex, data=lung, dist="weibull")
fit2newdata(fit)
fit2newdata(fit,pred.values=list(sex=0,age=58))
fit2newdata(fit,pred.values=list(age=c(20,40,60,80),sex=2,ph.ecog=3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.