You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I have come across an issue that I haven't been able to find a solution for. I am trying to stratify by gender in my survival model, and I have no issues getting my jointModelBayes function to work with this. However, when I try to use survfitJM to make predictions, I get the following error:
I know this isn't an issue with how I am creating my factor variables and naming them because when I run the exact same code but just put gender as a normal predictor, the survfitJM function runs fine. Not sure if something is happening to the factor levels of the stratified variable once it has gone through jointModelBayes or if the prediction function isn't able to handle stratified variables?
Here is some example code:
lmeFit <- lme(diameter ~ time+type, random = ~1|id, data = lme.mod2)
coxFit <- coxph(Surv(tte, ae) ~ type + age10 + strata(gender), data = cox.mod2, x = TRUE)
coxFit2 <- coxph(Surv(tte, ae) ~ type + age10 + gender, data = cox.mod2, x = TRUE)
I'm not sure and I use the updated package JMbayes2, but when I've had this error it's because I'm not predicting on enough new patients. I think it's because you only have females in your newdata. Maybe try do some more patients and have a mix of male and female?
Hello! I have come across an issue that I haven't been able to find a solution for. I am trying to stratify by gender in my survival model, and I have no issues getting my jointModelBayes function to work with this. However, when I try to use survfitJM to make predictions, I get the following error:
![image](https://private-user-images.githubusercontent.com/62446594/266029155-3fe81d4b-f232-4ada-9837-5581ae774e65.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkwMDcxMzYsIm5iZiI6MTcxOTAwNjgzNiwicGF0aCI6Ii82MjQ0NjU5NC8yNjYwMjkxNTUtM2ZlODFkNGItZjIzMi00YWRhLTk4MzctNTU4MWFlNzc0ZTY1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIxVDIxNTM1NlomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTliMjljMjY0YTRkNGIzZTM1NGYzNGUzZGJhMjVhMTRlNmZmOTAzOGZjYTgxMWYxYzZiMjY3YjU5NDg0YjE0MjUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.aqMOlyDDuUc8gRSIeuyUimoRXdXF3oy-ksf1b8RckTw)
I know this isn't an issue with how I am creating my factor variables and naming them because when I run the exact same code but just put gender as a normal predictor, the survfitJM function runs fine. Not sure if something is happening to the factor levels of the stratified variable once it has gone through jointModelBayes or if the prediction function isn't able to handle stratified variables?
Here is some example code:
lmeFit <- lme(diameter ~ time+type, random = ~1|id, data = lme.mod2)
coxFit <- coxph(Surv(tte, ae) ~ type + age10 + strata(gender), data = cox.mod2, x = TRUE)
coxFit2 <- coxph(Surv(tte, ae) ~ type + age10 + gender, data = cox.mod2, x = TRUE)
jointFit2 <- jointModelBayes(lmeFit, coxFit, timeVar = "time")
summary(jointFit4)
jointFit4 <- jointModelBayes(lmeFit, coxFit2, timeVar = "time")
summary(jointFit2)
id <- c(1,1)
diameter <- c(40,50)
age10 <- c(5,5)
type <- factor(c("A", "A"), levels = c("A", "B"))
time <- c(0,15)
gender <- factor(c('female','female'), levels = c('female','male'))
patientdata <- data.frame(id, diameter, age10, type, time, gender)
survfitJM(jointFit2, newdata = patientdata, idVar = 'id')
#this returns an error
survfitJM(jointFit4, newdata = patientdata, idVar = 'id')
#this works just fine
The text was updated successfully, but these errors were encountered: