Database

# panamath_custom_data = readxl::read_xlsx("csv_files/processed_data/ams/lf_files/lf_mn_ams_2024-07-24_all.xlsx", sheet = "lf_mn_ams_2024-07-24")
#panamath_custom_data = readxl::read_xlsx("csv_files/processed_data/ams/lf_files/lf_mn_ams_2024-07-24_all.xlsx", sheet = "lf_mn_ams_2024-08-07")
panamath_participants = readxl::read_xlsx("/Volumes/BL-PSY-gunderson_lab/Main/Studies/2023_manynumbers/participant_lists/participantlist_panamath_custom_pilot.xlsx")
panamath_participants = subset(panamath_participants, remove!=1)

panamath_custom_data1 = read.csv("2024_nie_pilot/csv_files/processed_data/ams/lf_files/lf_mn_ams_2024-08-21.csv")
panamath_custom_data2 = read.csv("2024_ucsd_pilot_panamath/csv_files/processed_data/ams/lf_files/lf_mn_ams_2024-08-09.csv")
panamath_custom_data3 = read.csv("2024_iu_pilot_panamath/csv_files/processed_data/ams/lf_files/lf_mn_ams_2024-08-18.csv")

panamath_custom_data=rbind(panamath_custom_data1, panamath_custom_data2, panamath_custom_data3)
panamath_custom_data = panamath_custom_data[which(panamath_custom_data$participant %in% panamath_participants$participant),]

Practice trials

Analyses

df_acc_noout_practice = subset(panamath_custom_data, block == "practice")
df_acc_noout_practice = subset(df_acc_noout_practice, participant != "mn024")
df_acc_noout_practice$practice_block = ifelse(df_acc_noout_practice$X <10, "block1","block2")
table(df_acc_noout_practice$participant)
## 
##   240630a     cohen   finnley    harper      lfp1     lfp10     lfp11      lfp2 
##        12         6         6         6        12         6        12        12 
##      lfp4      lfp5      lfp7      lfp8      lfp9     mn046     mn048     mn052 
##         6         6         6        12         6        12        12         6 
##     mn054     mn055     mn056     mn057     mn058     mn059     mn060     mn061 
##        12         6         6         6         6         6        12         6 
##     mn062     mn063     mn064     mn065 MOC2Emily  MOC2Liam 
##         6        12        12        12        12         6
agg_ams_task_practice = aggregate(accuracy ~  participant*numRatio*practice_block*age, df_acc_noout_practice, mean)
descriptive_amstask_practice = summarySE(agg_ams_task_practice, "accuracy", c("numRatio","practice_block"))
kable(descriptive_amstask_practice, table.attr = "style = \"color: white;\"")
numRatio practice_block N accuracy sd se ci
3.5 block1 30 0.6333333 0.2949122 0.0538433 0.1101220
3.5 block2 13 0.6153846 0.2995723 0.0830864 0.1810298
4.0 block1 30 0.6111111 0.3042903 0.0555556 0.1136239
4.0 block2 13 0.5641026 0.3438512 0.0953672 0.2077872
##            
##             block1 block2
##   240630a        2      2
##   lfp1           2      2
##   lfp11          2      2
##   lfp2           2      2
##   lfp8           2      2
##   mn046          2      2
##   mn048          2      2
##   mn054          2      2
##   mn060          2      2
##   mn063          2      2
##   mn064          2      2
##   mn065          2      2
##   MOC2Emily      2      2
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: accuracy ~ +numRatio * practice_block + +(1 | participant)
##    Data: agg_ams_task_practice
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##     74.7     84.5    -32.4     64.7       47 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -1.8257 -0.2434 -0.1054  0.5557  1.2649 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  participant (Intercept) 0        0       
## Number of obs: 52, groups:  participant, 13
## 
## Fixed effects:
##                                         Estimate      Std. Error z value
## (Intercept)                      -0.470003641049  0.570087663279  -0.824
## numRatio3.5                       0.000000005885  0.806225830093   0.000
## practice_blockblock2              1.673976503865  0.870823199943   1.922
## numRatio3.5:practice_blockblock2 -0.393042722239  1.201850399147  -0.327
##                                  Pr(>|z|)  
## (Intercept)                        0.4097  
## numRatio3.5                        1.0000  
## practice_blockblock2               0.0546 .
## numRatio3.5:practice_blockblock2   0.7436  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) nmR3.5 prct_2
## numRatio3.5 -0.707              
## prctc_blck2 -0.655  0.463       
## nmRt3.5:p_2  0.474 -0.671 -0.725
## optimizer (bobyqa) convergence code: 0 (OK)
## boundary (singular) fit: see help('isSingular')
## Analysis of Deviance Table (Type III Wald chisquare tests)
## 
## Response: accuracy
##                          Chisq Df Pr(>Chisq)  
## (Intercept)             0.6797  1    0.40969  
## numRatio                0.0000  1    1.00000  
## practice_block          3.6952  1    0.05457 .
## numRatio:practice_block 0.1069  1    0.74364  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Experimental trials - All

Figure

visual_control numRatio N accuracy sd se ci
custom 2.0 7 0.5119048 0.1311326 0.0495635 0.1212775
custom 2.5 22 0.6060606 0.2302831 0.0490965 0.1021018
custom 3.0 29 0.6465517 0.1845404 0.0342683 0.0701954
Panamath 2.5 30 0.6388889 0.2370530 0.0432798 0.0885170
Panamath 3.0 30 0.6027778 0.2632352 0.0480600 0.0982936

Analyses

## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: accuracy ~ +numRatio * visual_control * block + +(1 | participant)
##    Data: df_acc_noout_experimental
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1714.0   1761.1   -848.0   1696.0     1380 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.1268 -0.9928  0.3597  0.8267  1.4875 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  participant (Intercept) 0.862    0.9285  
## Number of obs: 1389, groups:  participant, 30
## 
## Fixed effects:
##                                             Estimate Std. Error z value
## (Intercept)                                  -0.2365     0.8849  -0.267
## numRatio                                      0.4540     0.3183   1.426
## visual_controlPanamath                        2.0464     1.5465   1.323
## blockblock2                                  -1.1798     1.3746  -0.858
## numRatio:visual_controlPanamath              -0.9846     0.5518  -1.784
## numRatio:blockblock2                          0.1580     0.4922   0.321
## visual_controlPanamath:blockblock2           -0.1565     2.3940  -0.065
## numRatio:visual_controlPanamath:blockblock2   0.5655     0.8365   0.676
##                                             Pr(>|z|)  
## (Intercept)                                   0.7893  
## numRatio                                      0.1538  
## visual_controlPanamath                        0.1858  
## blockblock2                                   0.3907  
## numRatio:visual_controlPanamath               0.0744 .
## numRatio:blockblock2                          0.7482  
## visual_controlPanamath:blockblock2            0.9479  
## numRatio:visual_controlPanamath:blockblock2   0.4990  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Correlation of Fixed Effects:
##             (Intr) numRat vsl_cP blckb2 nmR:_P nmRt:2 vs_P:2
## numRatio    -0.951                                          
## vsl_cntrlPn -0.571  0.543                                   
## blockblock2 -0.643  0.612  0.393                            
## nmRt:vsl_cP  0.547 -0.576 -0.969 -0.351                     
## nmRt:blckb2  0.615 -0.647 -0.350 -0.960  0.371              
## vsl_cntrP:2  0.398 -0.352 -0.677 -0.609  0.626  0.551       
## nmRt:vs_P:2 -0.361  0.380  0.638  0.563 -0.659 -0.587 -0.953
## Analysis of Deviance Table (Type III Wald chisquare tests)
## 
## Response: accuracy
##                                Chisq Df Pr(>Chisq)  
## (Intercept)                   0.0714  1    0.78930  
## numRatio                      2.0346  1    0.15376  
## visual_control                1.7509  1    0.18577  
## block                         0.7367  1    0.39073  
## numRatio:visual_control       3.1839  1    0.07437 .
## numRatio:block                0.1030  1    0.74825  
## visual_control:block          0.0043  1    0.94789  
## numRatio:visual_control:block 0.4571  1    0.49897  
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

## $emtrends
## block = block1:
##  visual_control numRatio.trend    SE  df asymp.LCL asymp.UCL z.ratio p.value
##  custom                  0.454 0.318 Inf    -0.170     1.078   1.426  0.1538
##  Panamath               -0.531 0.451 Inf    -1.415     0.354  -1.176  0.2395
## 
## block = block2:
##  visual_control numRatio.trend    SE  df asymp.LCL asymp.UCL z.ratio p.value
##  custom                  0.612 0.375 Inf    -0.124     1.348   1.630  0.1031
##  Panamath                0.193 0.505 Inf    -0.797     1.183   0.382  0.7025
## 
## Confidence level used: 0.95 
## 
## $contrasts
## block = block1:
##  contrast          estimate    SE  df asymp.LCL asymp.UCL z.ratio p.value
##  custom - Panamath    0.985 0.552 Inf   -0.0969      2.07   1.784  0.0744
## 
## block = block2:
##  contrast          estimate    SE  df asymp.LCL asymp.UCL z.ratio p.value
##  custom - Panamath    0.419 0.629 Inf   -0.8142      1.65   0.666  0.5054
## 
## Confidence level used: 0.95
## $emmeans
## numRatio = 2.0, block = block1:
##  visual_control  prob     SE  df asymp.LCL asymp.UCL null z.ratio p.value
##  custom         0.662 0.0765 Inf     0.500     0.793  0.5   1.964  0.0496
##  Panamath       0.679 0.0941 Inf     0.476     0.831  0.5   1.735  0.0827
## 
## numRatio = 2.5, block = block1:
##  visual_control  prob     SE  df asymp.LCL asymp.UCL null z.ratio p.value
##  custom         0.711 0.0571 Inf     0.588     0.809  0.5   3.236  0.0012
##  Panamath       0.619 0.0683 Inf     0.479     0.741  0.5   1.669  0.0951
## 
## numRatio = 3.0, block = block1:
##  visual_control  prob     SE  df asymp.LCL asymp.UCL null z.ratio p.value
##  custom         0.755 0.0548 Inf     0.633     0.846  0.5   3.796  0.0001
##  Panamath       0.554 0.0713 Inf     0.414     0.687  0.5   0.755  0.4500
## 
## numRatio = 2.0, block = block2:
##  visual_control  prob     SE  df asymp.LCL asymp.UCL null z.ratio p.value
##  custom         0.452 0.0938 Inf     0.282     0.634  0.5  -0.508  0.6115
##  Panamath       0.703 0.0976 Inf     0.486     0.855  0.5   1.839  0.0659
## 
## numRatio = 2.5, block = block2:
##  visual_control  prob     SE  df asymp.LCL asymp.UCL null z.ratio p.value
##  custom         0.528 0.0698 Inf     0.393     0.660  0.5   0.406  0.6850
##  Panamath       0.722 0.0608 Inf     0.589     0.825  0.5   3.154  0.0016
## 
## numRatio = 3.0, block = block2:
##  visual_control  prob     SE  df asymp.LCL asymp.UCL null z.ratio p.value
##  custom         0.603 0.0694 Inf     0.463     0.729  0.5   1.446  0.1481
##  Panamath       0.741 0.0585 Inf     0.612     0.839  0.5   3.453  0.0006
## 
## Confidence level used: 0.95 
## Intervals are back-transformed from the logit scale 
## Tests are performed on the logit scale 
## 
## $contrasts
## numRatio = 2, block = block1:
##  contrast          odds.ratio    SE  df asymp.LCL asymp.UCL null z.ratio
##  custom / Panamath      0.926 0.509 Inf     0.315     2.718    1  -0.140
##  p.value
##   0.8885
## 
## numRatio = 2.5, block = block1:
##  contrast          odds.ratio    SE  df asymp.LCL asymp.UCL null z.ratio
##  custom / Panamath      1.515 0.606 Inf     0.691     3.319    1   1.037
##  p.value
##   0.2996
## 
## numRatio = 3, block = block1:
##  contrast          odds.ratio    SE  df asymp.LCL asymp.UCL null z.ratio
##  custom / Panamath      2.478 1.024 Inf     1.103     5.570    1   2.197
##  p.value
##   0.0280
## 
## numRatio = 2, block = block2:
##  contrast          odds.ratio    SE  df asymp.LCL asymp.UCL null z.ratio
##  custom / Panamath      0.349 0.210 Inf     0.108     1.135    1  -1.750
##  p.value
##   0.0801
## 
## numRatio = 2.5, block = block2:
##  contrast          odds.ratio    SE  df asymp.LCL asymp.UCL null z.ratio
##  custom / Panamath      0.431 0.178 Inf     0.192     0.966    1  -2.044
##  p.value
##   0.0410
## 
## numRatio = 3, block = block2:
##  contrast          odds.ratio    SE  df asymp.LCL asymp.UCL null z.ratio
##  custom / Panamath      0.531 0.223 Inf     0.233     1.210    1  -1.506
##  p.value
##   0.1321
## 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log odds ratio scale 
## Tests are performed on the log odds ratio scale

Experimental trials - NIE only

Figure

visual_control numRatio N accuracy sd se ci
custom 2.5 22 0.6060606 0.2302831 0.0490965 0.1021018
custom 3.0 22 0.6439394 0.1910390 0.0407297 0.0847020
Panamath 2.5 23 0.6557971 0.2347688 0.0489527 0.1015216
Panamath 3.0 23 0.6014493 0.2929695 0.0610884 0.1266895

Analyses

visual_control numRatio block N accuracy sd se ci
custom 2.5 block1 10 0.6833333 0.2383068 0.0753592 0.1704744
custom 2.5 block2 12 0.5416667 0.2117150 0.0611169 0.1345173
custom 3.0 block1 10 0.7416667 0.1687371 0.0533594 0.1207073
custom 3.0 block2 12 0.5625000 0.1745304 0.0503826 0.1108913
Panamath 2.5 block1 13 0.5833333 0.2041241 0.0566139 0.1233510
Panamath 2.5 block2 10 0.7500000 0.2484520 0.0785674 0.1777319
Panamath 3.0 block1 13 0.5384615 0.2670470 0.0740655 0.1613749
Panamath 3.0 block2 10 0.6833333 0.3186585 0.1007687 0.2279545
## Generalized linear mixed model fit by maximum likelihood (Laplace
##   Approximation) [glmerMod]
##  Family: binomial  ( logit )
## Formula: accuracy ~ +numRatio * visual_control * block + +(1 | participant)
##    Data: df_acc_noout_experimental2
## Control: glmerControl(optimizer = "bobyqa")
## 
##      AIC      BIC   logLik deviance df.resid 
##   1257.9   1302.5   -619.9   1239.9     1044 
## 
## Scaled residuals: 
##     Min      1Q  Median      3Q     Max 
## -4.5281 -0.9697  0.2735  0.8114  1.4162 
## 
## Random effects:
##  Groups      Name        Variance Std.Dev.
##  participant (Intercept) 1.117    1.057   
## Number of obs: 1053, groups:  participant, 23
## 
## Fixed effects:
##                                             Estimate Std. Error z value
## (Intercept)                                  -0.6736     1.7554  -0.384
## numRatio                                      0.6956     0.6269   1.110
## visual_controlPanamath                        2.0501     2.2289   0.920
## blockblock2                                   0.4528     2.2526   0.201
## numRatio:visual_controlPanamath              -1.0762     0.7931  -1.357
## numRatio:blockblock2                         -0.5071     0.8019  -0.632
## visual_controlPanamath:blockblock2            0.5834     3.3334   0.175
## numRatio:visual_controlPanamath:blockblock2   0.5293     1.1625   0.455
##                                             Pr(>|z|)
## (Intercept)                                    0.701
## numRatio                                       0.267
## visual_controlPanamath                         0.358
## blockblock2                                    0.841
## numRatio:visual_controlPanamath                0.175
## numRatio:blockblock2                           0.527
## visual_controlPanamath:blockblock2             0.861
## numRatio:visual_controlPanamath:blockblock2    0.649
## 
## Correlation of Fixed Effects:
##             (Intr) numRat vsl_cP blckb2 nmR:_P nmRt:2 vs_P:2
## numRatio    -0.976                                          
## vsl_cntrlPn -0.787  0.768                                   
## blockblock2 -0.779  0.760  0.630                            
## nmRt:vsl_cP  0.771 -0.790 -0.975 -0.600                     
## nmRt:blckb2  0.763 -0.781 -0.600 -0.975  0.617              
## vsl_cntrP:2  0.545 -0.512 -0.696 -0.702  0.651  0.658       
## nmRt:vs_P:2 -0.526  0.538  0.665  0.673 -0.682 -0.689 -0.958
## Analysis of Deviance Table (Type III Wald chisquare tests)
## 
## Response: accuracy
##                                Chisq Df Pr(>Chisq)
## (Intercept)                   0.1472  1     0.7012
## numRatio                      1.2315  1     0.2671
## visual_control                0.8461  1     0.3577
## block                         0.0404  1     0.8407
## numRatio:visual_control       1.8415  1     0.1748
## numRatio:block                0.3999  1     0.5272
## visual_control:block          0.0306  1     0.8611
## numRatio:visual_control:block 0.2073  1     0.6489

## $emtrends
## block = block1:
##  visual_control numRatio.trend    SE  df asymp.LCL asymp.UCL z.ratio p.value
##  custom                  0.696 0.627 Inf    -0.533     1.924   1.110  0.2671
##  Panamath               -0.381 0.487 Inf    -1.334     0.573  -0.782  0.4341
## 
## block = block2:
##  visual_control numRatio.trend    SE  df asymp.LCL asymp.UCL z.ratio p.value
##  custom                  0.189 0.501 Inf    -0.793     1.170   0.377  0.7064
##  Panamath               -0.358 0.687 Inf    -1.705     0.988  -0.522  0.6020
## 
## Results are averaged over the levels of: numRatio 
## Confidence level used: 0.95 
## 
## $contrasts
## block = block1:
##  contrast          estimate    SE  df asymp.LCL asymp.UCL z.ratio p.value
##  custom - Panamath    1.076 0.793 Inf    -0.478      2.63   1.357  0.1748
## 
## block = block2:
##  contrast          estimate    SE  df asymp.LCL asymp.UCL z.ratio p.value
##  custom - Panamath    0.547 0.850 Inf    -1.120      2.21   0.643  0.5201
## 
## Results are averaged over the levels of: numRatio 
## Confidence level used: 0.95
## $emmeans
## numRatio = 2.5, block = block1:
##  visual_control  prob     SE  df asymp.LCL asymp.UCL null z.ratio p.value
##  custom         0.744 0.0775 Inf     0.567     0.866  0.5   2.619  0.0088
##  Panamath       0.605 0.0817 Inf     0.439     0.749  0.5   1.244  0.2136
## 
## numRatio = 3.0, block = block1:
##  visual_control  prob     SE  df asymp.LCL asymp.UCL null z.ratio p.value
##  custom         0.804 0.0652 Inf     0.646     0.903  0.5   3.410  0.0006
##  Panamath       0.558 0.0842 Inf     0.393     0.712  0.5   0.688  0.4917
## 
## numRatio = 2.5, block = block2:
##  visual_control  prob     SE  df asymp.LCL asymp.UCL null z.ratio p.value
##  custom         0.562 0.0851 Inf     0.395     0.717  0.5   0.725  0.4685
##  Panamath       0.820 0.0629 Inf     0.664     0.913  0.5   3.558  0.0004
## 
## numRatio = 3.0, block = block2:
##  visual_control  prob     SE  df asymp.LCL asymp.UCL null z.ratio p.value
##  custom         0.585 0.0840 Inf     0.417     0.736  0.5   0.997  0.3189
##  Panamath       0.792 0.0693 Inf     0.625     0.897  0.5   3.177  0.0015
## 
## Confidence level used: 0.95 
## Intervals are back-transformed from the logit scale 
## Tests are performed on the logit scale 
## 
## $contrasts
## numRatio = 2.5, block = block1:
##  contrast          odds.ratio    SE  df asymp.LCL asymp.UCL null z.ratio
##  custom / Panamath      1.897 1.006 Inf    0.6714     5.361    1   1.208
##  p.value
##   0.2269
## 
## numRatio = 3, block = block1:
##  contrast          odds.ratio    SE  df asymp.LCL asymp.UCL null z.ratio
##  custom / Panamath      3.250 1.741 Inf    1.1372     9.286    1   2.200
##  p.value
##   0.0278
## 
## numRatio = 2.5, block = block2:
##  contrast          odds.ratio    SE  df asymp.LCL asymp.UCL null z.ratio
##  custom / Panamath      0.282 0.154 Inf    0.0963     0.825    1  -2.312
##  p.value
##   0.0208
## 
## numRatio = 3, block = block2:
##  contrast          odds.ratio    SE  df asymp.LCL asymp.UCL null z.ratio
##  custom / Panamath      0.371 0.202 Inf    0.1276     1.076    1  -1.825
##  p.value
##   0.0680
## 
## Confidence level used: 0.95 
## Intervals are back-transformed from the log odds ratio scale 
## Tests are performed on the log odds ratio scale

Analyses

## 
##  Pearson's product-moment correlation
## 
## data:  .$age and .$Panamath
## t = 2.7574, df = 20, p-value = 0.01215
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.1325611 0.7749646
## sample estimates:
##      cor 
## 0.524837
## 
##  Pearson's product-moment correlation
## 
## data:  .$age and .$custom
## t = 4.6606, df = 20, p-value = 0.0001506
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.4310708 0.8765100
## sample estimates:
##       cor 
## 0.7215437
## 
##  Pearson's product-moment correlation
## 
## data:  .$custom and .$Panamath
## t = 5.6948, df = 20, p-value = 0.00001423
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.5458695 0.9072530
## sample estimates:
##       cor 
## 0.7864759