kogalur / randomForestSRC

DOCUMENTATION:
https://www.randomforestsrc.org/
GNU General Public License v3.0
115 stars 18 forks source link

the issue regarding brier score calculation and ploting #403

Open suengeek opened 10 months ago

suengeek commented 10 months ago

Hey, i am now doing a survival analysis and met an issue when i using get.brier.survival() function: there is a warning: obj1 <- rfsrc(Surv(cvd.survival.days,any.cardiovascular_dx)~., dta, ntree = 1000, nodesize = 325,set.seed(-123456),importance="permute") plot(obj1)

obtain Brier score using KM and RSF censoring distribution estimators

bs.km <- get.brier.survival(obj1, cens.mode = "km")$brier.score bs.rsf <- get.brier.survival(obj1, cens.model = "rfsrc")$brier.score

plot the brier score

plot(bs.km, type = "s", col = 2) lines(bs.rsf, type ="s", col = 4) legend("bottomright", legend = c("cens.model = km", "cens.model = rfsrc"), fill = c(2,4))

and here is the warning for 'bs.rsf': Error in generic.predict.rfsrc(object, newdata, m.target = m.target, importance = importance, : x-variables in test data do not match original training data

I have struggled with this problem couple of days. could someone help me?

suengeek commented 10 months ago

there is also another warning when i would like to plot the vimp:

jk.obj <- subsample(obj1) plot.subsample(jk.obj) Error in dimnames(x) <- dn : length of 'dimnames' [1] not equal to array extent