Write output of riskRegression::Score
in tables
# S3 method for Score
publish(object, metrics, score = TRUE, contrasts = TRUE, level = 3, ...)
Results of Score in tabular form
Object obtained with riskRegression::Score
Which metrics to put into tables. Defaults to
object$metrics
.
Logical. If TRUE
print the score elements, i.e., metric applied to the risk prediction models.
Logical. If TRUE
print the contrast elements (if any). These compare risk prediction models according to metrics.
Level of subsection headers, i.e., ** for level 2 and *** for level 3 (useful for emacs org-users). Default is plain subsection headers no stars. A negative value will suppress subjection headers.
Passed to publish
Thomas A. Gerds <tag@biostat.ku.dk>
Collect prediction accuracy results in tables
if (requireNamespace("riskRegression",quietly=TRUE)){
library(riskRegression)
library(survival)
learn = sampleData(100)
val= sampleData(100)
f1=CSC(Hist(time,event)~X1+X8,data=learn)
f2=CSC(Hist(time,event)~X1+X5+X6+X8,learn)
xs=Score(list(f1,f2),data=val,formula=Hist(time,event)~1)
publish(xs)
}
Run the code above in your browser using DataLab