0.0.1 Libraries

0.0.2 Data (training and validation set)

data <- read.csv("/Users/carolinaferreiraatuesta/Documents/UCL/Reserach Project/Datasets/derivationtrain_test.csv")
cat <-
  c('id',
'auras',
'withdraw1',
'sex',
'childconvul',
'neuro_insult',
'status_epilepticus',
'family_history',
'non_epileptic',
'gtcs',
'gtcs6',
'MRI_normal',
'MRI_side',
'MRI_lobar',
'MRI_temp',
'EEG_ictal_side',
'EEG_ictal_temp',
'EEG_ictal_focal',
'EEG_interictal_normal',
'icEEG',
'PET',
'PET_side',
'learning_disability',
'psychiatric_pre_any',
'opside',
'optemp',
'opextent',
'op_incomplete',
'pathology_HS',
'pathology_FCD',
'pathology_DNT',
'pathology_CAV',
'pathology_GL',
'pathology_dual',
'pathology_other',
'pathology_normal',
'acutepostszauras',
'sz',
'szaurafree1st',
'aura',
'szaura',
'began_wd',
'wd_all',
'aeds'
    )
cont <- c('numsz6',
          'age_onset',
'duration',
'age_at_surgery',
'sz_time',
'aura_time',
'szaura_time',
'began_wd_time',
'age_began_wd',
'wd_all_time',
'years_follow_up')


tab1 <-
  CreateTableOne(data = data,
                 testApprox = chisq.test,
                 testExact = fisher.test,
                 strata = 'train')


tab_all <-
  CreateCatTable(vars = cat, 
                 data=data)

tab1
##                                    Stratified by train
##                                     0             1              p     
##   n                                   119            231               
##   Column_1 (mean (SD))              60.00 (34.50) 116.00 (66.83) <0.001
##   id (mean (SD))                     1.00 (0.00)    1.00 (0.00)   NaN  
##   auras (mean (SD))                  0.07 (0.25)    0.06 (0.24)   0.810
##   withdraw1 (mean (SD))              0.76 (0.43)    0.69 (0.46)   0.157
##   sex (mean (SD))                    0.57 (0.50)    0.51 (0.50)   0.283
##   childconvul (mean (SD))            0.58 (0.50)    0.51 (0.50)   0.194
##   neuro_insult (mean (SD))           0.55 (0.50)    0.55 (0.50)   0.950
##   status_epilepticus (mean (SD))     0.16 (0.37)    0.10 (0.29)   0.076
##   family_history (mean (SD))         0.34 (0.47)    0.25 (0.43)   0.077
##   non_epileptic (mean (SD))          0.06 (0.24)    0.03 (0.17)   0.198
##   age_onset (mean (SD))             12.23 (10.21)  12.44 (10.16)  0.855
##   gtcs (mean (SD))                   0.72 (0.45)    0.65 (0.48)   0.166
##   gtcs6 (mean (SD))                  0.33 (0.47)    0.36 (0.48)   0.506
##   numsz6 (mean (SD))                21.25 (37.25)  25.44 (60.15)  0.488
##   MRI_normal (mean (SD))             0.03 (0.18)    0.05 (0.21)   0.541
##   MRI_side (mean (SD))               0.71 (0.69)    0.67 (0.74)   0.669
##   MRI_lobar (mean (SD))              0.99 (0.46)    0.97 (0.57)   0.663
##   MRI_temp (mean (SD))               0.50 (0.67)    0.58 (0.73)   0.373
##   EEG_ictal_side (mean (SD))         0.67 (0.70)    0.76 (0.79)   0.298
##   EEG_ictal_temp (mean (SD))         0.76 (0.43)    0.83 (0.55)   0.194
##   EEG_ictal_focal (mean (SD))        0.75 (0.44)    0.71 (0.45)   0.506
##   EEG_interictal_normal (mean (SD))  0.15 (0.36)    0.20 (0.40)   0.235
##   icEEG (mean (SD))                  0.00 (0.00)    0.00 (0.00)   NaN  
##   PET (mean (SD))                    0.06 (0.24)    0.08 (0.28)   0.430
##   PET_side (mean (SD))               2.86 (0.59)    2.79 (0.74)   0.376
##   learning_disability (mean (SD))    0.08 (0.27)    0.03 (0.18)   0.091
##   psychiatric_pre_any (mean (SD))    0.46 (0.50)    0.42 (0.49)   0.451
##   duration (mean (SD))              21.43 (12.19)  23.08 (12.04)  0.226
##   age_at_surgery (mean (SD))        33.66 (10.50)  35.52 (10.62)  0.119
##   opside (mean (SD))                 0.60 (0.49)    0.50 (0.50)   0.094
##   optemp (mean (SD))                 0.92 (0.28)    0.88 (0.32)   0.345
##   opextent (mean (SD))               0.94 (0.33)    0.88 (0.37)   0.151
##   op_incomplete (mean (SD))          0.00 (0.00)    0.00 (0.00)   NaN  
##   pathology_HS (mean (SD))           0.72 (0.45)    0.70 (0.46)   0.618
##   pathology_FCD (mean (SD))          0.02 (0.13)    0.04 (0.19)   0.262
##   pathology_DNT (mean (SD))          0.12 (0.32)    0.11 (0.31)   0.791
##   pathology_CAV (mean (SD))          0.08 (0.27)    0.08 (0.27)   0.940
##   pathology_GL (mean (SD))           0.03 (0.16)    0.03 (0.17)   0.787
##   pathology_dual (mean (SD))         0.02 (0.13)    0.03 (0.18)   0.344
##   pathology_other (mean (SD))        0.04 (0.20)    0.08 (0.27)   0.200
##   pathology_normal (mean (SD))       0.00 (0.00)    0.00 (0.00)   NaN  
##   acutepostszauras (mean (SD))       0.04 (0.20)    0.08 (0.28)   0.159
##   sz (mean (SD))                     0.29 (0.45)    0.29 (0.45)   1.000
##   sz_time (mean (SD))                9.35 (6.35)    8.88 (6.21)   0.504
##   szaurafree1st (mean (SD))          0.99 (0.09)    0.99 (0.11)   0.703
##   aura (mean (SD))                   0.11 (0.31)    0.07 (0.26)   0.260
##   aura_time (mean (SD))             10.81 (6.42)   10.42 (6.20)   0.578
##   szaura (mean (SD))                 0.34 (0.47)    0.33 (0.47)   0.894
##   szaura_time (mean (SD))            8.82 (6.42)    8.49 (6.04)   0.636
##   began_wd (mean (SD))               0.93 (0.25)    0.88 (0.33)   0.116
##   began_wd_time (mean (SD))          2.50 (2.78)    3.03 (4.05)   0.202
##   age_began_wd (mean (SD))          35.77 (10.61)  38.20 (11.44)  0.055
##   wd_all (mean (SD))                 0.69 (0.46)    0.52 (0.50)   0.002
##   wd_all_time (mean (SD))            6.11 (4.80)    6.65 (5.57)   0.367
##   aeds (mean (SD))                   2.48 (0.82)    2.32 (0.84)   0.101
##   years_follow_up (mean (SD))       11.86 (6.22)   11.00 (6.16)   0.218
##   train (mean (SD))                  0.00 (0.00)    1.00 (0.00)  <0.001
##                                    Stratified by train
##                                     test
##   n                                     
##   Column_1 (mean (SD))                  
##   id (mean (SD))                        
##   auras (mean (SD))                     
##   withdraw1 (mean (SD))                 
##   sex (mean (SD))                       
##   childconvul (mean (SD))               
##   neuro_insult (mean (SD))              
##   status_epilepticus (mean (SD))        
##   family_history (mean (SD))            
##   non_epileptic (mean (SD))             
##   age_onset (mean (SD))                 
##   gtcs (mean (SD))                      
##   gtcs6 (mean (SD))                     
##   numsz6 (mean (SD))                    
##   MRI_normal (mean (SD))                
##   MRI_side (mean (SD))                  
##   MRI_lobar (mean (SD))                 
##   MRI_temp (mean (SD))                  
##   EEG_ictal_side (mean (SD))            
##   EEG_ictal_temp (mean (SD))            
##   EEG_ictal_focal (mean (SD))           
##   EEG_interictal_normal (mean (SD))     
##   icEEG (mean (SD))                     
##   PET (mean (SD))                       
##   PET_side (mean (SD))                  
##   learning_disability (mean (SD))       
##   psychiatric_pre_any (mean (SD))       
##   duration (mean (SD))                  
##   age_at_surgery (mean (SD))            
##   opside (mean (SD))                    
##   optemp (mean (SD))                    
##   opextent (mean (SD))                  
##   op_incomplete (mean (SD))             
##   pathology_HS (mean (SD))              
##   pathology_FCD (mean (SD))             
##   pathology_DNT (mean (SD))             
##   pathology_CAV (mean (SD))             
##   pathology_GL (mean (SD))              
##   pathology_dual (mean (SD))            
##   pathology_other (mean (SD))           
##   pathology_normal (mean (SD))          
##   acutepostszauras (mean (SD))          
##   sz (mean (SD))                        
##   sz_time (mean (SD))                   
##   szaurafree1st (mean (SD))             
##   aura (mean (SD))                      
##   aura_time (mean (SD))                 
##   szaura (mean (SD))                    
##   szaura_time (mean (SD))               
##   began_wd (mean (SD))                  
##   began_wd_time (mean (SD))             
##   age_began_wd (mean (SD))              
##   wd_all (mean (SD))                    
##   wd_all_time (mean (SD))               
##   aeds (mean (SD))                      
##   years_follow_up (mean (SD))           
##   train (mean (SD))
tab_all
##                                
##                                 Overall     
##   n                             350         
##   id = 1 (%)                    350 (100.0) 
##   auras = 1 (%)                  22 (  6.3) 
##   withdraw1 = 1 (%)             251 ( 71.7) 
##   sex = 1 (%)                   186 ( 53.1) 
##   childconvul = 1 (%)           186 ( 53.1) 
##   neuro_insult = 1 (%)          192 ( 54.9) 
##   status_epilepticus = 1 (%)     41 ( 11.7) 
##   family_history = 1 (%)         97 ( 27.7) 
##   non_epileptic = 1 (%)          14 (  4.0) 
##   gtcs = 1 (%)                  236 ( 67.4) 
##   gtcs6 = 1 (%)                 123 ( 35.1) 
##   MRI_normal = 1 (%)             15 (  4.3) 
##   MRI_side (%)                              
##      0                          149 ( 42.6) 
##      1                          178 ( 50.9) 
##      2                            8 (  2.3) 
##      3                           15 (  4.3) 
##   MRI_lobar (%)                             
##      0                           39 ( 11.1) 
##      1                          296 ( 84.6) 
##      3                           15 (  4.3) 
##   MRI_temp (%)                              
##      0                          187 ( 53.4) 
##      1                          148 ( 42.3) 
##      3                           15 (  4.3) 
##   EEG_ictal_side (%)                        
##      0                          151 ( 43.1) 
##      1                          152 ( 43.4) 
##      2                           37 ( 10.6) 
##      3                           10 (  2.9) 
##   EEG_ictal_temp (%)                        
##      0                           80 ( 22.9) 
##      1                          264 ( 75.4) 
##      3                            6 (  1.7) 
##   EEG_ictal_focal = 1 (%)       254 ( 72.6) 
##   EEG_interictal_normal = 1 (%)  65 ( 18.6) 
##   icEEG = 0 (%)                 350 (100.0) 
##   PET = 1 (%)                    26 (  7.4) 
##   PET_side (%)                              
##      0                           16 (  4.6) 
##      1                            9 (  2.6) 
##      3                          325 ( 92.9) 
##   learning_disability = 1 (%)    17 (  4.9) 
##   psychiatric_pre_any = 1 (%)   152 ( 43.4) 
##   opside = 1 (%)                187 ( 53.4) 
##   optemp = 1 (%)                313 ( 89.4) 
##   opextent (%)                              
##      0                           41 ( 11.7) 
##      1                          302 ( 86.3) 
##      2                            7 (  2.0) 
##   op_incomplete = 0 (%)         350 (100.0) 
##   pathology_HS = 1 (%)          247 ( 70.6) 
##   pathology_FCD = 1 (%)          11 (  3.1) 
##   pathology_DNT = 1 (%)          39 ( 11.1) 
##   pathology_CAV = 1 (%)          27 (  7.7) 
##   pathology_GL = 1 (%)           10 (  2.9) 
##   pathology_dual = 1 (%)         10 (  2.9) 
##   pathology_other = 1 (%)        23 (  6.6) 
##   pathology_normal = 0 (%)      350 (100.0) 
##   acutepostszauras = 1 (%)       24 (  6.9) 
##   sz = 1 (%)                    100 ( 28.6) 
##   szaurafree1st = 1 (%)         346 ( 98.9) 
##   aura = 1 (%)                   30 (  8.6) 
##   szaura = 1 (%)                116 ( 33.1) 
##   began_wd = 1 (%)              314 ( 89.7) 
##   wd_all = 1 (%)                202 ( 57.7) 
##   aeds (%)                                  
##      1                           43 ( 12.3) 
##      2                          162 ( 46.3) 
##      3                          121 ( 34.6) 
##      4                           19 (  5.4) 
##      5                            4 (  1.1) 
##      6                            1 (  0.3)
data <- read_xlsx("/Users/carolinaferreiraatuesta/Documents/UCL/Reserach Project/Datasets/derivation.xlsx")
set.seed(1234567)
split <- sample.split(data$sz,SplitRatio = 0.66)
train_set<- subset(data,split==T)
test_set<- subset(data,split==F)

1 Training Cohort

1.1 Univariable regression

lapply(c('auras',
'withdraw1',
'sex',
'childconvul ',
'neuro_insult',
'status_epilepticus ',
'family_history',
'non_epileptic',
'gtcs',
'gtcs6',
'numsz6',
'MRI_normal',
'MRI_side',
'MRI_lobar',
'MRI_temp',
'EEG_ictal_side',
'EEG_ictal_temp',
'EEG_ictal_focal',
'EEG_interictal_normal',
'icEEG',
'PET',
'PET_side',
'learning_disability',
'psychiatric_pre_any',
'opside',
'optemp',
'opextent',
'op_incomplete',
'pathology_HS ',
'pathology_FCD',
'pathology_DNT',
'pathology_CAV',
'pathology_GL',
'pathology_dual',
'pathology_other',
'pathology_normal',
'acutepostszauras',
'sz',
'szaurafree1st',
'aura',
'szaura',
'began_wd',
'wd_all',
'aeds',
'age_onset ',
'duration',
'age_at_surgery',
'sz_time',
'aura_time',
'szaura_time',
'began_wd_time',
'age_began_wd',
'wd_all_time',
'years_follow_up'),

function(var) {
  formula    <-
  as.formula(paste("Surv(time = train_set$sz_time, event = train_set$sz) ~", var))
  
res.logist <-
  coxph(formula, data = train_set)
  
  summary(res.logist)
}
)
## [[1]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##         coef exp(coef) se(coef)     z Pr(>|z|)    
## auras 1.1877    3.2796   0.3603 3.296 0.000979 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##       exp(coef) exp(-coef) lower .95 upper .95
## auras      3.28     0.3049     1.619     6.645
## 
## Concordance= 0.549  (se = 0.021 )
## Likelihood ratio test= 8.19  on 1 df,   p=0.004
## Wald test            = 10.87  on 1 df,   p=0.001
## Score (logrank) test = 12.2  on 1 df,   p=5e-04
## 
## 
## [[2]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##              coef exp(coef) se(coef)     z Pr(>|z|)
## withdraw1 0.05682   1.05847  0.26466 0.215     0.83
## 
##           exp(coef) exp(-coef) lower .95 upper .95
## withdraw1     1.058     0.9448    0.6301     1.778
## 
## Concordance= 0.517  (se = 0.029 )
## Likelihood ratio test= 0.05  on 1 df,   p=0.8
## Wald test            = 0.05  on 1 df,   p=0.8
## Score (logrank) test = 0.05  on 1 df,   p=0.8
## 
## 
## [[3]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##        coef exp(coef) se(coef)     z Pr(>|z|)
## sex 0.03977   1.04057  0.24670 0.161    0.872
## 
##     exp(coef) exp(-coef) lower .95 upper .95
## sex     1.041      0.961    0.6416     1.688
## 
## Concordance= 0.503  (se = 0.033 )
## Likelihood ratio test= 0.03  on 1 df,   p=0.9
## Wald test            = 0.03  on 1 df,   p=0.9
## Score (logrank) test = 0.03  on 1 df,   p=0.9
## 
## 
## [[4]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                coef exp(coef) se(coef)      z Pr(>|z|)
## childconvul -0.1477    0.8627   0.2466 -0.599    0.549
## 
##             exp(coef) exp(-coef) lower .95 upper .95
## childconvul    0.8627      1.159     0.532     1.399
## 
## Concordance= 0.52  (se = 0.033 )
## Likelihood ratio test= 0.36  on 1 df,   p=0.5
## Wald test            = 0.36  on 1 df,   p=0.5
## Score (logrank) test = 0.36  on 1 df,   p=0.5
## 
## 
## [[5]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                 coef exp(coef) se(coef)      z Pr(>|z|)
## neuro_insult -0.0925    0.9116   0.2473 -0.374    0.708
## 
##              exp(coef) exp(-coef) lower .95 upper .95
## neuro_insult    0.9116      1.097    0.5615      1.48
## 
## Concordance= 0.526  (se = 0.033 )
## Likelihood ratio test= 0.14  on 1 df,   p=0.7
## Wald test            = 0.14  on 1 df,   p=0.7
## Score (logrank) test = 0.14  on 1 df,   p=0.7
## 
## 
## [[6]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                      coef exp(coef) se(coef)    z Pr(>|z|)
## status_epilepticus 0.2791    1.3220   0.3773 0.74    0.459
## 
##                    exp(coef) exp(-coef) lower .95 upper .95
## status_epilepticus     1.322     0.7564    0.6311     2.769
## 
## Concordance= 0.513  (se = 0.019 )
## Likelihood ratio test= 0.51  on 1 df,   p=0.5
## Wald test            = 0.55  on 1 df,   p=0.5
## Score (logrank) test = 0.55  on 1 df,   p=0.5
## 
## 
## [[7]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                  coef exp(coef) se(coef)     z Pr(>|z|)
## family_history 0.2789    1.3216   0.2720 1.025    0.305
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## family_history     1.322     0.7566    0.7756     2.252
## 
## Concordance= 0.53  (se = 0.029 )
## Likelihood ratio test= 1.01  on 1 df,   p=0.3
## Wald test            = 1.05  on 1 df,   p=0.3
## Score (logrank) test = 1.06  on 1 df,   p=0.3
## 
## 
## [[8]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                  coef exp(coef) se(coef)      z Pr(>|z|)
## non_epileptic -0.6714    0.5110   1.0079 -0.666    0.505
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## non_epileptic     0.511      1.957   0.07087     3.684
## 
## Concordance= 0.504  (se = 0.012 )
## Likelihood ratio test= 0.56  on 1 df,   p=0.5
## Wald test            = 0.44  on 1 df,   p=0.5
## Score (logrank) test = 0.46  on 1 df,   p=0.5
## 
## 
## [[9]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##        coef exp(coef) se(coef)     z Pr(>|z|)  
## gtcs 0.5711    1.7703   0.2873 1.988   0.0468 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      exp(coef) exp(-coef) lower .95 upper .95
## gtcs      1.77     0.5649     1.008     3.109
## 
## Concordance= 0.573  (se = 0.027 )
## Likelihood ratio test= 4.32  on 1 df,   p=0.04
## Wald test            = 3.95  on 1 df,   p=0.05
## Score (logrank) test = 4.06  on 1 df,   p=0.04
## 
## 
## [[10]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##         coef exp(coef) se(coef)     z Pr(>|z|)  
## gtcs6 0.5539    1.7401   0.2468 2.244   0.0248 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##       exp(coef) exp(-coef) lower .95 upper .95
## gtcs6      1.74     0.5747     1.073     2.823
## 
## Concordance= 0.572  (se = 0.032 )
## Likelihood ratio test= 4.92  on 1 df,   p=0.03
## Wald test            = 5.04  on 1 df,   p=0.02
## Score (logrank) test = 5.17  on 1 df,   p=0.02
## 
## 
## [[11]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##             coef exp(coef)  se(coef)     z Pr(>|z|)
## numsz6 0.0009617 1.0009622 0.0016044 0.599    0.549
## 
##        exp(coef) exp(-coef) lower .95 upper .95
## numsz6     1.001      0.999    0.9978     1.004
## 
## Concordance= 0.557  (se = 0.041 )
## Likelihood ratio test= 0.31  on 1 df,   p=0.6
## Wald test            = 0.36  on 1 df,   p=0.5
## Score (logrank) test = 0.36  on 1 df,   p=0.5
## 
## 
## [[12]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                  coef  exp(coef)   se(coef)      z Pr(>|z|)
## MRI_normal -1.707e+01  3.856e-08  3.080e+03 -0.006    0.996
## 
##            exp(coef) exp(-coef) lower .95 upper .95
## MRI_normal 3.856e-08   25933319         0       Inf
## 
## Concordance= 0.522  (se = 0.007 )
## Likelihood ratio test= 5.35  on 1 df,   p=0.02
## Wald test            = 0  on 1 df,   p=1
## Score (logrank) test = 2.73  on 1 df,   p=0.1
## 
## 
## [[13]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##             coef exp(coef) se(coef)      z Pr(>|z|)
## MRI_side -0.2343    0.7911   0.1935 -1.211    0.226
## 
##          exp(coef) exp(-coef) lower .95 upper .95
## MRI_side    0.7911      1.264    0.5414     1.156
## 
## Concordance= 0.52  (se = 0.032 )
## Likelihood ratio test= 1.57  on 1 df,   p=0.2
## Wald test            = 1.47  on 1 df,   p=0.2
## Score (logrank) test = 1.47  on 1 df,   p=0.2
## 
## 
## [[14]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##              coef exp(coef) se(coef)      z Pr(>|z|)
## MRI_lobar -0.4203    0.6568   0.2649 -1.587    0.113
## 
##           exp(coef) exp(-coef) lower .95 upper .95
## MRI_lobar    0.6568      1.522    0.3908     1.104
## 
## Concordance= 0.527  (se = 0.022 )
## Likelihood ratio test= 2.67  on 1 df,   p=0.1
## Wald test            = 2.52  on 1 df,   p=0.1
## Score (logrank) test = 2.43  on 1 df,   p=0.1
## 
## 
## [[15]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##             coef exp(coef) se(coef)      z Pr(>|z|)  
## MRI_temp -0.3500    0.7047   0.2102 -1.665   0.0959 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##          exp(coef) exp(-coef) lower .95 upper .95
## MRI_temp    0.7047      1.419    0.4668     1.064
## 
## Concordance= 0.541  (se = 0.032 )
## Likelihood ratio test= 3.1  on 1 df,   p=0.08
## Wald test            = 2.77  on 1 df,   p=0.1
## Score (logrank) test = 2.77  on 1 df,   p=0.1
## 
## 
## [[16]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                   coef exp(coef) se(coef)      z Pr(>|z|)
## EEG_ictal_side -0.1395    0.8698   0.1680 -0.831    0.406
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## EEG_ictal_side    0.8698       1.15    0.6257     1.209
## 
## Concordance= 0.532  (se = 0.035 )
## Likelihood ratio test= 0.71  on 1 df,   p=0.4
## Wald test            = 0.69  on 1 df,   p=0.4
## Score (logrank) test = 0.69  on 1 df,   p=0.4
## 
## 
## [[17]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                   coef exp(coef) se(coef)      z Pr(>|z|)
## EEG_ictal_temp -0.1287    0.8792   0.2585 -0.498    0.618
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## EEG_ictal_temp    0.8792      1.137    0.5297     1.459
## 
## Concordance= 0.515  (se = 0.028 )
## Likelihood ratio test= 0.25  on 1 df,   p=0.6
## Wald test            = 0.25  on 1 df,   p=0.6
## Score (logrank) test = 0.25  on 1 df,   p=0.6
## 
## 
## [[18]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                   coef exp(coef) se(coef)     z Pr(>|z|)
## EEG_ictal_focal 0.3744    1.4541   0.3011 1.243    0.214
## 
##                 exp(coef) exp(-coef) lower .95 upper .95
## EEG_ictal_focal     1.454     0.6877    0.8059     2.624
## 
## Concordance= 0.531  (se = 0.028 )
## Likelihood ratio test= 1.66  on 1 df,   p=0.2
## Wald test            = 1.55  on 1 df,   p=0.2
## Score (logrank) test = 1.56  on 1 df,   p=0.2
## 
## 
## [[19]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                          coef exp(coef) se(coef)      z Pr(>|z|)
## EEG_interictal_normal -0.3119    0.7321   0.3434 -0.908    0.364
## 
##                       exp(coef) exp(-coef) lower .95 upper .95
## EEG_interictal_normal    0.7321      1.366    0.3734     1.435
## 
## Concordance= 0.537  (se = 0.021 )
## Likelihood ratio test= 0.89  on 1 df,   p=0.3
## Wald test            = 0.82  on 1 df,   p=0.4
## Score (logrank) test = 0.83  on 1 df,   p=0.4
## 
## 
## [[20]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##       coef exp(coef) se(coef)  z Pr(>|z|)
## icEEG   NA        NA        0 NA       NA
## 
##       exp(coef) exp(-coef) lower .95 upper .95
## icEEG        NA         NA        NA        NA
## 
## Concordance= 0.5  (se = 0 )
## Likelihood ratio test= 0  on 0 df,   p=1
## Wald test            = NA  on 0 df,   p=NA
## Score (logrank) test = 0  on 0 df,   p=1
## 
## 
## [[21]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##        coef exp(coef) se(coef)      z Pr(>|z|)
## PET -0.8071    0.4462   0.7193 -1.122    0.262
## 
##     exp(coef) exp(-coef) lower .95 upper .95
## PET    0.4462      2.241    0.1089     1.827
## 
## Concordance= 0.519  (se = 0.014 )
## Likelihood ratio test= 1.64  on 1 df,   p=0.2
## Wald test            = 1.26  on 1 df,   p=0.3
## Score (logrank) test = 1.33  on 1 df,   p=0.2
## 
## 
## [[22]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##            coef exp(coef) se(coef)    z Pr(>|z|)
## PET_side 0.2442    1.2766   0.2491 0.98    0.327
## 
##          exp(coef) exp(-coef) lower .95 upper .95
## PET_side     1.277     0.7833    0.7834      2.08
## 
## Concordance= 0.517  (se = 0.014 )
## Likelihood ratio test= 1.2  on 1 df,   p=0.3
## Wald test            = 0.96  on 1 df,   p=0.3
## Score (logrank) test = 1  on 1 df,   p=0.3
## 
## 
## [[23]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                        coef exp(coef) se(coef)      z Pr(>|z|)
## learning_disability -0.1504    0.8604   0.7186 -0.209    0.834
## 
##                     exp(coef) exp(-coef) lower .95 upper .95
## learning_disability    0.8604      1.162    0.2104     3.518
## 
## Concordance= 0.501  (se = 0.012 )
## Likelihood ratio test= 0.05  on 1 df,   p=0.8
## Wald test            = 0.04  on 1 df,   p=0.8
## Score (logrank) test = 0.04  on 1 df,   p=0.8
## 
## 
## [[24]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                       coef exp(coef) se(coef)     z Pr(>|z|)
## psychiatric_pre_any 0.1958    1.2163   0.2474 0.792    0.429
## 
##                     exp(coef) exp(-coef) lower .95 upper .95
## psychiatric_pre_any     1.216     0.8222     0.749     1.975
## 
## Concordance= 0.525  (se = 0.032 )
## Likelihood ratio test= 0.62  on 1 df,   p=0.4
## Wald test            = 0.63  on 1 df,   p=0.4
## Score (logrank) test = 0.63  on 1 df,   p=0.4
## 
## 
## [[25]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##           coef exp(coef) se(coef)      z Pr(>|z|)
## opside -0.1053    0.9001   0.2467 -0.427     0.67
## 
##        exp(coef) exp(-coef) lower .95 upper .95
## opside    0.9001      1.111     0.555      1.46
## 
## Concordance= 0.51  (se = 0.033 )
## Likelihood ratio test= 0.18  on 1 df,   p=0.7
## Wald test            = 0.18  on 1 df,   p=0.7
## Score (logrank) test = 0.18  on 1 df,   p=0.7
## 
## 
## [[26]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##           coef exp(coef) se(coef)     z Pr(>|z|)
## optemp 0.02514   1.02546  0.40008 0.063     0.95
## 
##        exp(coef) exp(-coef) lower .95 upper .95
## optemp     1.025     0.9752    0.4681     2.246
## 
## Concordance= 0.497  (se = 0.022 )
## Likelihood ratio test= 0  on 1 df,   p=0.9
## Wald test            = 0  on 1 df,   p=0.9
## Score (logrank) test = 0  on 1 df,   p=0.9
## 
## 
## [[27]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##             coef exp(coef) se(coef)     z Pr(>|z|)
## opextent 0.06502   1.06718  0.32128 0.202     0.84
## 
##          exp(coef) exp(-coef) lower .95 upper .95
## opextent     1.067      0.937    0.5685     2.003
## 
## Concordance= 0.505  (se = 0.021 )
## Likelihood ratio test= 0.04  on 1 df,   p=0.8
## Wald test            = 0.04  on 1 df,   p=0.8
## Score (logrank) test = 0.04  on 1 df,   p=0.8
## 
## 
## [[28]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##               coef exp(coef) se(coef)  z Pr(>|z|)
## op_incomplete   NA        NA        0 NA       NA
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## op_incomplete        NA         NA        NA        NA
## 
## Concordance= 0.5  (se = 0 )
## Likelihood ratio test= 0  on 0 df,   p=1
## Wald test            = NA  on 0 df,   p=NA
## Score (logrank) test = 0  on 0 df,   p=1
## 
## 
## [[29]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                coef exp(coef) se(coef)     z Pr(>|z|)
## pathology_HS 0.3497    1.4186   0.2873 1.217    0.224
## 
##              exp(coef) exp(-coef) lower .95 upper .95
## pathology_HS     1.419     0.7049    0.8078     2.491
## 
## Concordance= 0.535  (se = 0.029 )
## Likelihood ratio test= 1.57  on 1 df,   p=0.2
## Wald test            = 1.48  on 1 df,   p=0.2
## Score (logrank) test = 1.5  on 1 df,   p=0.2
## 
## 
## [[30]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                   coef exp(coef) se(coef)      z Pr(>|z|)
## pathology_FCD -0.04376   0.95718  0.71907 -0.061    0.951
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## pathology_FCD    0.9572      1.045    0.2338     3.918
## 
## Concordance= 0.499  (se = 0.013 )
## Likelihood ratio test= 0  on 1 df,   p=1
## Wald test            = 0  on 1 df,   p=1
## Score (logrank) test = 0  on 1 df,   p=1
## 
## 
## [[31]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                   coef exp(coef) se(coef)     z Pr(>|z|)
## pathology_DNT -0.07201   0.93052  0.40001 -0.18    0.857
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## pathology_DNT    0.9305      1.075    0.4249     2.038
## 
## Concordance= 0.501  (se = 0.02 )
## Likelihood ratio test= 0.03  on 1 df,   p=0.9
## Wald test            = 0.03  on 1 df,   p=0.9
## Score (logrank) test = 0.03  on 1 df,   p=0.9
## 
## 
## [[32]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                  coef exp(coef) se(coef)      z Pr(>|z|)
## pathology_CAV -0.3493    0.7052   0.5161 -0.677    0.499
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## pathology_CAV    0.7052      1.418    0.2565     1.939
## 
## Concordance= 0.518  (se = 0.015 )
## Likelihood ratio test= 0.51  on 1 df,   p=0.5
## Wald test            = 0.46  on 1 df,   p=0.5
## Score (logrank) test = 0.46  on 1 df,   p=0.5
## 
## 
## [[33]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                coef exp(coef) se(coef)     z Pr(>|z|)
## pathology_GL 0.1205    1.1280   0.7184 0.168    0.867
## 
##              exp(coef) exp(-coef) lower .95 upper .95
## pathology_GL     1.128     0.8865     0.276     4.611
## 
## Concordance= 0.503  (se = 0.012 )
## Likelihood ratio test= 0.03  on 1 df,   p=0.9
## Wald test            = 0.03  on 1 df,   p=0.9
## Score (logrank) test = 0.03  on 1 df,   p=0.9
## 
## 
## [[34]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                   coef exp(coef) se(coef)      z Pr(>|z|)
## pathology_dual -0.5614    0.5704   1.0085 -0.557    0.578
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## pathology_dual    0.5704      1.753   0.07902     4.118
## 
## Concordance= 0.507  (se = 0.008 )
## Likelihood ratio test= 0.37  on 1 df,   p=0.5
## Wald test            = 0.31  on 1 df,   p=0.6
## Score (logrank) test = 0.32  on 1 df,   p=0.6
## 
## 
## [[35]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                    coef exp(coef) se(coef)     z Pr(>|z|)
## pathology_other -1.0125    0.3633   0.7183 -1.41    0.159
## 
##                 exp(coef) exp(-coef) lower .95 upper .95
## pathology_other    0.3633      2.752    0.0889     1.485
## 
## Concordance= 0.525  (se = 0.014 )
## Likelihood ratio test= 2.78  on 1 df,   p=0.1
## Wald test            = 1.99  on 1 df,   p=0.2
## Score (logrank) test = 2.16  on 1 df,   p=0.1
## 
## 
## [[36]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                  coef exp(coef) se(coef)  z Pr(>|z|)
## pathology_normal   NA        NA        0 NA       NA
## 
##                  exp(coef) exp(-coef) lower .95 upper .95
## pathology_normal        NA         NA        NA        NA
## 
## Concordance= 0.5  (se = 0 )
## Likelihood ratio test= 0  on 0 df,   p=1
## Wald test            = NA  on 0 df,   p=NA
## Score (logrank) test = 0  on 0 df,   p=1
## 
## 
## [[37]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                     coef exp(coef) se(coef)      z Pr(>|z|)
## acutepostszauras -0.7892    0.4542   0.5916 -1.334    0.182
## 
##                  exp(coef) exp(-coef) lower .95 upper .95
## acutepostszauras    0.4542      2.202    0.1424     1.448
## 
## Concordance= 0.522  (se = 0.017 )
## Likelihood ratio test= 2.28  on 1 df,   p=0.1
## Wald test            = 1.78  on 1 df,   p=0.2
## Score (logrank) test = 1.87  on 1 df,   p=0.2
## 
## 
## [[38]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##         coef exp(coef)  se(coef)     z Pr(>|z|)
## sz 2.306e+01 1.032e+10 4.646e+03 0.005    0.996
## 
##    exp(coef) exp(-coef) lower .95 upper .95
## sz 1.032e+10  9.689e-11         0       Inf
## 
## Concordance= 0.917  (se = 0.011 )
## Likelihood ratio test= 249.3  on 1 df,   p=<2e-16
## Wald test            = 0  on 1 df,   p=1
## Score (logrank) test = 327.6  on 1 df,   p=<2e-16
## 
## 
## [[39]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##               coef exp(coef) se(coef)  z Pr(>|z|)
## szaurafree1st   NA        NA        0 NA       NA
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## szaurafree1st        NA         NA        NA        NA
## 
## Concordance= 0.53  (se = 0.017 )
## Likelihood ratio test= 29.04  on 0 df,   p=<2e-16
## Wald test            = NA  on 0 df,   p=NA
## Score (logrank) test = 343  on 0 df,   p=<2e-16
## 
## 
## [[40]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##        coef exp(coef) se(coef)     z Pr(>|z|)
## aura 0.3711    1.4493   0.4000 0.928    0.354
## 
##      exp(coef) exp(-coef) lower .95 upper .95
## aura     1.449       0.69    0.6617     3.174
## 
## Concordance= 0.519  (se = 0.02 )
## Likelihood ratio test= 0.78  on 1 df,   p=0.4
## Wald test            = 0.86  on 1 df,   p=0.4
## Score (logrank) test = 0.87  on 1 df,   p=0.4
## 
## 
## [[41]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##             coef exp(coef)  se(coef)     z Pr(>|z|)
## szaura 2.146e+01 2.099e+09 2.958e+03 0.007    0.994
## 
##        exp(coef) exp(-coef) lower .95 upper .95
## szaura 2.099e+09  4.763e-10         0       Inf
## 
## Concordance= 0.888  (se = 0.013 )
## Likelihood ratio test= 197.2  on 1 df,   p=<2e-16
## Wald test            = 0  on 1 df,   p=1
## Score (logrank) test = 222.1  on 1 df,   p=<2e-16
## 
## 
## [[42]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##              coef exp(coef) se(coef)      z Pr(>|z|)
## began_wd -0.04439   0.95658  0.42996 -0.103    0.918
## 
##          exp(coef) exp(-coef) lower .95 upper .95
## began_wd    0.9566      1.045    0.4119     2.222
## 
## Concordance= 0.501  (se = 0.019 )
## Likelihood ratio test= 0.01  on 1 df,   p=0.9
## Wald test            = 0.01  on 1 df,   p=0.9
## Score (logrank) test = 0.01  on 1 df,   p=0.9
## 
## 
## [[43]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##          coef exp(coef) se(coef)     z Pr(>|z|)
## wd_all 0.1267    1.1351   0.2494 0.508    0.611
## 
##        exp(coef) exp(-coef) lower .95 upper .95
## wd_all     1.135      0.881    0.6962     1.851
## 
## Concordance= 0.525  (se = 0.032 )
## Likelihood ratio test= 0.26  on 1 df,   p=0.6
## Wald test            = 0.26  on 1 df,   p=0.6
## Score (logrank) test = 0.26  on 1 df,   p=0.6
## 
## 
## [[44]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##        coef exp(coef) se(coef)     z Pr(>|z|)  
## aeds 0.2668    1.3058   0.1431 1.865   0.0622 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      exp(coef) exp(-coef) lower .95 upper .95
## aeds     1.306     0.7658    0.9864     1.729
## 
## Concordance= 0.568  (se = 0.036 )
## Likelihood ratio test= 3.35  on 1 df,   p=0.07
## Wald test            = 3.48  on 1 df,   p=0.06
## Score (logrank) test = 3.47  on 1 df,   p=0.06
## 
## 
## [[45]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##               coef exp(coef) se(coef)      z Pr(>|z|)
## age_onset -0.00123   0.99877  0.01292 -0.095    0.924
## 
##           exp(coef) exp(-coef) lower .95 upper .95
## age_onset    0.9988      1.001    0.9738     1.024
## 
## Concordance= 0.498  (se = 0.037 )
## Likelihood ratio test= 0.01  on 1 df,   p=0.9
## Wald test            = 0.01  on 1 df,   p=0.9
## Score (logrank) test = 0.01  on 1 df,   p=0.9
## 
## 
## [[46]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##             coef exp(coef) se(coef)     z Pr(>|z|)
## duration 0.01242   1.01250  0.01029 1.207    0.228
## 
##          exp(coef) exp(-coef) lower .95 upper .95
## duration     1.012     0.9877    0.9923     1.033
## 
## Concordance= 0.533  (se = 0.039 )
## Likelihood ratio test= 1.43  on 1 df,   p=0.2
## Wald test            = 1.46  on 1 df,   p=0.2
## Score (logrank) test = 1.46  on 1 df,   p=0.2
## 
## 
## [[47]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                   coef exp(coef) se(coef)     z Pr(>|z|)
## age_at_surgery 0.01565   1.01577  0.01195 1.309    0.191
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## age_at_surgery     1.016     0.9845    0.9922      1.04
## 
## Concordance= 0.541  (se = 0.038 )
## Likelihood ratio test= 1.69  on 1 df,   p=0.2
## Wald test            = 1.71  on 1 df,   p=0.2
## Score (logrank) test = 1.72  on 1 df,   p=0.2
## 
## 
## [[48]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##               coef  exp(coef)   se(coef)      z Pr(>|z|)
## sz_time -8.074e+01  8.638e-36  6.341e+01 -1.273    0.203
## 
##         exp(coef) exp(-coef) lower .95 upper .95
## sz_time 8.638e-36  1.158e+35 9.106e-90 8.195e+18
## 
## Concordance= 0.995  (se = 0.001 )
## Likelihood ratio test= 459.2  on 1 df,   p=<2e-16
## Wald test            = 1.62  on 1 df,   p=0.2
## Score (logrank) test = 117  on 1 df,   p=<2e-16
## 
## 
## [[49]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##               coef exp(coef) se(coef)      z Pr(>|z|)  
## aura_time -0.04384   0.95710  0.02301 -1.905   0.0567 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##           exp(coef) exp(-coef) lower .95 upper .95
## aura_time    0.9571      1.045    0.9149     1.001
## 
## Concordance= 0.594  (se = 0.038 )
## Likelihood ratio test= 3.77  on 1 df,   p=0.05
## Wald test            = 3.63  on 1 df,   p=0.06
## Score (logrank) test = 3.66  on 1 df,   p=0.06
## 
## 
## [[50]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                 coef exp(coef) se(coef)      z Pr(>|z|)    
## szaura_time -0.53076   0.58816  0.05968 -8.894   <2e-16 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##             exp(coef) exp(-coef) lower .95 upper .95
## szaura_time    0.5882        1.7    0.5232    0.6611
## 
## Concordance= 0.977  (se = 0.007 )
## Likelihood ratio test= 166.5  on 1 df,   p=<2e-16
## Wald test            = 79.1  on 1 df,   p=<2e-16
## Score (logrank) test = 105.8  on 1 df,   p=<2e-16
## 
## 
## [[51]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                   coef exp(coef) se(coef)      z Pr(>|z|)
## began_wd_time -0.04632   0.95474  0.03578 -1.294    0.196
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## began_wd_time    0.9547      1.047    0.8901     1.024
## 
## Concordance= 0.588  (se = 0.036 )
## Likelihood ratio test= 1.95  on 1 df,   p=0.2
## Wald test            = 1.68  on 1 df,   p=0.2
## Score (logrank) test = 1.7  on 1 df,   p=0.2
## 
## 
## [[52]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                  coef exp(coef) se(coef)     z Pr(>|z|)
## age_began_wd 0.007294  1.007321 0.010962 0.665    0.506
## 
##              exp(coef) exp(-coef) lower .95 upper .95
## age_began_wd     1.007     0.9927    0.9859     1.029
## 
## Concordance= 0.515  (se = 0.038 )
## Likelihood ratio test= 0.44  on 1 df,   p=0.5
## Wald test            = 0.44  on 1 df,   p=0.5
## Score (logrank) test = 0.44  on 1 df,   p=0.5
## 
## 
## [[53]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                 coef exp(coef) se(coef)      z Pr(>|z|)  
## wd_all_time -0.04287   0.95803  0.02481 -1.728    0.084 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##             exp(coef) exp(-coef) lower .95 upper .95
## wd_all_time     0.958      1.044    0.9126     1.006
## 
## Concordance= 0.619  (se = 0.036 )
## Likelihood ratio test= 3.27  on 1 df,   p=0.07
## Wald test            = 2.99  on 1 df,   p=0.08
## Score (logrank) test = 3.02  on 1 df,   p=0.08
## 
## 
## [[54]]
## Call:
## coxph(formula = formula, data = train_set)
## 
##   n= 231, number of events= 66 
## 
##                     coef exp(coef) se(coef)      z Pr(>|z|)  
## years_follow_up -0.04003   0.96076  0.02340 -1.711   0.0871 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                 exp(coef) exp(-coef) lower .95 upper .95
## years_follow_up    0.9608      1.041    0.9177     1.006
## 
## Concordance= 0.582  (se = 0.037 )
## Likelihood ratio test= 3.04  on 1 df,   p=0.08
## Wald test            = 2.93  on 1 df,   p=0.09
## Score (logrank) test = 2.95  on 1 df,   p=0.09

1.2 Kaplan-Meier

km_train<- survfit(Surv(train_set$sz_time, train_set$sz) ~ 1, data= train_set, type =
"kaplan-meier", conf.type = "plain")
summary(km_train, times = c(0,1,2,5,10,15, 20,23))
## Call: survfit(formula = Surv(train_set$sz_time, train_set$sz) ~ 1, 
##     data = train_set, type = "kaplan-meier", conf.type = "plain")
## 
##  time n.risk n.event survival std.err lower 95% CI upper 95% CI
##     0    231       0    1.000  0.0000        1.000        1.000
##     1    228       6    0.974  0.0105        0.954        0.995
##     2    217      22    0.877  0.0217        0.835        0.920
##     5    147      23    0.765  0.0289        0.709        0.822
##    10     91      12    0.692  0.0330        0.627        0.757
##    15     46       3    0.658  0.0371        0.585        0.730
##    20     17       0    0.658  0.0371        0.585        0.730
##    23      4       0    0.658  0.0371        0.585        0.730
km1_train<- ggsurvplot(km_train, data = train_set, xlab = "Time (years)", ylab = "Proportion of seizure free patients after withdrawal", palette  = 'black', xlim = c(0,15),ylim = c(0,1),  break.time.by = 5, font.x =14 ,font.y = 14, font.tickslab = 10, show.legend.text = F)
km1_train

1.3 Model: Predicting seizure relapse after AED withdrawal after surgery

model1_train <-
  coxph(
    Surv(time = train_set$sz_time, event = train_set$sz) ~ train_set$auras + train_set$began_wd_time +  train_set$duration + train_set$aeds+ train_set$gtcs + train_set$MRI_temp + train_set$MRI_normal  + train_set$pathology_HS,
    x = TRUE,
    y = TRUE,
    data = train_set
  )
print(model1_train)
## Call:
## coxph(formula = Surv(time = train_set$sz_time, event = train_set$sz) ~ 
##     train_set$auras + train_set$began_wd_time + train_set$duration + 
##         train_set$aeds + train_set$gtcs + train_set$MRI_temp + 
##         train_set$MRI_normal + train_set$pathology_HS, data = train_set, 
##     x = TRUE, y = TRUE)
## 
##                               coef  exp(coef)   se(coef)      z       p
## train_set$auras          1.517e+00  4.560e+00  3.832e-01  3.960 7.5e-05
## train_set$began_wd_time -7.298e-02  9.296e-01  3.777e-02 -1.932  0.0533
## train_set$duration      -1.232e-03  9.988e-01  1.157e-02 -0.106  0.9152
## train_set$aeds           2.718e-01  1.312e+00  1.519e-01  1.789  0.0736
## train_set$gtcs           6.067e-01  1.834e+00  2.906e-01  2.088  0.0368
## train_set$MRI_temp      -4.883e-02  9.523e-01  2.513e-01 -0.194  0.8459
## train_set$MRI_normal    -1.717e+01  3.496e-08  3.644e+03 -0.005  0.9962
## train_set$pathology_HS   2.075e-01  1.231e+00  3.091e-01  0.671  0.5020
## 
## Likelihood ratio test=27.75  on 8 df, p=0.0005241
## n= 231, number of events= 66

1.4 Stepwise reduction using AIC

step(model1_train, direction = "both")
## Start:  AIC=664.62
## Surv(time = train_set$sz_time, event = train_set$sz) ~ train_set$auras + 
##     train_set$began_wd_time + train_set$duration + train_set$aeds + 
##     train_set$gtcs + train_set$MRI_temp + train_set$MRI_normal + 
##     train_set$pathology_HS
## 
##                           Df    AIC
## - train_set$duration       1 662.63
## - train_set$MRI_temp       1 662.66
## - train_set$pathology_HS   1 663.08
## <none>                       664.62
## - train_set$aeds           1 665.73
## - train_set$MRI_normal     1 665.75
## - train_set$began_wd_time  1 667.33
## - train_set$gtcs           1 667.39
## - train_set$auras          1 674.27
## 
## Step:  AIC=662.63
## Surv(time = train_set$sz_time, event = train_set$sz) ~ train_set$auras + 
##     train_set$began_wd_time + train_set$aeds + train_set$gtcs + 
##     train_set$MRI_temp + train_set$MRI_normal + train_set$pathology_HS
## 
##                           Df    AIC
## - train_set$MRI_temp       1 660.67
## - train_set$pathology_HS   1 661.10
## <none>                       662.63
## - train_set$aeds           1 663.77
## - train_set$MRI_normal     1 663.78
## + train_set$duration       1 664.62
## - train_set$began_wd_time  1 665.33
## - train_set$gtcs           1 665.42
## - train_set$auras          1 672.37
## 
## Step:  AIC=660.67
## Surv(time = train_set$sz_time, event = train_set$sz) ~ train_set$auras + 
##     train_set$began_wd_time + train_set$aeds + train_set$gtcs + 
##     train_set$MRI_normal + train_set$pathology_HS
## 
##                           Df    AIC
## - train_set$pathology_HS   1 659.14
## <none>                       660.67
## - train_set$aeds           1 661.86
## + train_set$MRI_temp       1 662.63
## + train_set$duration       1 662.66
## - train_set$MRI_normal     1 663.31
## - train_set$began_wd_time  1 663.36
## - train_set$gtcs           1 663.55
## - train_set$auras          1 670.45
## 
## Step:  AIC=659.14
## Surv(time = train_set$sz_time, event = train_set$sz) ~ train_set$auras + 
##     train_set$began_wd_time + train_set$aeds + train_set$gtcs + 
##     train_set$MRI_normal
## 
##                           Df    AIC
## <none>                       659.14
## - train_set$aeds           1 660.24
## + train_set$pathology_HS   1 660.67
## + train_set$MRI_temp       1 661.10
## + train_set$duration       1 661.12
## - train_set$began_wd_time  1 661.69
## - train_set$gtcs           1 662.09
## - train_set$MRI_normal     1 662.34
## - train_set$auras          1 669.55
## Call:
## coxph(formula = Surv(time = train_set$sz_time, event = train_set$sz) ~ 
##     train_set$auras + train_set$began_wd_time + train_set$aeds + 
##         train_set$gtcs + train_set$MRI_normal, data = train_set, 
##     x = TRUE, y = TRUE)
## 
##                               coef  exp(coef)   se(coef)      z        p
## train_set$auras          1.552e+00  4.722e+00  3.735e-01  4.156 3.24e-05
## train_set$began_wd_time -7.186e-02  9.307e-01  3.775e-02 -1.904   0.0569
## train_set$aeds           2.627e-01  1.300e+00  1.467e-01  1.790   0.0734
## train_set$gtcs           6.109e-01  1.842e+00  2.878e-01  2.122   0.0338
## train_set$MRI_normal    -1.739e+01  2.808e-08  3.647e+03 -0.005   0.9962
## 
## Likelihood ratio test=27.23  on 5 df, p=5.155e-05
## n= 231, number of events= 66

1.5 Final model

model1f_train <-
  coxph(
    Surv(time = train_set$sz_time, event = train_set$sz) ~ train_set$auras + train_set$began_wd_time + train_set$aeds + train_set$gtcs +train_set$MRI_normal
  )
summary(model1f_train)
## Call:
## coxph(formula = Surv(time = train_set$sz_time, event = train_set$sz) ~ 
##     train_set$auras + train_set$began_wd_time + train_set$aeds + 
##         train_set$gtcs + train_set$MRI_normal)
## 
##   n= 231, number of events= 66 
## 
##                               coef  exp(coef)   se(coef)      z Pr(>|z|)
## train_set$auras          1.552e+00  4.722e+00  3.735e-01  4.156 3.24e-05
## train_set$began_wd_time -7.186e-02  9.307e-01  3.775e-02 -1.904   0.0569
## train_set$aeds           2.627e-01  1.300e+00  1.467e-01  1.790   0.0734
## train_set$gtcs           6.109e-01  1.842e+00  2.878e-01  2.122   0.0338
## train_set$MRI_normal    -1.739e+01  2.808e-08  3.647e+03 -0.005   0.9962
##                            
## train_set$auras         ***
## train_set$began_wd_time .  
## train_set$aeds          .  
## train_set$gtcs          *  
## train_set$MRI_normal       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                         exp(coef) exp(-coef) lower .95 upper .95
## train_set$auras         4.722e+00  2.118e-01    2.2709     9.820
## train_set$began_wd_time 9.307e-01  1.075e+00    0.8643     1.002
## train_set$aeds          1.300e+00  7.690e-01    0.9754     1.734
## train_set$gtcs          1.842e+00  5.429e-01    1.0478     3.238
## train_set$MRI_normal    2.808e-08  3.561e+07    0.0000       Inf
## 
## Concordance= 0.707  (se = 0.03 )
## Likelihood ratio test= 27.23  on 5 df,   p=5e-05
## Wald test            = 25.11  on 5 df,   p=1e-04
## Score (logrank) test = 29.5  on 5 df,   p=2e-05

1.6 Internal validadion

1.6.1 Discrimination

fitmodel1f_train <-
  cph(
    Surv(time = sz_time, event = sz) ~ auras + began_wd_time + aeds + gtcs +MRI_normal,
    data = train_set,
    x = TRUE,
    y = TRUE,
    surv = TRUE,
    time.inc = 2
  )
fitmodel1f_train
## Cox Proportional Hazards Model
##  
##  cph(formula = Surv(time = sz_time, event = sz) ~ auras + began_wd_time + 
##      aeds + gtcs + MRI_normal, data = train_set, x = TRUE, y = TRUE, 
##      surv = TRUE, time.inc = 2)
##  
##                      Model Tests       Discrimination    
##                                           Indexes        
##  Obs       231    LR chi2     27.20    R2       0.117    
##  Events     66    d.f.            5    Dxy      0.414    
##  Center 0.6269    Pr(> chi2) 0.0001    g        1.019    
##                   Score chi2  29.50    gr       2.770    
##                   Pr(> chi2) 0.0000                      
##  
##                Coef    S.E.   Wald Z Pr(>|Z|)
##  auras          1.5523 0.3736  4.16  <0.0001 
##  began_wd_time -0.0719 0.0377 -1.90  0.0569  
##  aeds           0.2627 0.1467  1.79  0.0734  
##  gtcs           0.6109 0.2878  2.12  0.0338  
##  MRI_normal    -5.3878 9.0409 -0.60  0.5512  
## 
rms::validate(fitmodel1f_train, dxy = TRUE, B = 1000)
##       index.orig training   test optimism index.corrected    n
## Dxy       0.4142   0.4280 0.3875   0.0405          0.3737 1000
## R2        0.1174   0.1365 0.1037   0.0328          0.0846 1000
## Slope     1.0000   1.0000 0.8531   0.1469          0.8531 1000
## D         0.0387   0.0463 0.0338   0.0125          0.0263 1000
## U        -0.0030  -0.0030 0.0044  -0.0074          0.0045 1000
## Q         0.0417   0.0493 0.0294   0.0199          0.0218 1000
## g         1.0188   1.1070 0.9184   0.1886          0.8301 1000

1.6.2 Calibration plots

fitmode1f_train <-
  cph(
    Surv(time = sz_time, event = sz) ~ auras + began_wd_time + aeds + gtcs + MRI_normal,
    data = train_set,
    x = TRUE,
    y = TRUE,
    surv = TRUE,
    time.inc = 2
)

calibrate1_train <- calibrate(
  fitmodel1f_train,
  u = 2,
  cmethod = 'KM',
  B = 1000,
  m = 20

)
## Using Cox survival estimates at  2 Days
plot(calibrate1_train,  xlim = c(0,1),ylim = c(0,1))

fitmodel1f_train2 <-
  cph(
    Surv(time = sz_time, event = sz) ~ auras + began_wd_time + aeds + gtcs + MRI_normal,
    data = test_set,
    x = TRUE,
    y = TRUE,
    surv = TRUE,
    time.inc = 5
  )


calibrate_train2 <- calibrate(
  fitmodel1f_train2,
  u = 5,
  cmethod = 'KM',
  B = 1000,
  m = 25
)
## Using Cox survival estimates at  5 Days
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 2 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
plot2 <- plot(calibrate_train2,  xlim = c(0,1),ylim = c(0,1))

2 Validation Cohort

2.1 Univariable Regression

lapply(c('auras',
'withdraw1',
'sex',
'childconvul ',
'neuro_insult',
'status_epilepticus ',
'family_history',
'non_epileptic',
'gtcs',
'gtcs6',
'numsz6',
'MRI_normal',
'MRI_side',
'MRI_lobar',
'MRI_temp',
'EEG_ictal_side',
'EEG_ictal_temp',
'EEG_ictal_focal',
'EEG_interictal_normal',
'icEEG',
'PET',
'PET_side',
'learning_disability',
'psychiatric_pre_any',
'opside',
'optemp',
'opextent',
'op_incomplete',
'pathology_HS ',
'pathology_FCD',
'pathology_DNT',
'pathology_CAV',
'pathology_GL',
'pathology_dual',
'pathology_other',
'pathology_normal',
'acutepostszauras',
'sz',
'szaurafree1st',
'aura',
'szaura',
'began_wd',
'wd_all',
'aeds',
'age_onset ',
'duration',
'age_at_surgery',
'sz_time',
'aura_time',
'szaura_time',
'began_wd_time',
'age_began_wd',
'wd_all_time',
'years_follow_up'),

function(var) {
  formula    <-
  as.formula(paste("Surv(time = test_set$sz_time, event = test_set$sz) ~", var))
  
res.logist <-
  coxph(formula, data = test_set)
  
  summary(res.logist)
}
)
## [[1]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##         coef exp(coef) se(coef)     z Pr(>|z|)    
## auras 1.5985    4.9454   0.4583 3.488 0.000487 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##       exp(coef) exp(-coef) lower .95 upper .95
## auras     4.945     0.2022     2.014     12.14
## 
## Concordance= 0.575  (se = 0.032 )
## Likelihood ratio test= 8.71  on 1 df,   p=0.003
## Wald test            = 12.16  on 1 df,   p=5e-04
## Score (logrank) test = 14.96  on 1 df,   p=1e-04
## 
## 
## [[2]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##              coef exp(coef) se(coef)      z Pr(>|z|)    
## withdraw1 -1.4318    0.2389   0.3435 -4.168 3.08e-05 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##           exp(coef) exp(-coef) lower .95 upper .95
## withdraw1    0.2389      4.186    0.1218    0.4684
## 
## Concordance= 0.667  (se = 0.043 )
## Likelihood ratio test= 16.07  on 1 df,   p=6e-05
## Wald test            = 17.37  on 1 df,   p=3e-05
## Score (logrank) test = 20.52  on 1 df,   p=6e-06
## 
## 
## [[3]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##        coef exp(coef) se(coef)      z Pr(>|z|)  
## sex -0.5958    0.5511   0.3455 -1.724   0.0846 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##     exp(coef) exp(-coef) lower .95 upper .95
## sex    0.5511      1.815      0.28     1.085
## 
## Concordance= 0.582  (se = 0.045 )
## Likelihood ratio test= 3  on 1 df,   p=0.08
## Wald test            = 2.97  on 1 df,   p=0.08
## Score (logrank) test = 3.06  on 1 df,   p=0.08
## 
## 
## [[4]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                coef exp(coef) se(coef)      z Pr(>|z|)
## childconvul -0.3482    0.7059   0.3430 -1.015     0.31
## 
##             exp(coef) exp(-coef) lower .95 upper .95
## childconvul    0.7059      1.417    0.3604     1.383
## 
## Concordance= 0.541  (se = 0.045 )
## Likelihood ratio test= 1.03  on 1 df,   p=0.3
## Wald test            = 1.03  on 1 df,   p=0.3
## Score (logrank) test = 1.04  on 1 df,   p=0.3
## 
## 
## [[5]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                coef exp(coef) se(coef)     z Pr(>|z|)
## neuro_insult 0.1259    1.1342   0.3455 0.364    0.716
## 
##              exp(coef) exp(-coef) lower .95 upper .95
## neuro_insult     1.134     0.8817    0.5762     2.232
## 
## Concordance= 0.532  (se = 0.044 )
## Likelihood ratio test= 0.13  on 1 df,   p=0.7
## Wald test            = 0.13  on 1 df,   p=0.7
## Score (logrank) test = 0.13  on 1 df,   p=0.7
## 
## 
## [[6]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                     coef exp(coef) se(coef)     z Pr(>|z|)
## status_epilepticus 0.417     1.517    0.425 0.981    0.327
## 
##                    exp(coef) exp(-coef) lower .95 upper .95
## status_epilepticus     1.517      0.659    0.6597      3.49
## 
## Concordance= 0.537  (se = 0.037 )
## Likelihood ratio test= 0.89  on 1 df,   p=0.3
## Wald test            = 0.96  on 1 df,   p=0.3
## Score (logrank) test = 0.98  on 1 df,   p=0.3
## 
## 
## [[7]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                  coef exp(coef) se(coef)     z Pr(>|z|)  
## family_history 0.5873    1.7992   0.3462 1.696   0.0898 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## family_history     1.799     0.5558    0.9128     3.546
## 
## Concordance= 0.579  (se = 0.044 )
## Likelihood ratio test= 2.78  on 1 df,   p=0.1
## Wald test            = 2.88  on 1 df,   p=0.09
## Score (logrank) test = 2.96  on 1 df,   p=0.09
## 
## 
## [[8]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                   coef exp(coef) se(coef)      z Pr(>|z|)
## non_epileptic -0.06787   0.93438  0.72910 -0.093    0.926
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## non_epileptic    0.9344       1.07    0.2238     3.901
## 
## Concordance= 0.499  (se = 0.023 )
## Likelihood ratio test= 0.01  on 1 df,   p=0.9
## Wald test            = 0.01  on 1 df,   p=0.9
## Score (logrank) test = 0.01  on 1 df,   p=0.9
## 
## 
## [[9]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##         coef exp(coef) se(coef)     z Pr(>|z|)
## gtcs 0.04511   1.04614  0.38886 0.116    0.908
## 
##      exp(coef) exp(-coef) lower .95 upper .95
## gtcs     1.046     0.9559    0.4882     2.242
## 
## Concordance= 0.5  (se = 0.04 )
## Likelihood ratio test= 0.01  on 1 df,   p=0.9
## Wald test            = 0.01  on 1 df,   p=0.9
## Score (logrank) test = 0.01  on 1 df,   p=0.9
## 
## 
## [[10]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##         coef exp(coef) se(coef)     z Pr(>|z|)  
## gtcs6 0.6843    1.9824   0.3463 1.976   0.0481 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##       exp(coef) exp(-coef) lower .95 upper .95
## gtcs6     1.982     0.5044     1.006     3.908
## 
## Concordance= 0.588  (se = 0.044 )
## Likelihood ratio test= 3.74  on 1 df,   p=0.05
## Wald test            = 3.91  on 1 df,   p=0.05
## Score (logrank) test = 4.06  on 1 df,   p=0.04
## 
## 
## [[11]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##             coef exp(coef)  se(coef)      z Pr(>|z|)
## numsz6 -0.005002  0.995010  0.006689 -0.748    0.455
## 
##        exp(coef) exp(-coef) lower .95 upper .95
## numsz6     0.995      1.005     0.982     1.008
## 
## Concordance= 0.473  (se = 0.049 )
## Likelihood ratio test= 0.74  on 1 df,   p=0.4
## Wald test            = 0.56  on 1 df,   p=0.5
## Score (logrank) test = 0.57  on 1 df,   p=0.5
## 
## 
## [[12]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##              coef exp(coef) se(coef)     z Pr(>|z|)  
## MRI_normal 1.2842    3.6116   0.6064 2.118   0.0342 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##            exp(coef) exp(-coef) lower .95 upper .95
## MRI_normal     3.612     0.2769       1.1     11.85
## 
## Concordance= 0.528  (se = 0.021 )
## Likelihood ratio test= 3.21  on 1 df,   p=0.07
## Wald test            = 4.49  on 1 df,   p=0.03
## Score (logrank) test = 5.14  on 1 df,   p=0.02
## 
## 
## [[13]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##            coef exp(coef) se(coef)     z Pr(>|z|)  
## MRI_side 0.5203    1.6825   0.2109 2.467   0.0136 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##          exp(coef) exp(-coef) lower .95 upper .95
## MRI_side     1.683     0.5944     1.113     2.544
## 
## Concordance= 0.597  (se = 0.046 )
## Likelihood ratio test= 5.32  on 1 df,   p=0.02
## Wald test            = 6.09  on 1 df,   p=0.01
## Score (logrank) test = 6.1  on 1 df,   p=0.01
## 
## 
## [[14]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##             coef exp(coef) se(coef)     z Pr(>|z|)
## MRI_lobar 0.3274    1.3874   0.3523 0.929    0.353
## 
##           exp(coef) exp(-coef) lower .95 upper .95
## MRI_lobar     1.387     0.7208    0.6955     2.768
## 
## Concordance= 0.491  (se = 0.037 )
## Likelihood ratio test= 0.76  on 1 df,   p=0.4
## Wald test            = 0.86  on 1 df,   p=0.4
## Score (logrank) test = 0.86  on 1 df,   p=0.4
## 
## 
## [[15]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##            coef exp(coef) se(coef)     z Pr(>|z|)
## MRI_temp 0.2819    1.3256   0.2318 1.216    0.224
## 
##          exp(coef) exp(-coef) lower .95 upper .95
## MRI_temp     1.326     0.7544    0.8416     2.088
## 
## Concordance= 0.508  (se = 0.047 )
## Likelihood ratio test= 1.34  on 1 df,   p=0.2
## Wald test            = 1.48  on 1 df,   p=0.2
## Score (logrank) test = 1.48  on 1 df,   p=0.2
## 
## 
## [[16]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                    coef exp(coef) se(coef)     z Pr(>|z|)
## EEG_ictal_side 0.009289  1.009332 0.240699 0.039    0.969
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## EEG_ictal_side     1.009     0.9908    0.6297     1.618
## 
## Concordance= 0.528  (se = 0.045 )
## Likelihood ratio test= 0  on 1 df,   p=1
## Wald test            = 0  on 1 df,   p=1
## Score (logrank) test = 0  on 1 df,   p=1
## 
## 
## [[17]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                  coef exp(coef) se(coef)     z Pr(>|z|)
## EEG_ictal_temp 0.3130    1.3675   0.4244 0.737    0.461
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## EEG_ictal_temp     1.367     0.7313    0.5952     3.141
## 
## Concordance= 0.535  (se = 0.036 )
## Likelihood ratio test= 0.58  on 1 df,   p=0.4
## Wald test            = 0.54  on 1 df,   p=0.5
## Score (logrank) test = 0.55  on 1 df,   p=0.5
## 
## 
## [[18]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                   coef exp(coef) se(coef)     z Pr(>|z|)
## EEG_ictal_focal 0.2032    1.2254   0.4045 0.502    0.615
## 
##                 exp(coef) exp(-coef) lower .95 upper .95
## EEG_ictal_focal     1.225     0.8161    0.5545     2.708
## 
## Concordance= 0.528  (se = 0.036 )
## Likelihood ratio test= 0.26  on 1 df,   p=0.6
## Wald test            = 0.25  on 1 df,   p=0.6
## Score (logrank) test = 0.25  on 1 df,   p=0.6
## 
## 
## [[19]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                           coef exp(coef) se(coef)      z Pr(>|z|)
## EEG_interictal_normal -0.06338   0.93859  0.48430 -0.131    0.896
## 
##                       exp(coef) exp(-coef) lower .95 upper .95
## EEG_interictal_normal    0.9386      1.065    0.3633     2.425
## 
## Concordance= 0.51  (se = 0.03 )
## Likelihood ratio test= 0.02  on 1 df,   p=0.9
## Wald test            = 0.02  on 1 df,   p=0.9
## Score (logrank) test = 0.02  on 1 df,   p=0.9
## 
## 
## [[20]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##       coef exp(coef) se(coef)  z Pr(>|z|)
## icEEG   NA        NA        0 NA       NA
## 
##       exp(coef) exp(-coef) lower .95 upper .95
## icEEG        NA         NA        NA        NA
## 
## Concordance= 0.5  (se = 0 )
## Likelihood ratio test= 0  on 0 df,   p=1
## Wald test            = NA  on 0 df,   p=NA
## Score (logrank) test = 0  on 0 df,   p=1
## 
## 
## [[21]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##       coef exp(coef) se(coef)     z Pr(>|z|)
## PET 0.2467    1.2798   0.7305 0.338    0.736
## 
##     exp(coef) exp(-coef) lower .95 upper .95
## PET      1.28     0.7814    0.3057     5.357
## 
## Concordance= 0.508  (se = 0.023 )
## Likelihood ratio test= 0.11  on 1 df,   p=0.7
## Wald test            = 0.11  on 1 df,   p=0.7
## Score (logrank) test = 0.11  on 1 df,   p=0.7
## 
## 
## [[22]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##             coef exp(coef) se(coef)     z Pr(>|z|)
## PET_side 0.01028   1.01034  0.31258 0.033    0.974
## 
##          exp(coef) exp(-coef) lower .95 upper .95
## PET_side      1.01     0.9898    0.5475     1.864
## 
## Concordance= 0.493  (se = 0.022 )
## Likelihood ratio test= 0  on 1 df,   p=1
## Wald test            = 0  on 1 df,   p=1
## Score (logrank) test = 0  on 1 df,   p=1
## 
## 
## [[23]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                       coef exp(coef) se(coef)     z Pr(>|z|)
## learning_disability 0.6519    1.9191   0.5330 1.223    0.221
## 
##                     exp(coef) exp(-coef) lower .95 upper .95
## learning_disability     1.919     0.5211    0.6751     5.455
## 
## Concordance= 0.537  (se = 0.032 )
## Likelihood ratio test= 1.27  on 1 df,   p=0.3
## Wald test            = 1.5  on 1 df,   p=0.2
## Score (logrank) test = 1.55  on 1 df,   p=0.2
## 
## 
## [[24]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                       coef exp(coef) se(coef)     z Pr(>|z|)
## psychiatric_pre_any 0.1381    1.1480   0.3447 0.401    0.689
## 
##                     exp(coef) exp(-coef) lower .95 upper .95
## psychiatric_pre_any     1.148     0.8711    0.5842     2.256
## 
## Concordance= 0.518  (se = 0.045 )
## Likelihood ratio test= 0.16  on 1 df,   p=0.7
## Wald test            = 0.16  on 1 df,   p=0.7
## Score (logrank) test = 0.16  on 1 df,   p=0.7
## 
## 
## [[25]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##          coef exp(coef) se(coef)     z Pr(>|z|)
## opside 0.4384    1.5503   0.3668 1.195    0.232
## 
##        exp(coef) exp(-coef) lower .95 upper .95
## opside      1.55     0.6451    0.7554     3.181
## 
## Concordance= 0.558  (se = 0.043 )
## Likelihood ratio test= 1.49  on 1 df,   p=0.2
## Wald test            = 1.43  on 1 df,   p=0.2
## Score (logrank) test = 1.45  on 1 df,   p=0.2
## 
## 
## [[26]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##          coef exp(coef) se(coef)     z Pr(>|z|)
## optemp 0.0446    1.0456   0.6052 0.074    0.941
## 
##        exp(coef) exp(-coef) lower .95 upper .95
## optemp     1.046     0.9564    0.3193     3.424
## 
## Concordance= 0.501  (se = 0.025 )
## Likelihood ratio test= 0.01  on 1 df,   p=0.9
## Wald test            = 0.01  on 1 df,   p=0.9
## Score (logrank) test = 0.01  on 1 df,   p=0.9
## 
## 
## [[27]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##            coef exp(coef) se(coef)     z Pr(>|z|)  
## opextent 0.9500    2.5856   0.5075 1.872   0.0612 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##          exp(coef) exp(-coef) lower .95 upper .95
## opextent     2.586     0.3868    0.9563     6.991
## 
## Concordance= 0.554  (se = 0.021 )
## Likelihood ratio test= 3.49  on 1 df,   p=0.06
## Wald test            = 3.5  on 1 df,   p=0.06
## Score (logrank) test = 3.21  on 1 df,   p=0.07
## 
## 
## [[28]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##               coef exp(coef) se(coef)  z Pr(>|z|)
## op_incomplete   NA        NA        0 NA       NA
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## op_incomplete        NA         NA        NA        NA
## 
## Concordance= 0.5  (se = 0 )
## Likelihood ratio test= 0  on 0 df,   p=1
## Wald test            = NA  on 0 df,   p=NA
## Score (logrank) test = 0  on 0 df,   p=1
## 
## 
## [[29]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                 coef exp(coef) se(coef)      z Pr(>|z|)
## pathology_HS -0.1333    0.8752   0.3766 -0.354    0.723
## 
##              exp(coef) exp(-coef) lower .95 upper .95
## pathology_HS    0.8752      1.143    0.4183     1.831
## 
## Concordance= 0.521  (se = 0.042 )
## Likelihood ratio test= 0.12  on 1 df,   p=0.7
## Wald test            = 0.13  on 1 df,   p=0.7
## Score (logrank) test = 0.13  on 1 df,   p=0.7
## 
## 
## [[30]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                     coef  exp(coef)   se(coef)      z Pr(>|z|)
## pathology_FCD -1.603e+01  1.091e-07  4.027e+03 -0.004    0.997
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## pathology_FCD 1.091e-07    9166920         0       Inf
## 
## Concordance= 0.509  (se = 0.006 )
## Likelihood ratio test= 1.12  on 1 df,   p=0.3
## Wald test            = 0  on 1 df,   p=1
## Score (logrank) test = 0.57  on 1 df,   p=0.5
## 
## 
## [[31]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                  coef exp(coef) se(coef)     z Pr(>|z|)
## pathology_DNT 0.06133   1.06325  0.53272 0.115    0.908
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## pathology_DNT     1.063     0.9405    0.3743     3.021
## 
## Concordance= 0.509  (se = 0.031 )
## Likelihood ratio test= 0.01  on 1 df,   p=0.9
## Wald test            = 0.01  on 1 df,   p=0.9
## Score (logrank) test = 0.01  on 1 df,   p=0.9
## 
## 
## [[32]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                 coef exp(coef) se(coef)     z Pr(>|z|)
## pathology_CAV 0.2689    1.3085   0.6052 0.444    0.657
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## pathology_CAV     1.309     0.7642    0.3996     4.285
## 
## Concordance= 0.509  (se = 0.024 )
## Likelihood ratio test= 0.18  on 1 df,   p=0.7
## Wald test            = 0.2  on 1 df,   p=0.7
## Score (logrank) test = 0.2  on 1 df,   p=0.7
## 
## 
## [[33]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                    coef  exp(coef)   se(coef)      z Pr(>|z|)
## pathology_GL -1.706e+01  3.898e-08  4.635e+03 -0.004    0.997
## 
##              exp(coef) exp(-coef) lower .95 upper .95
## pathology_GL 3.898e-08   25652025         0       Inf
## 
## Concordance= 0.517  (se = 0.009 )
## Likelihood ratio test= 2.34  on 1 df,   p=0.1
## Wald test            = 0  on 1 df,   p=1
## Score (logrank) test = 1.19  on 1 df,   p=0.3
## 
## 
## [[34]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                      coef  exp(coef)   se(coef)      z Pr(>|z|)
## pathology_dual -1.603e+01  1.090e-07  3.894e+03 -0.004    0.997
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## pathology_dual  1.09e-07    9176479         0       Inf
## 
## Concordance= 0.51  (se = 0.007 )
## Likelihood ratio test= 1.2  on 1 df,   p=0.3
## Wald test            = 0  on 1 df,   p=1
## Score (logrank) test = 0.61  on 1 df,   p=0.4
## 
## 
## [[35]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                   coef exp(coef) se(coef)     z Pr(>|z|)
## pathology_other 0.9328    2.5416   0.6065 1.538    0.124
## 
##                 exp(coef) exp(-coef) lower .95 upper .95
## pathology_other     2.542     0.3935    0.7742     8.343
## 
## Concordance= 0.528  (se = 0.023 )
## Likelihood ratio test= 1.85  on 1 df,   p=0.2
## Wald test            = 2.37  on 1 df,   p=0.1
## Score (logrank) test = 2.54  on 1 df,   p=0.1
## 
## 
## [[36]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                  coef exp(coef) se(coef)  z Pr(>|z|)
## pathology_normal   NA        NA        0 NA       NA
## 
##                  exp(coef) exp(-coef) lower .95 upper .95
## pathology_normal        NA         NA        NA        NA
## 
## Concordance= 0.5  (se = 0 )
## Likelihood ratio test= 0  on 0 df,   p=1
## Wald test            = NA  on 0 df,   p=NA
## Score (logrank) test = 0  on 0 df,   p=1
## 
## 
## [[37]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                    coef exp(coef) se(coef)     z Pr(>|z|)
## acutepostszauras 0.9034    2.4679   0.6049 1.493    0.135
## 
##                  exp(coef) exp(-coef) lower .95 upper .95
## acutepostszauras     2.468     0.4052     0.754     8.077
## 
## Concordance= 0.521  (se = 0.022 )
## Likelihood ratio test= 1.75  on 1 df,   p=0.2
## Wald test            = 2.23  on 1 df,   p=0.1
## Score (logrank) test = 2.39  on 1 df,   p=0.1
## 
## 
## [[38]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##         coef exp(coef)  se(coef)     z Pr(>|z|)
## sz 2.318e+01 1.171e+10 6.767e+03 0.003    0.997
## 
##    exp(coef) exp(-coef) lower .95 upper .95
## sz 1.171e+10  8.541e-11         0       Inf
## 
## Concordance= 0.927  (se = 0.014 )
## Likelihood ratio test= 130.3  on 1 df,   p=<2e-16
## Wald test            = 0  on 1 df,   p=1
## Score (logrank) test = 173.1  on 1 df,   p=<2e-16
## 
## 
## [[39]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##               coef exp(coef) se(coef)  z Pr(>|z|)
## szaurafree1st   NA        NA        0 NA       NA
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## szaurafree1st        NA         NA        NA        NA
## 
## Concordance= 0.519  (se = 0.019 )
## Likelihood ratio test= 9.56  on 0 df,   p=<2e-16
## Wald test            = NA  on 0 df,   p=NA
## Score (logrank) test = 118  on 0 df,   p=<2e-16
## 
## 
## [[40]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##        coef exp(coef) se(coef)     z Pr(>|z|)  
## aura 0.6987    2.0111   0.4242 1.647   0.0995 .
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      exp(coef) exp(-coef) lower .95 upper .95
## aura     2.011     0.4972    0.8757     4.619
## 
## Concordance= 0.532  (se = 0.029 )
## Likelihood ratio test= 2.35  on 1 df,   p=0.1
## Wald test            = 2.71  on 1 df,   p=0.1
## Score (logrank) test = 2.82  on 1 df,   p=0.09
## 
## 
## [[41]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##             coef exp(coef)  se(coef)     z Pr(>|z|)
## szaura 2.147e+01 2.117e+09 4.099e+03 0.005    0.996
## 
##        exp(coef) exp(-coef) lower .95 upper .95
## szaura 2.117e+09  4.723e-10         0       Inf
## 
## Concordance= 0.895  (se = 0.018 )
## Likelihood ratio test= 102  on 1 df,   p=<2e-16
## Wald test            = 0  on 1 df,   p=1
## Score (logrank) test = 114.4  on 1 df,   p=<2e-16
## 
## 
## [[42]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##             coef exp(coef) se(coef)      z Pr(>|z|)  
## began_wd -1.1954    0.3026   0.5404 -2.212    0.027 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##          exp(coef) exp(-coef) lower .95 upper .95
## began_wd    0.3026      3.305    0.1049    0.8727
## 
## Concordance= 0.548  (se = 0.03 )
## Likelihood ratio test= 3.68  on 1 df,   p=0.06
## Wald test            = 4.89  on 1 df,   p=0.03
## Score (logrank) test = 5.5  on 1 df,   p=0.02
## 
## 
## [[43]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##           coef exp(coef) se(coef)      z Pr(>|z|)  
## wd_all -0.7411    0.4766   0.3465 -2.139   0.0324 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##        exp(coef) exp(-coef) lower .95 upper .95
## wd_all    0.4766      2.098    0.2417    0.9399
## 
## Concordance= 0.586  (se = 0.044 )
## Likelihood ratio test= 4.36  on 1 df,   p=0.04
## Wald test            = 4.58  on 1 df,   p=0.03
## Score (logrank) test = 4.79  on 1 df,   p=0.03
## 
## 
## [[44]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##        coef exp(coef) se(coef)     z Pr(>|z|)   
## aeds 0.4768    1.6110   0.1756 2.716  0.00662 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##      exp(coef) exp(-coef) lower .95 upper .95
## aeds     1.611     0.6207     1.142     2.273
## 
## Concordance= 0.622  (se = 0.048 )
## Likelihood ratio test= 6.16  on 1 df,   p=0.01
## Wald test            = 7.37  on 1 df,   p=0.007
## Score (logrank) test = 7.23  on 1 df,   p=0.007
## 
## 
## [[45]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##               coef exp(coef) se(coef)      z Pr(>|z|)
## age_onset -0.01744   0.98271  0.01870 -0.933    0.351
## 
##           exp(coef) exp(-coef) lower .95 upper .95
## age_onset    0.9827      1.018    0.9474     1.019
## 
## Concordance= 0.552  (se = 0.051 )
## Likelihood ratio test= 0.93  on 1 df,   p=0.3
## Wald test            = 0.87  on 1 df,   p=0.4
## Score (logrank) test = 0.87  on 1 df,   p=0.4
## 
## 
## [[46]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##             coef exp(coef) se(coef)     z Pr(>|z|)
## duration 0.01416   1.01426  0.01362 1.039    0.299
## 
##          exp(coef) exp(-coef) lower .95 upper .95
## duration     1.014     0.9859    0.9875     1.042
## 
## Concordance= 0.571  (se = 0.046 )
## Likelihood ratio test= 1.05  on 1 df,   p=0.3
## Wald test            = 1.08  on 1 df,   p=0.3
## Score (logrank) test = 1.08  on 1 df,   p=0.3
## 
## 
## [[47]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                    coef exp(coef) se(coef)     z Pr(>|z|)
## age_at_surgery 0.005148  1.005161 0.016784 0.307    0.759
## 
##                exp(coef) exp(-coef) lower .95 upper .95
## age_at_surgery     1.005     0.9949    0.9726     1.039
## 
## Concordance= 0.509  (se = 0.055 )
## Likelihood ratio test= 0.09  on 1 df,   p=0.8
## Wald test            = 0.09  on 1 df,   p=0.8
## Score (logrank) test = 0.09  on 1 df,   p=0.8
## 
## 
## [[48]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##               coef  exp(coef)   se(coef)      z Pr(>|z|)
## sz_time -7.830e+01  9.845e-35  1.190e+02 -0.658    0.511
## 
##         exp(coef) exp(-coef)  lower .95 upper .95
## sz_time 9.845e-35  1.016e+34 4.869e-136 1.991e+67
## 
## Concordance= 0.992  (se = 0.003 )
## Likelihood ratio test= 203.6  on 1 df,   p=<2e-16
## Wald test            = 0.43  on 1 df,   p=0.5
## Score (logrank) test = 56.67  on 1 df,   p=5e-14
## 
## 
## [[49]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##               coef exp(coef) se(coef)      z Pr(>|z|)
## aura_time -0.03964   0.96113  0.03038 -1.305    0.192
## 
##           exp(coef) exp(-coef) lower .95 upper .95
## aura_time    0.9611       1.04    0.9056      1.02
## 
## Concordance= 0.553  (se = 0.058 )
## Likelihood ratio test= 1.8  on 1 df,   p=0.2
## Wald test            = 1.7  on 1 df,   p=0.2
## Score (logrank) test = 1.72  on 1 df,   p=0.2
## 
## 
## [[50]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                coef exp(coef) se(coef)      z Pr(>|z|)    
## szaura_time -0.7953    0.4514   0.1325 -6.002 1.94e-09 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##             exp(coef) exp(-coef) lower .95 upper .95
## szaura_time    0.4514      2.215    0.3482    0.5853
## 
## Concordance= 0.963  (se = 0.01 )
## Likelihood ratio test= 104.3  on 1 df,   p=<2e-16
## Wald test            = 36.03  on 1 df,   p=2e-09
## Score (logrank) test = 50.63  on 1 df,   p=1e-12
## 
## 
## [[51]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                   coef exp(coef) se(coef)      z Pr(>|z|)
## began_wd_time -0.04799   0.95314  0.07103 -0.676    0.499
## 
##               exp(coef) exp(-coef) lower .95 upper .95
## began_wd_time    0.9531      1.049    0.8293     1.096
## 
## Concordance= 0.509  (se = 0.052 )
## Likelihood ratio test= 0.49  on 1 df,   p=0.5
## Wald test            = 0.46  on 1 df,   p=0.5
## Score (logrank) test = 0.46  on 1 df,   p=0.5
## 
## 
## [[52]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                  coef exp(coef) se(coef)     z Pr(>|z|)
## age_began_wd 0.002429  1.002432 0.016784 0.145    0.885
## 
##              exp(coef) exp(-coef) lower .95 upper .95
## age_began_wd     1.002     0.9976      0.97     1.036
## 
## Concordance= 0.501  (se = 0.054 )
## Likelihood ratio test= 0.02  on 1 df,   p=0.9
## Wald test            = 0.02  on 1 df,   p=0.9
## Score (logrank) test = 0.02  on 1 df,   p=0.9
## 
## 
## [[53]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                 coef exp(coef) se(coef)      z Pr(>|z|)
## wd_all_time -0.03063   0.96984  0.04011 -0.764    0.445
## 
##             exp(coef) exp(-coef) lower .95 upper .95
## wd_all_time    0.9698      1.031    0.8965     1.049
## 
## Concordance= 0.576  (se = 0.052 )
## Likelihood ratio test= 0.63  on 1 df,   p=0.4
## Wald test            = 0.58  on 1 df,   p=0.4
## Score (logrank) test = 0.59  on 1 df,   p=0.4
## 
## 
## [[54]]
## Call:
## coxph(formula = formula, data = test_set)
## 
##   n= 119, number of events= 34 
## 
##                      coef exp(coef)  se(coef)    z Pr(>|z|)
## years_follow_up -0.002974  0.997031  0.029770 -0.1     0.92
## 
##                 exp(coef) exp(-coef) lower .95 upper .95
## years_follow_up     0.997      1.003    0.9405     1.057
## 
## Concordance= 0.511  (se = 0.057 )
## Likelihood ratio test= 0.01  on 1 df,   p=0.9
## Wald test            = 0.01  on 1 df,   p=0.9
## Score (logrank) test = 0.01  on 1 df,   p=0.9

2.2 Kaplan-Meier

km_test<- survfit(Surv(test_set$sz_time, test_set$sz) ~ 1, data= test_set, type =
"kaplan-meier", conf.type = "plain")
summary(km_test, times = c(0,1,2,5,10,15, 20,23))
## Call: survfit(formula = Surv(test_set$sz_time, test_set$sz) ~ 1, data = test_set, 
##     type = "kaplan-meier", conf.type = "plain")
## 
##  time n.risk n.event survival std.err lower 95% CI upper 95% CI
##     0    119       0    1.000 0.00000        1.000        1.000
##     1    118       1    0.992 0.00837        0.975        1.000
##     2    117      12    0.890 0.02881        0.833        0.946
##     5     83      14    0.767 0.03940        0.689        0.844
##    10     48       6    0.696 0.04540        0.607        0.785
##    15     25       1    0.680 0.04714        0.588        0.772
##    20     12       0    0.680 0.04714        0.588        0.772
##    23      4       0    0.680 0.04714        0.588        0.772
km1_test<- ggsurvplot(km_test, data = test_set, xlab = "Time (years)", ylab = "Proportion of seizure free patients after withdrawal", palette  = 'black', xlim = c(0,15),ylim = c(0,1),  break.time.by = 5, font.x =14 ,font.y = 14, font.tickslab = 10, show.legend.text = F)
km1_test

2.3 Model Validation

model1f_test <-
  coxph(
    Surv(time = test_set$sz_time, event = test_set$sz) ~ test_set$auras + test_set$began_wd_time + test_set$aeds + test_set$gtcs  +test_set$MRI_normal
  )
summary(model1f_test)
## Call:
## coxph(formula = Surv(time = test_set$sz_time, event = test_set$sz) ~ 
##     test_set$auras + test_set$began_wd_time + test_set$aeds + 
##         test_set$gtcs + test_set$MRI_normal)
## 
##   n= 119, number of events= 34 
## 
##                            coef exp(coef) se(coef)      z Pr(>|z|)    
## test_set$auras          1.64869   5.20015  0.46525  3.544 0.000395 ***
## test_set$began_wd_time -0.03104   0.96944  0.06896 -0.450 0.652611    
## test_set$aeds           0.50945   1.66437  0.18547  2.747 0.006017 ** 
## test_set$gtcs          -0.23101   0.79373  0.40204 -0.575 0.565572    
## test_set$MRI_normal     1.27910   3.59339  0.62124  2.059 0.039500 *  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
##                        exp(coef) exp(-coef) lower .95 upper .95
## test_set$auras            5.2001     0.1923    2.0893    12.943
## test_set$began_wd_time    0.9694     1.0315    0.8469     1.110
## test_set$aeds             1.6644     0.6008    1.1571     2.394
## test_set$gtcs             0.7937     1.2599    0.3610     1.745
## test_set$MRI_normal       3.5934     0.2783    1.0634    12.142
## 
## Concordance= 0.696  (se = 0.045 )
## Likelihood ratio test= 18.66  on 5 df,   p=0.002
## Wald test            = 22.99  on 5 df,   p=3e-04
## Score (logrank) test = 27.38  on 5 df,   p=5e-05

2.3.1 Discrimination

fitmodel1f_train <-
  cph(
    Surv(time = sz_time, event = sz) ~ auras + began_wd_time + aeds + gtcs + MRI_normal,
    data = test_set,
    x = TRUE,
    y = TRUE,
    surv = TRUE,
    time.inc = 2
  )
fitmodel1f_train
## Cox Proportional Hazards Model
##  
##  cph(formula = Surv(time = sz_time, event = sz) ~ auras + began_wd_time + 
##      aeds + gtcs + MRI_normal, data = test_set, x = TRUE, y = TRUE, 
##      surv = TRUE, time.inc = 2)
##  
##                      Model Tests       Discrimination    
##                                           Indexes        
##  Obs       119    LR chi2     18.66    R2       0.157    
##  Events     34    d.f.            5    Dxy      0.391    
##  Center 1.1728    Pr(> chi2) 0.0022    g        0.668    
##                   Score chi2  27.38    gr       1.950    
##                   Pr(> chi2) 0.0000                      
##  
##                Coef    S.E.   Wald Z Pr(>|Z|)
##  auras          1.6486 0.4653  3.54  0.0004  
##  began_wd_time -0.0311 0.0690 -0.45  0.6524  
##  aeds           0.5098 0.1854  2.75  0.0060  
##  gtcs          -0.2309 0.4021 -0.57  0.5657  
##  MRI_normal     1.2790 0.6213  2.06  0.0395  
## 
rms::validate(fitmodel1f_train, dxy = TRUE, B = 1000)
## Singularity in coxph.fit. Coefficients:
##        1        2        3        4        5 
##  2.17364 -0.14269  0.07165 -0.37036       NA 
## Singularity in coxph.fit. Coefficients:
##        1        2        3        4        5 
##  1.64646 -0.01321  0.51558 -0.15199       NA 
## Singularity in coxph.fit. Coefficients:
##        1        2        3        4        5 
##  1.27426  0.03205  0.36250 -0.77127       NA 
## Singularity in coxph.fit. Coefficients:
##       1       2       3       4       5 
##  0.8896 -0.1590  0.1657 -0.1490      NA 
## Singularity in coxph.fit. Coefficients:
##       1       2       3       4       5 
##  0.9055 -0.1157  0.8098 -0.2602      NA 
## Singularity in coxph.fit. Coefficients:
##        1        2        3        4        5 
##       NA -0.08984  0.59192 -0.30385  0.51491 
## Singularity in coxph.fit. Coefficients:
##       1       2       3       4       5 
## 1.17716 0.05296 0.35719 0.50849      NA 
## Singularity in coxph.fit. Coefficients:
##       1       2       3       4       5 
##  2.5246 -0.2839  0.5540  0.1715      NA 
## Singularity in coxph.fit. Coefficients:
##       1       2       3       4       5 
##  1.4630 -0.1479  0.4996 -0.8827      NA 
## Singularity in coxph.fit. Coefficients:
##       1       2       3       4       5 
##  1.6870 -0.1412  0.1672 -0.5383      NA 
## Singularity in coxph.fit. Coefficients:
##       1       2       3       4       5 
##  1.1650 -0.1081  1.0732 -1.0444      NA 
## Singularity in coxph.fit. Coefficients:
##         1         2         3         4         5 
##  0.458476  0.003759  0.767858 -0.250467        NA 
## Singularity in coxph.fit. Coefficients:
##        1        2        3        4        5 
##  1.74531  0.02041  0.85055 -0.43899       NA 
## Singularity in coxph.fit. Coefficients:
##      1      2      3      4      5 
##     NA 0.1492 0.6256 0.5841 1.5372 
## Singularity in coxph.fit. Coefficients:
##       1       2       3       4       5 
##  2.6902 -0.1321  0.6105  0.1603      NA 
## Singularity in coxph.fit. Coefficients:
##        1        2        3        4        5 
##  0.92880 -0.03308  0.42671  0.01615       NA 
## Singularity in coxph.fit. Coefficients:
##       1       2       3       4       5 
##  1.3543 -0.0216  0.4564 -0.3570      NA 
## Singularity in coxph.fit. Coefficients:
##        1        2        3        4        5 
##  1.27694 -0.02848  0.61607 -0.79498       NA 
## Singularity in coxph.fit. Coefficients:
##       1       2       3       4       5 
## 1.28861 0.02672 0.53815 0.30307      NA 
## Singularity in coxph.fit. Coefficients:
##         1         2         3         4         5 
##  1.704178 -0.003689  0.560836 -0.460345        NA 
## 
## Divergence or singularity in 20 samples
##       index.orig training   test optimism index.corrected   n
## Dxy       0.3913   0.4292 0.3410   0.0882          0.3031 980
## R2        0.1570   0.1942 0.1251   0.0691          0.0879 980
## Slope     1.0000   1.0000 0.7914   0.2086          0.7914 980
## D         0.0574   0.0745 0.0444   0.0300          0.0274 980
## U        -0.0065  -0.0066 0.0112  -0.0178          0.0113 980
## Q         0.0639   0.0811 0.0332   0.0479          0.0161 980
## g         0.6679   0.8124 0.6231   0.1893          0.4786 980

2.3.2 Calibration plots

fitmode1f_train <-
  cph(
    Surv(time = sz_time, event = sz) ~ auras + began_wd_time + aeds + gtcs + MRI_normal,
    data = test_set,
    x = TRUE,
    y = TRUE,
    surv = TRUE,
    time.inc = 2
)

calibrate1_train <- calibrate(
  fitmodel1f_train,
  u = 2,
  cmethod = 'KM',
  B = 1000,
  m = 20

)
## Using Cox survival estimates at  2 Days
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
plot(calibrate1_train,  xlim = c(0,1),ylim = c(0,1))

fitmodel1f_train2 <-
  cph(
    Surv(time = sz_time, event = sz) ~ auras + began_wd_time + aeds + gtcs + MRI_normal,
    data = test_set,
    x = TRUE,
    y = TRUE,
    surv = TRUE,
    time.inc = 5
  )


calibrate_train2 <- calibrate(
  fitmodel1f_train2,
  u = 5,
  cmethod = 'KM',
  B = 1000,
  m = 20
)
## Using Cox survival estimates at  5 Days
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 2 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable auras 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 2 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 2 samples
## X matrix deemed to be singular; variable MRI_normal 
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 2 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
## X matrix deemed to be singular; variable MRI_normal 
## 
## Divergence or singularity in 1 samples
plot2 <- plot(calibrate_train2,  xlim = c(0,1),ylim = c(0,1))

2.4 Nomogram

``{r, warning = FALSE}

fitmodel1f_train\(Design\)label <- c( “SPSs before withdrawal (Yes=1, No=0)”, “Time to begin withdrawal (Years from surgery)”, “Number of AEDs at time of surgery”, “GTCS before surgery (Yes=1, No=0)” ) surv.fitmodel1f_train <- Survival(fitmodel1f) nom.cox1 <- nomogram( fitmodel1f, fun = list(function(x) surv.fitmodel1f(2, x), function(x) surv.fitmodel1f(5, x)), funlabel = c(“2-year seizure freedom”, “5-year seizure freedom”), lp = F, fun.at = c(0.99, 0.95, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2) )

pdf( “nomo1.pdf”, width = cm(17), height = cm(10) ) nomo1<- plot( nom.cox1, cex.axis = 4, cex.var = 4.5, col.grid = gray(c(0.8, 0.95)), theme(text = element_text( family = “Times New Roman”, face = “bold”, size = 20 )) )

dev.off() nomo1

## Dynamic Nomogram

``{r, warning = FALSE}
ddist <- train_setdist(train_set)
options(train_setdist = 'ddist')
web <-
  cph(Surv(time = time_sz, event = sz) ~ auras + time_begin + drugs + gtcs ,
      train_set = train_set)
DNbuilder(
  web,
  train_set = train_set,
  clevel = 0.95,
  covariate = c("numeric"),
  ptype = c("st")
)