Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rexVar in survival model (cph) #138

Open
lijiaqi-github opened this issue Dec 21, 2023 · 1 comment
Open

rexVar in survival model (cph) #138

lijiaqi-github opened this issue Dec 21, 2023 · 1 comment

Comments

@lijiaqi-github
Copy link

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?

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)
@lijiaqi-github
Copy link
Author

This issue has been solved by Professor Harrell, Thank you for your quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant