0
$\begingroup$

What tests are required before and after estimating a discrete time survival model? In other words, how the assumptions should be tested and how the generalization of results should be investigated and discussed? For example, how do you test if we should include random effects or fixed effects?

library(readxl)
require(lme4) 

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)
$\endgroup$
3
  • $\begingroup$ Asking for help with code is off-topic in Stats.SE $\endgroup$ – Firebug Sep 30 '16 at 19:09
  • $\begingroup$ Questions solely about how to use software are off-topic here, but you may have a real statistical question buried here. You may want to edit your question to clarify the underlying statistical issue. You may find that when you understand the statistical concepts involved, the software-specific elements are self-evident or at least easy to get from the documentation. $\endgroup$ – gung - Reinstate Monica Oct 1 '16 at 23:15
  • $\begingroup$ @ gung @ Firebug First, thanks. Then, I edited it so could you please provide your answer. $\endgroup$ – ebrahimi Oct 4 '16 at 5:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.