Dear Mr./Ms.
Greetings
I would be very grateful if you could let me know how to do cross validation when estimating a discrete time survival analysis in R.
library(readxl)require(lme4)
setwd("D:/Nasdaq")df=read_excel("Book1.xlsx",sheet = 1)model <- glmer(EVENT ~ TIME + (1+TIME|ID)+x1+x2+x3+x4+x5, data=df, family=binomial)p <- as.numeric(predict(model, type="response")>0.5)acc=mean(p==df$EVENT)
Thanks in advance.Best regards,