I am trying to assess the prediction improvement after adding a new biomarker, and trying to implement an analysis you recommended using rexVar function "Relative Explained Variation".
However, I met a error after running this function (Error in A %*% B : non-conformable arguments. I made a simple example to reappear this error. Did I make a mistake in coding?
n <- 1000
set.seed(1234)
age <- rnorm(n, 50, 10)
blood.pressure <- rnorm(n, 120, 15)
cholesterol <- rnorm(n, 200, 25)
time <- runif(n, 1, 15)
status <- round(age/100,0)
d <- data.table(age,blood.pressure,cholesterol,time,status)
model_M1 <-
cph(
Surv(time, status) ~ rcs(age, 3) * rcs(blood.pressure, 3),
x = TRUE,
y = TRUE,
data = d
)
# error also occurs in the following model
# model_M1 <-
# cph(
# Surv(time, status) ~ age + blood.pressure,
# x = TRUE,
# y = TRUE,
# data = d
# )
g <- bootcov(model_M1, B=20)
rexVar(g, data=d)
Dear Prof. Harrell,
I am trying to assess the prediction improvement after adding a new biomarker, and trying to implement an analysis you recommended using rexVar function "Relative Explained Variation".
However, I met a error after running this function (Error in A %*% B : non-conformable arguments. I made a simple example to reappear this error. Did I make a mistake in coding?