Hi, I'm receiving the error message Error in rep(yi, m) : invalid 'times' argument when attempting to fit the joint cox model with both terminal and recurrent events. Specifically, the error seems to occur when an observation does not contain the recurrent event and either ends due to the terminal event or is censored. Is this a limitation of the Huang and Wang model or just a issue in the package?
Example to reproduce the error:
# Main Packages
library(tidyverse)
# Survival Analysis and reReg Packages
library(survival)
library(reReg)
data("simDat")
# Take observation id = 200, change id to 201, and make event column all 0. Recurrent event doesn't occur for this observation. Otherwise same as observation 200.
df_new_obs <- simDat %>% filter(id == 200) %>% mutate(id = 201, event = 0)
simDat_Test <- simDat %>% bind_rows(df_new_obs)
fit1 <- reReg(Recur(t.stop, id, event, status) ~ x2, data = simDat, model = "cox|cox", B = 0) # Works as expected.
fit2 <- reReg(Recur(t.stop, id, event, status) ~ x2, data = simDat_Test, model = "cox|cox", B = 0) # Error
recur1 <- with(simDat, Recur(t.stop, id, event, status))
recur2 <- with(simDat_Test, Recur(t.stop, id, event, status))
summary(recur1) # Works as expected.
summary(recur2) # Works as expected.
Hi, I'm receiving the error message
Error in rep(yi, m) : invalid 'times' argument
when attempting to fit the joint cox model with both terminal and recurrent events. Specifically, the error seems to occur when an observation does not contain the recurrent event and either ends due to the terminal event or is censored. Is this a limitation of the Huang and Wang model or just a issue in the package?Example to reproduce the error:
Seems to be an issue with
yi
and notm
inrep()
.