@@ -985,27 +985,46 @@ plot(ospanScores, symspanScores,
985
985
lines(x = c(-1, 2), y = c(-1, 2)) # so line extends to edge
986
986
987
987
capacity_HighP1_lowN1 = (compositeSpanScores > median_compositespan)*2-1;
988
+ # NOTE: This is all participants who completed the WMC task
989
+ # Includes people we drop from e.g. decision-making analysis
988
990
989
- sum(capacity_HighP1_lowN1 == 1, na.rm = T) # 41
990
- sum(capacity_HighP1_lowN1 == -1, na.rm = T) # 44
991
+ sum(capacity_HighP1_lowN1 == 1, na.rm = T) # 41 (all participants)
992
+ sum(capacity_HighP1_lowN1 == -1, na.rm = T) # 44 (all participants)
991
993
992
994
# Plot the distribution w/ the median value
993
995
hist(compositeSpanScores, breaks = 10, xlab = 'Composite Span Score', main = 'Distribution of Spans');
994
996
abline(v = median_compositespan, col = 'red', lwd = 5)
995
997
996
998
999
+ # Limiting analysis to those people we kept for DECISION-MAKING ANALYSIS...
1000
+ sum(clean_data_complexspan$compositeSpanScore > median(clean_data_complexspan$compositeSpanScore, na.rm = T), na.rm = T)
1001
+ sum(clean_data_complexspan$compositeSpanScore <= median(clean_data_complexspan$compositeSpanScore, na.rm = T), na.rm = T)
1002
+ # 41 with > median capacity
1003
+ # 41 with <= median capacity
1004
+
1005
+ # Create *CLEAN DATA* capacity median split
1006
+ clean_data_complexspan$capacity_HighP1_lowN1 = (clean_data_complexspan$compositeSpanScore >
1007
+ median(clean_data_complexspan$compositeSpanScore, na.rm = T))*2-1;
1008
+
997
1009
clean_data_dm$capacity_HighP1_lowN1 = NA;
998
1010
999
1011
for(s in 1:number_of_clean_subjects){
1000
1012
subj_id = keep_participants[s];
1001
- clean_data_dm$capacity_HighP1_lowN1[clean_data_dm$subjectnumber == subj_id] = capacity_HighP1_lowN1[s];
1013
+ clean_data_dm$capacity_HighP1_lowN1[clean_data_dm$subjectnumber == subj_id] =
1014
+ clean_data_complexspan$capacity_HighP1_lowN1[clean_data_complexspan$subjectnumber == subj_id];
1002
1015
}
1003
1016
1004
1017
clean_data_dm$complexspan_demeaned = clean_data_dm$complexspan - mean_compositespan;
1005
1018
1006
- plot(sort(compositeSpanScores))
1019
+ # all subjects
1020
+ plot(sort(compositeSpanScores), main = 'All participants')
1007
1021
abline(h = median_compositespan, col = 'red', lwd = 2)
1008
1022
1023
+ # just clean subjects
1024
+ plot(sort(clean_data_complexspan$compositeSpanScore), main = 'Clean participants')
1025
+ abline(h = median(clean_data_complexspan$compositeSpanScore, na.rm = T), col = 'red', lwd = 2)
1026
+
1027
+
1009
1028
# Easy vs. Difficult in WMC - From thesis
1010
1029
1011
1030
rt_mean__Hcap_test = t.test(mean_rt_easy[capacity_HighP1_lowN1 == 1], mean_rt_diff[capacity_HighP1_lowN1 == 1], paired = T) #
@@ -1420,12 +1439,12 @@ m2_capacityContDiff_intxn_rfx = lmer(sqrtRT ~ 1 + all_diff_cont * capacity_HighP
1420
1439
summary(m2_capacityContDiff_intxn_rfx)
1421
1440
# SAME PATTERN If you use continuous difficulty instead of categorical difficulty
1422
1441
1423
- # effect of difficulty is 0.118 for HIGH CAPACITY
1424
- # effect of difficulty is 0.100 for LOW CAPACITY
1442
+ # effect of difficulty is 0.127 for HIGH CAPACITY
1443
+ # effect of difficulty is 0.084 for LOW CAPACITY
1425
1444
1426
1445
1427
- AIC(m2_capacityCatDiff_intxn_rfx) # AIC: -5874.978
1428
- AIC(m2_capacityContDiff_intxn_rfx) # AIC: -6026.223 (CONTINUOUS IS BETTER)
1446
+ AIC(m2_capacityCatDiff_intxn_rfx) # AIC: -8514.704
1447
+ AIC(m2_capacityContDiff_intxn_rfx) # AIC: -8699.212 (CONTINUOUS IS BETTER)
1429
1448
1430
1449
1431
1450
# Model 3: What role does high/low cognitive capacity have on CURRENT AND PREVIOUS TRIAL EFFECTS
@@ -1454,8 +1473,8 @@ m3_prev_diffCont_capacityCat_intxn_rfx = lmer(sqrtRT ~ 1 +
1454
1473
all_diff_cont * prev_all_diff_cont * capacity_HighP1_lowN1 +
1455
1474
(1 | subjectnumber), data = clean_data_dm);
1456
1475
summary(m3_prev_diffCont_capacityCat_intxn_rfx)
1457
- # Besides main effects of current and previous difficulty, NO INTERACTIONS between capacity and
1458
- # difficulty (current or previous).
1476
+ # Besides main effects of current and previous difficulty, ONLY interaction is between
1477
+ # current difficulty and capacity (steeper for higher difficulty folks)
1459
1478
1460
1479
1461
1480
@@ -1470,20 +1489,21 @@ AIC(m3_prev_diffCont_capacityCat_intxn_rfx) # Be careful when reporting; has few
1470
1489
#
1471
1490
# MODEL OUTPUT
1472
1491
# Estimate Std. Error df t value Pr(>|t|)
1473
- # (Intercept) 1.222e+00 1.333e-02 6.778e+01 91.669 < 2e-16 ***
1474
- # all_diff_cont 1.085e-01 6.697e-03 9.839e+03 16.204 < 2e-16 ***
1475
- # prev_all_diff_cont -3.647e-02 6.721e-03 9.840e+03 -5.426 5.91e-08 ***
1476
- # capacity_HighP1_lowN1 -1.606e-02 1.333e-02 6.778e+01 -1.205 0.233
1477
- # all_diff_cont:prev_all_diff_cont 6.487e-03 1.014e-02 9.834e+03 0.640 0.522
1478
- # all_diff_cont:capacity_HighP1_lowN1 8.721e-03 6.697e-03 9.839e+03 1.302 0.193
1479
- # prev_all_diff_cont:capacity_HighP1_lowN1 6.921e-03 6.721e-03 9.840e+03 1.030 0.303
1480
- # all_diff_cont:prev_all_diff_cont:capacity_HighP1_lowN1 4.349e-05 1.014e-02 9.834e+03 0.004 0.997
1492
+ # Estimate Std. Error df t value Pr(>|t|)
1493
+ # (Intercept) 1.211e+00 1.194e-02 9.447e+01 101.409 < 2e-16 ***
1494
+ # all_diff_cont 1.051e-01 5.767e-03 1.367e+04 18.220 < 2e-16 ***
1495
+ # prev_all_diff_cont -3.496e-02 5.777e-03 1.367e+04 -6.052 1.47e-09 ***
1496
+ # capacity_HighP1_lowN1 -9.077e-03 1.194e-02 9.447e+01 -0.760 0.44896
1497
+ # all_diff_cont:prev_all_diff_cont 6.018e-03 8.654e-03 1.367e+04 0.695 0.48683
1498
+ # all_diff_cont:capacity_HighP1_lowN1 1.534e-02 5.767e-03 1.367e+04 2.659 0.00784 **
1499
+ # prev_all_diff_cont:capacity_HighP1_lowN1 -2.297e-04 5.777e-03 1.367e+04 -0.040 0.96828
1500
+ # all_diff_cont:prev_all_diff_cont:capacity_HighP1_lowN1 1.200e-02 8.654e-03 1.367e+04 1.387 0.16543
1481
1501
#
1482
1502
# Current difficulty = slower RTs (found previously)
1483
1503
# Prev. difficulty = faster RTs (found previously)
1484
1504
# Curr. & prev. difficulty do NOT interact to influence reaction time.
1485
1505
#
1486
- # Capacity = no net effect! [contrary to hypotheses]
1506
+ # Capacity interacts with current difficulty. No interaction w/ prev. difficulty.
1487
1507
#
1488
1508
# in CGT, Capacity interacted with CURRENT difficulty to potentiate slowing due to difficulty
1489
1509
# for high capacity people, and attenuate that effect for low capacity people. NOT SO IN CGE!
@@ -1536,51 +1556,46 @@ m3_prev_diffCont_capacityCat_intxn_HIGHONLYrfx = lmer(sqrtRT ~ 1 +
1536
1556
data = clean_data_dm[clean_data_dm$capacity_HighP1_lowN1 == 1,]);
1537
1557
summary(m3_prev_diffCont_capacityCat_intxn_HIGHONLYrfx)
1538
1558
# Fixed effects:
1539
- # Estimate Std. Error df t value Pr(>|t|)
1540
- # (Intercept) 1.206e+00 1.750e-02 3.289e+01 68.920 < 2e-16 ***
1541
- # all_diff_cont 1.172e-01 8.756e-03 4.845e+03 13.387 < 2e-16 ***
1542
- # prev_all_diff_cont -2.957e-02 8.816e-03 4.845e+03 -3.355 0.000801 ***
1543
- # all_diff_cont:prev_all_diff_cont 6.550e-03 1.346e-02 4.843e+03 0.486 0.626637
1544
-
1559
+ # Estimate Std. Error df t value Pr(>|t|)
1560
+ # (Intercept) 1.202e+00 1.601e-02 4.677e+01 75.062 < 2e-16 ***
1561
+ # all_diff_cont 1.204e-01 7.735e-03 6.842e+03 15.566 < 2e-16 ***
1562
+ # prev_all_diff_cont -3.520e-02 7.774e-03 6.842e+03 -4.528 6.06e-06 ***
1563
+ # all_diff_cont:prev_all_diff_cont 1.804e-02 1.179e-02 6.840e+03 1.530 0.126
1545
1564
# Contrary to CGT, there *IS* a significant effect of previous difficulty for high capacity folks.
1546
1565
1547
1566
m3_prev_diffCont_capacityCat_intxn_LOWONLYrfx = lmer(sqrtRT ~ 1 +
1548
1567
all_diff_cont * prev_all_diff_cont +
1549
1568
(1 | subjectnumber), data = clean_data_dm[clean_data_dm$capacity_HighP1_lowN1 == -1,]);
1550
1569
summary(m3_prev_diffCont_capacityCat_intxn_LOWONLYrfx)
1551
1570
# Fixed effects:
1552
- # Estimate Std. Error df t value Pr(>|t|)
1553
- # (Intercept) 1.238e +00 2.005e -02 3.495e +01 61.757 < 2e-16 ***
1554
- # all_diff_cont 9.980e -02 1.018e-02 4.995e +03 9.806 < 2e-16 ***
1555
- # prev_all_diff_cont -4.340e -02 1.018e-02 4.995e +03 -4.261 2.07e -05 ***
1556
- # all_diff_cont:prev_all_diff_cont 6.464e -03 1.519e -02 4.992e +03 0.425 0.67
1571
+ # Estimate Std. Error df t value Pr(>|t|)
1572
+ # (Intercept) 1.220e +00 1.772e -02 4.762e +01 68.852 < 2e-16 ***
1573
+ # all_diff_cont 8.977e -02 8.554e-03 6.831e +03 10.494 < 2e-16 ***
1574
+ # prev_all_diff_cont -3.471e -02 8.545e-03 6.832e +03 -4.062 4.92e -05 ***
1575
+ # all_diff_cont:prev_all_diff_cont -5.979e -03 1.267e -02 6.828e +03 -0.472 0.637
1557
1576
1558
- # The effect of previous difficulty is STRONGER in low capacity people (just not sig. so)
1577
+ # The effect of previous difficulty is similar in low capacity people (just not sig. so)
1559
1578
1560
1579
# THESE FINDINGS TOTALLY PARALLEL THE COMPLEX INTERACTIVE MODEL ABOVE AND BACK UP THE OBSERVATIONS MADE THERE.
1561
1580
1562
- for (s in 1:number_of_clean_subjects){
1563
- subj_id = keep_participants[s];
1564
- clean_data_dm$diff_cont[subj_id] = abs(abs(clean_data_dm$choiceP[subj_id] - 0.5)*2-1); # JUST for the easy/difficult dynamic trials
1565
- clean_data_dm$all_diff_cont[subj_id] = abs(abs(clean_data_dm$all_choiceP[subj_id] - 0.5)*2-1); # for ALL trials
1566
- clean_data_dm$capacity_HighP1_lowN1[clean_data_dm$subjectnumber == subj_id] = capacity_HighP1_lowN1[s];
1567
-
1568
- m3_prev_diffCont_capacityCat_intxn_HIGHONLYrfx = lmer(sqrtRT ~ 1 +
1569
- all_diff_cont * prev_all_diff_cont +
1570
- (1 | subjectnumber),
1571
- data = clean_data_dm[clean_data_dm$capacity_HighP1_lowN1 == 1,]);
1572
- summary(m3_prev_diffCont_capacityCat_intxn_HIGHONLYrfx)
1573
-
1574
- m3_prev_diffCont_capacityCat_intxn_LOWONLYrfx = lmer(sqrtRT ~ 1 +
1575
- all_diff_cont * prev_all_diff_cont +
1576
- (1 | subjectnumber), data = clean_data_dm[clean_data_dm$capacity_HighP1_lowN1 == -1,]);
1577
- summary(m3_prev_diffCont_capacityCat_intxn_LOWONLYrfx)
1578
- }
1581
+ # for (s in 1:number_of_clean_subjects){
1582
+ # subj_id = keep_participants[s];
1583
+ # # clean_data_dm$diff_cont[subj_id] = abs(abs(clean_data_dm$choiceP[subj_id] - 0.5)*2-1); # JUST for the easy/difficult dynamic trials
1584
+ # # clean_data_dm$all_diff_cont[subj_id] = abs(abs(clean_data_dm$all_choiceP[subj_id] - 0.5)*2-1); # for ALL trials
1585
+ # # clean_data_dm$capacity_HighP1_lowN1[clean_data_dm$subjectnumber == subj_id] = capacity_HighP1_lowN1[s];
1586
+ #
1587
+ # m3_prev_diffCont_capacityCat_intxn_HIGHONLYrfx = lmer(sqrtRT ~ 1 +
1588
+ # all_diff_cont * prev_all_diff_cont +
1589
+ # (1 | subjectnumber),
1590
+ # data = clean_data_dm[clean_data_dm$capacity_HighP1_lowN1 == 1,]);
1591
+ # summary(m3_prev_diffCont_capacityCat_intxn_HIGHONLYrfx)
1592
+ #
1593
+ # m3_prev_diffCont_capacityCat_intxn_LOWONLYrfx = lmer(sqrtRT ~ 1 +
1594
+ # all_diff_cont * prev_all_diff_cont +
1595
+ # (1 | subjectnumber), data = clean_data_dm[clean_data_dm$capacity_HighP1_lowN1 == -1,]);
1596
+ # summary(m3_prev_diffCont_capacityCat_intxn_LOWONLYrfx)
1597
+ # }
1579
1598
1580
- for(s in 1:number_of_clean_subjects){
1581
- subj_id = keep_participants[s];
1582
- clean_data_dm$capacity_HighP1_lowN1[clean_data_dm$subjectnumber == subj_id] = capacity_HighP1_lowN1[s];
1583
- }
1584
1599
1585
1600
# Examine best-fitting threshold values
1586
1601
possible_threshold_values = sort(unique(compositeSpanScores))+.000001;
@@ -1595,13 +1610,14 @@ for(ind in 1:length(possible_threshold_values)){
1595
1610
clean_data_dm$capacity_HighP1_lowN1_temp[clean_data_dm$complexspan > break_val] = 1;
1596
1611
clean_data_dm$capacity_HighP1_lowN1_temp[clean_data_dm$complexspan < break_val] = -1;
1597
1612
1598
- cat(sprintf('This many people are < break_val: %g\n',sum(compositeSpanScores <break_val, na.rm = T)))
1613
+ cat(sprintf('This many people are < break_val: %g\n',sum(clean_data_complexspan$compositeSpanScore <break_val, na.rm = T)))
1599
1614
1600
- if((sum(compositeSpanScores <break_val, na.rm = T) == 1) | (sum(compositeSpanScores >break_val, na.rm = T) == 1)){
1615
+ if((sum(clean_data_complexspan$compositeSpanScore <break_val, na.rm = T) == 1) | (sum(clean_data_complexspan$compositeSpanScore >break_val, na.rm = T) == 1)){
1601
1616
next # don't use any categorizations that create a 'group' with just 1 person
1602
1617
}
1603
1618
1604
- m3_tmp = lmer(sqrtRT ~ 1 + all_diff_cont * prev_all_diff_cont * capacity_HighP1_lowN1_temp +
1619
+ m3_tmp = lmer(sqrtRT ~ 1 + all_diff_cont * capacity_HighP1_lowN1_temp +
1620
+ prev_all_diff_cont * capacity_HighP1_lowN1_temp +
1605
1621
(1 | subjectnumber), data = clean_data_dm, REML = F);
1606
1622
all_aic_values[ind] = AIC(m3_tmp)
1607
1623
}
@@ -1612,9 +1628,9 @@ best_threshold = possible_threshold_values[which(all_aic_values == best_aic)];
1612
1628
cat(sprintf('The best fitting model uses a CompositeSpan threshold value of %g.\n', best_threshold))
1613
1629
cat(sprintf('The best AIC obtained with the CompositeSpan was %0.2f\n', best_aic))
1614
1630
1615
- plot(sort(compositeSpanScores ), xlab = 'Participants', ylab = 'Span')
1631
+ plot(sort(clean_data_complexspan$compositeSpanScore ), xlab = 'Participants', ylab = 'Span')
1616
1632
abline(h = best_threshold, col = 'blue', lwd = 4)
1617
- abline(h = median_compositespan , col = 'red', lwd = 4, lty = 'dotted') # median value
1633
+ abline(h = median(clean_data_complexspan$compositeSpanScore, na.rm = T) , col = 'red', lwd = 4, lty = 'dotted') # median value
1618
1634
legend('topleft', legend = c('Span','Best threshold','Median span'), col = c('black','blue', 'red'), lty = 1)
1619
1635
1620
1636
plot(x = possible_threshold_values, y = all_aic_values, type = 'l', col = 'green', xlab = 'Thresholds', ylab = 'AIC values (lower better)')
@@ -1623,9 +1639,9 @@ abline(v = best_threshold, col = 'blue', lwd = 4)
1623
1639
1624
1640
# The best-fitting threshold (just slightly above the median value) is 0.6571439
1625
1641
1626
- break_val = best_threshold; # as of 2/25/24 , this was 0.6571439
1642
+ break_val = best_threshold; # as of 3/19/25 , this was 0.6785724
1627
1643
1628
- capacity_HighP1_lowN1_Best = (compositeSpanScores[keep_participants] > break_val)*2 - 1;
1644
+ capacity_HighP1_lowN1_Best = (clean_data_complexspan$compositeSpanScore > break_val)*2 - 1;
1629
1645
1630
1646
clean_data_dm$capacity_HighP1_lowN1_best[clean_data_dm$complexspan > break_val] = 1;
1631
1647
clean_data_dm$capacity_HighP1_lowN1_best[clean_data_dm$complexspan < break_val] = -1;
@@ -1641,19 +1657,21 @@ m3_best_nointxn = lmer(sqrtRT ~ 1 + all_diff_cont * capacity_HighP1_lowN1_best +
1641
1657
(1 | subjectnumber), data = clean_data_dm, REML = F);
1642
1658
summary(m3_best_nointxn) # THIS OUTPERFORMS THE FULLY-INTERACTIVE VERSION
1643
1659
1644
- # Estimate Std. Error df t value Pr(>|t|)
1645
- # (Intercept) 1.202e+00 1.233e -02 8.980e +01 97.522 < 2e-16 ***
1646
- # all_diff_cont 1.164e -01 3.839e -03 1.368e+04 30.312 < 2e-16 ***
1647
- # capacity_HighP1_lowN1_best -2.213e -02 1.233e -02 8.980e +01 -1.795 0.076 .
1648
- # prev_all_diff_cont -2.713e -02 3.844e -03 1.368e+04 -7.058 1.77e-12 ***
1649
- # all_diff_cont:capacity_HighP1_lowN1_best 2.485e -02 3.839e -03 1.368e+04 6.473 9.91e -11 ***
1650
- # capacity_HighP1_lowN1_best:prev_all_diff_cont 1.579e -02 3.844e -03 1.368e+04 4.107 4.04e-05 ***
1660
+ # Estimate Std. Error df t value Pr(>|t|)
1661
+ # (Intercept) 1.202e+00 1.259e -02 8.971e +01 95.441 < 2e-16 ***
1662
+ # all_diff_cont 1.181e -01 3.914e -03 1.368e+04 30.185 < 2e-16 ***
1663
+ # capacity_HighP1_lowN1_best -2.096e -02 1.259e -02 8.971e +01 -1.665 0.099401 .
1664
+ # prev_all_diff_cont -2.643e -02 3.918e -03 1.368e+04 -6.746 1.58e-11 ***
1665
+ # all_diff_cont:capacity_HighP1_lowN1_best 2.598e -02 3.914e -03 1.368e+04 6.638 3.29e -11 ***
1666
+ # capacity_HighP1_lowN1_best:prev_all_diff_cont 1.515e -02 3.918e -03 1.368e+04 3.867 0.000111 ***
1651
1667
1668
+ # AIC: -8762.2 (BEST)
1652
1669
1653
- m3_best_continuousWMC_nointxn = lmer(sqrtRT ~ 1 + all_diff_cont * complexspan_demeaned + prev_all_diff_cont * complexspan_demeaned +
1670
+ m3_best_continuousWMC_nointxn = lmer(sqrtRT ~ 1 + all_diff_cont * complexspan_demeaned +
1671
+ prev_all_diff_cont * complexspan_demeaned +
1654
1672
(1 | subjectnumber), data = clean_data_dm, REML = F);
1655
1673
summary(m3_best_continuousWMC_nointxn) # THIS OUTPERFORMS THE FULLY-INTERACTIVE VERSION
1656
-
1674
+ # AIC: -8740.8
1657
1675
1658
1676
m3_best_HighCap_only = lmer(sqrtRT ~ 1 + all_diff_cont * prev_all_diff_cont +
1659
1677
(1 | subjectnumber), data = clean_data_dm[clean_data_dm$capacity_HighP1_lowN1_best == 1,], REML = F);
0 commit comments