PA model

bc_pa ~ outcome + absPE*PE_flag + ( 1 + outcome + absPE*PE_flag | cohort / id / exam_num

## Warning in commonArgs(par, fn, control, environment()): maxfun < 10 *
## length(par)^2 is not recommended.
## Warning in optwrap(optimizer, devfun, getStart(start, rho$lower, rho$pp), :
## convergence code 1 from bobyqa: bobyqa -- maximum number of function
## evaluations exceeded
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control
## $checkConv, : unable to evaluate scaled gradient
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control
## $checkConv, : Model failed to converge: degenerate Hessian with 4 negative
## eigenvalues
## Warning: Model failed to converge with 4 negative eigenvalues: -4.7e-01
## -5.0e-01 -2.0e+00 -2.0e+00
## Linear mixed model fit by maximum likelihood . t-tests use
##   Satterthwaite's method [lmerModLmerTest]
## Formula: 
## bc_pa ~ outcome + absPE * PE_flag + (1 + outcome + absPE * PE_flag |  
##     cohort/id/exam_num)
##    Data: df.pa.conf.new
## 
##      AIC      BIC   logLik deviance df.resid 
##  22303.4  22607.0 -11100.7  22201.4     2794 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -5.5204 -0.4473  0.0252  0.4561  5.0624 
## 
## Random effects:
##  Groups               Name          Variance  Std.Dev. Corr             
##  exam_num:(id:cohort) (Intercept)   425.99760 20.6397                   
##                       outcome         2.90935  1.7057  -0.82            
##                       absPE          19.00141  4.3591  -0.89  0.99      
##                       PE_flag       212.09376 14.5634  -0.72  0.51  0.57
##                       absPE:PE_flag  98.99247  9.9495   0.66 -0.91 -0.88
##  id:cohort            (Intercept)    61.95545  7.8712                   
##                       outcome         1.03110  1.0154   0.02            
##                       absPE           9.82848  3.1350  -1.00 -0.05      
##                       PE_flag        81.94049  9.0521  -0.54 -0.83  0.56
##                       absPE:PE_flag  16.76150  4.0941   0.97 -0.16 -0.97
##  cohort               (Intercept)     8.94317  2.9905                   
##                       outcome         0.07967  0.2823  -1.00            
##                       absPE           0.33612  0.5798  -1.00  1.00      
##                       PE_flag         5.62046  2.3708  -1.00  1.00  1.00
##                       absPE:PE_flag   1.25797  1.1216   1.00 -1.00 -1.00
##  Residual                            94.14555  9.7029                   
##       
##       
##       
##       
##       
##  -0.59
##       
##       
##       
##       
##  -0.41
##       
##       
##       
##       
##  -1.00
##       
## Number of obs: 2845, groups:  
## exam_num:(id:cohort), 453; id:cohort, 156; cohort, 3
## 
## Fixed effects:
##               Estimate Std. Error      df t value Pr(>|t|)   
## (Intercept)    -3.2235     2.6161  3.7275  -1.232  0.28990   
## outcome         0.2971     0.2460  3.5888   1.208  0.30063   
## absPE          -2.8597     0.8460  7.4107  -3.380  0.01079 * 
## PE_flag         2.1393     2.4702  4.7754   0.866  0.42784   
## absPE:PE_flag   4.9014     1.2828  5.6308   3.821  0.00987 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) outcom absPE  PE_flg
## outcome     -0.663                     
## absPE       -0.756  0.270              
## PE_flag     -0.828  0.299  0.721       
## absPE:PE_fl  0.764 -0.564 -0.769 -0.753
## convergence code: 1
## unable to evaluate scaled gradient
## Model failed to converge: degenerate  Hessian with 4 negative eigenvalues
## maxfun < 10 * length(par)^2 is not recommended.

NA model

bc_na ~ outcome + absPE*PE_flag + ( 1 + outcome + absPE*PE_flag | cohort / id / exam_num

## Warning in commonArgs(par, fn, control, environment()): maxfun < 10 *
## length(par)^2 is not recommended.
## Warning in optwrap(optimizer, devfun, getStart(start, rho$lower, rho$pp), :
## convergence code 1 from bobyqa: bobyqa -- maximum number of function
## evaluations exceeded
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control
## $checkConv, : unable to evaluate scaled gradient
## Warning in checkConv(attr(opt, "derivs"), opt$par, ctrl = control
## $checkConv, : Model failed to converge: degenerate Hessian with 3 negative
## eigenvalues
## Warning: Model failed to converge with 3 negative eigenvalues: -9.0e-01
## -2.4e+00 -3.4e+00
## Linear mixed model fit by maximum likelihood . t-tests use
##   Satterthwaite's method [lmerModLmerTest]
## Formula: 
## bc_na ~ outcome + absPE * PE_flag + (1 + outcome + absPE * PE_flag |  
##     cohort/id/exam_num)
##    Data: df.pa.conf.new
## 
##      AIC      BIC   logLik deviance df.resid 
##  22800.0  23103.6 -11349.0  22698.0     2794 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -3.8496 -0.4772 -0.0333  0.4150  4.8073 
## 
## Random effects:
##  Groups               Name          Variance  Std.Dev. Corr             
##  exam_num:(id:cohort) (Intercept)   428.20227 20.6930                   
##                       outcome         5.09196  2.2565  -0.72            
##                       absPE          10.87861  3.2983  -0.77  0.96      
##                       PE_flag        53.42291  7.3091  -0.22 -0.26 -0.12
##                       absPE:PE_flag  37.03820  6.0859   0.37 -0.86 -0.86
##  id:cohort            (Intercept)   133.84152 11.5690                   
##                       outcome         0.97488  0.9874  -0.93            
##                       absPE          11.68266  3.4180  -0.90  0.68      
##                       PE_flag        25.70105  5.0696  -0.81  0.83  0.64
##                       absPE:PE_flag  48.45568  6.9610   0.96 -0.86 -0.90
##  cohort               (Intercept)     3.84233  1.9602                   
##                       outcome         0.02977  0.1726  -1.00            
##                       absPE           0.43506  0.6596  -0.99  0.99      
##                       PE_flag        10.10563  3.1789  -0.88  0.88  0.87
##                       absPE:PE_flag   1.82452  1.3507   0.96 -0.96 -0.96
##  Residual                           108.53625 10.4181                   
##       
##       
##       
##       
##       
##   0.39
##       
##       
##       
##       
##  -0.90
##       
##       
##       
##       
##  -0.97
##       
## Number of obs: 2845, groups:  
## exam_num:(id:cohort), 453; id:cohort, 156; cohort, 3
## 
## Fixed effects:
##               Estimate Std. Error      df t value Pr(>|t|)  
## (Intercept)     6.8578     2.4228  5.7494   2.830   0.0314 *
## outcome        -0.6367     0.2288  7.5423  -2.783   0.0252 *
## absPE           3.0183     0.9261  4.8287   3.259   0.0236 *
## PE_flag        -2.1582     2.8115  4.7766  -0.768   0.4789  
## absPE:PE_flag  -4.5732     1.4531  4.1430  -3.147   0.0330 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) outcom absPE  PE_flg
## outcome     -0.629                     
## absPE       -0.715  0.215              
## PE_flag     -0.722  0.223  0.653       
## absPE:PE_fl  0.731 -0.523 -0.768 -0.751
## convergence code: 1
## unable to evaluate scaled gradient
## Model failed to converge: degenerate  Hessian with 3 negative eigenvalues
## maxfun < 10 * length(par)^2 is not recommended.

Combined PA and NA model

Affect ~ Affect_flag*(outcome + absPE*PE_flag) + ( 1 | cohort / id / exam_num)

## Linear mixed model fit by maximum likelihood . t-tests use
##   Satterthwaite's method [lmerModLmerTest]
## Formula: 
## Affect ~ Affect_flag * (outcome + absPE * PE_flag) + (1 | cohort/id/exam_num)
##    Data: longDF
## 
##      AIC      BIC   logLik deviance df.resid 
##  47755.3  47848.4 -23863.7  47727.3     5676 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.4330 -0.6199 -0.0174  0.5816  4.5795 
## 
## Random effects:
##  Groups               Name        Variance  Std.Dev.
##  exam_num:(id:cohort) (Intercept)   2.98771  1.72850
##  id:cohort            (Intercept)   1.24212  1.11450
##  cohort               (Intercept)   0.00985  0.09925
##  Residual                         253.50962 15.92199
## Number of obs: 5690, groups:  
## exam_num:(id:cohort), 453; id:cohort, 156; cohort, 3
## 
## Fixed effects:
##                            Estimate Std. Error        df t value Pr(>|t|)
## (Intercept)                 10.2840     1.2443  733.7137   8.265 6.55e-16
## Affect_flag                -15.5186     1.6745 5342.5112  -9.268  < 2e-16
## outcome                     -0.9298     0.1423 1808.6651  -6.536 8.20e-11
## absPE                        1.7062     0.3535 1702.4319   4.826 1.51e-06
## PE_flag                     -3.4453     1.0122 1405.2468  -3.404 0.000683
## absPE:PE_flag               -2.3282     0.5454 1562.3794  -4.269 2.08e-05
## Affect_flag:outcome          1.3282     0.1923 5342.5112   6.907 5.52e-12
## Affect_flag:absPE           -3.2340     0.4753 5342.5112  -6.804 1.13e-11
## Affect_flag:PE_flag          7.2601     1.3522 5342.5112   5.369 8.25e-08
## Affect_flag:absPE:PE_flag    4.8869     0.7300 5342.5112   6.695 2.38e-11
##                              
## (Intercept)               ***
## Affect_flag               ***
## outcome                   ***
## absPE                     ***
## PE_flag                   ***
## absPE:PE_flag             ***
## Affect_flag:outcome       ***
## Affect_flag:absPE         ***
## Affect_flag:PE_flag       ***
## Affect_flag:absPE:PE_flag ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) Affct_ outcom absPE  PE_flg aPE:PE Affc_: Af_:PE A_:PE_
## Affect_flag -0.673                                                        
## outcome     -0.766  0.523                                                 
## absPE       -0.695  0.475  0.309                                          
## PE_flag     -0.423  0.280 -0.100  0.529                                   
## absPE:PE_fl  0.552 -0.374 -0.335 -0.688 -0.661                            
## Affct_flg:t  0.521 -0.774 -0.676 -0.218  0.068  0.227                     
## Affct_fl:PE  0.475 -0.706 -0.219 -0.672 -0.355  0.463  0.324              
## Affct_f:PE_  0.282 -0.419  0.068 -0.357 -0.668  0.445 -0.101  0.532       
## Aff_:PE:PE_ -0.376  0.559  0.229  0.466  0.445 -0.669 -0.339 -0.693 -0.666

Note: - No random effects in model. Unsure of how to specify random effects with a nested interaction. - Model fails to converge when nested interaction is included in the random effects