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

implausibel beta coefficient estimates in survex #95

Open
antjejahn opened this issue Sep 4, 2024 · 0 comments
Open

implausibel beta coefficient estimates in survex #95

antjejahn opened this issue Sep 4, 2024 · 0 comments

Comments

@antjejahn
Copy link

Hello, for data that follow a Cox model, I would expect the beta (regression coefficient) estimates given by the function predict_parts to be close to the true coefficients of the Cox model. The paper of Kovalev that is introducing survLIME (doi: 10.1016/j.knosys.2020.106164) confirms this by a simulation study (Figure 3). However, when applying survex to simulated data the beta estimates substantially differ from the true values. Is there any reason for that? Thanks in advance!

library(survival)
library(survex)

# simulate data
set.seed(2)
n<-1000
X1<-rnorm(n,0,1)
X2<-rnorm(n,0,1)
X3<-rnorm(n,0,1)
beta1<-0.3
beta2<--0.3
beta3<-0
time<-rexp(n,exp(beta1*X1+beta2*X2+beta3*X3))
status<-rbinom(n,1,0.9)
df<-data.frame(time,status,X1,X2,X3)

# Global Cox model 
model.cox<-coxph(Surv(time,status)~.,data=df, model = TRUE, x = TRUE)

# beta1 estimates of survLIME at 20 random observations
exp.cox <- explain(model.cox, data=df[-c(1,2)], y=Surv(df$time, df$status))

flime <- function(newobs){
  p_parts_lime <-predict_parts(explainer=exp.cox, new_observation=newobs, output_type = "survival", type="survlime")
  return(p_parts_lime$result$X1)
}

df.sample<-sample(c(1:n),20)
beta1.survLIME <- sapply(df.sample, function(x){flime(df[x,-c(1,2)])})

# Comparison of estimates and true value of beta1
beta1.est<-cbind(beta1,model.cox$coef[1],mean(beta1.survLIME))
colnames(beta1.est)<-c("true","cox_estimate","mean_survex_estimate")

beta1.est
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