Chapter 27 [fMRI] NPSses04 ~ singletrial

What is the purpose of this notebook?

  • Here, I model NPS dot products as a function of cue, stimulus intensity and expectation ratings.
  • One of the findings is that low cues lead to higher NPS dotproducts in the high intensity group, and that this effect becomes non-significant across sessions.
  • 03/23/2023: For now, I’m grabbing participants that have complete data, i.e. 18 runs, all three sessions.

Contrast weight table

Table 27.1: Contrast weights
pain vicarious cognitive
task_V_gt_C 0.00 0.50 -0.50
task_P_gt_VC 0.66 -0.34 -0.34

27.1 NPS ~ paintask: 2 cue x 3 stimulus_intensity

Q. Within pain task, Does stimulus intenisty level and cue level significantly predict NPS dotproducts?

Lineplots

27.1.1 Linear model results (NPS ~ paintask: 2 cue x 3 stimulus_intensity)

model.npscuestim <- lmer(NPSpos ~ 
                          CUE_high_gt_low*STIM_linear +CUE_high_gt_low * STIM_quadratic +
                          (CUE_high_gt_low+STIM|sub), data = data_screen
                    )
sjPlot::tab_model(model.npscuestim,
                  title = "Multilevel-modeling: \nlmer(NPSpos ~ CUE * STIM + (CUE + STIM | sub), data = pvc)",
                  CSS = list(css.table = '+font-size: 12;'))
Multilevel-modeling: lmer(NPSpos ~ CUE * STIM + (CUE + STIM | sub), data = pvc)
  NPSpos
Predictors Estimates CI p
(Intercept) 7.45 5.47 – 9.44 <0.001
CUE high gt low -0.31 -1.50 – 0.88 0.613
STIM linear 2.70 1.25 – 4.15 <0.001
STIM quadratic -0.57 -1.72 – 0.58 0.332
CUE high gt low * STIM
linear
-0.06 -2.57 – 2.46 0.965
CUE high gt low * STIM
quadratic
-0.03 -2.25 – 2.19 0.980
Random Effects
σ2 73.34
τ00 sub 58.73
τ11 sub.CUE_high_gt_low 4.52
τ11 sub.STIMlow 6.70
τ11 sub.STIMmed 4.94
ρ01 0.52
-0.58
-0.37
ICC 0.45
N sub 52
Observations 1065
Marginal R2 / Conditional R2 0.010 / 0.455

Linear model eta-squared

Parameter Eta2_partial CI CI_low CI_high
CUE_high_gt_low 0.0051488 0.95 0.0000000 1
STIM_linear 0.1909069 0.95 0.0600978 1
STIM_quadratic 0.0064804 0.95 0.0000000 1
CUE_high_gt_low:STIM_linear 0.0000022 0.95 0.0000000 1
CUE_high_gt_low:STIM_quadratic 0.0000007 0.95 0.0000000 1

Linear model Cohen’s d: NPS stimulus_intensity d = 1.16, cue d = 0.45

t df d
CUE_high_gt_low -0.5054160 49.35756 -0.1438806
STIM_linear 3.6582437 56.71817 0.9714971
STIM_quadratic -0.9696431 144.14556 -0.1615256
CUE_high_gt_low:STIM_linear -0.0444725 916.70926 -0.0029377
CUE_high_gt_low:STIM_quadratic -0.0246661 911.16896 -0.0016343

27.1.2 2 cue * 3 stimulus_intensity * expectation_rating

data_screen$EXPECT <- data_screen$event02_expect_angle
model.nps3factor <- lmer(NPSpos ~ 
                          CUE_high_gt_low*STIM_linear*EXPECT +
                           CUE_high_gt_low*STIM_quadratic*EXPECT +
                          (CUE_high_gt_low+STIM + EXPECT|sub), data = data_screen
                    )
## boundary (singular) fit: see help('isSingular')
## Warning: Model failed to converge with 1 negative eigenvalue: -3.4e+01
sjPlot::tab_model(model.nps3factor,
                  title = "Multilevel-modeling: \nlmer(NPSpos ~ CUE * STIM * EXPECTATION + (CUE + STIM + EXPECT | sub), data = pvc)",
                  CSS = list(css.table = '+font-size: 12;'))
Multilevel-modeling: lmer(NPSpos ~ CUE * STIM * EXPECTATION + (CUE + STIM + EXPECT | sub), data = pvc)
  NPSpos
Predictors Estimates CI p
(Intercept) 7.35 5.11 – 9.60 <0.001
CUE high gt low -0.89 -3.43 – 1.65 0.494
STIM linear -0.08 -3.03 – 2.87 0.957
EXPECT -0.00 -0.03 – 0.02 0.781
STIM quadratic -0.66 -3.09 – 1.77 0.595
CUE high gt low * STIM
linear
-8.90 -14.40 – -3.40 0.002
CUE high gt low * EXPECT 0.01 -0.02 – 0.05 0.501
STIM linear * EXPECT 0.03 -0.01 – 0.07 0.178
CUE high gt low * STIM
quadratic
-2.19 -6.91 – 2.54 0.364
EXPECT * STIM quadratic -0.00 -0.04 – 0.03 0.879
(CUE high gt low * STIM
linear) * EXPECT
0.13 0.05 – 0.21 0.001
(CUE high gt low
EXPECT)
STIM quadratic
0.03 -0.03 – 0.10 0.300
Random Effects
σ2 72.11
τ00 sub 36.66
τ11 sub.CUE_high_gt_low 2.10
τ11 sub.STIMlow 6.43
τ11 sub.STIMmed 5.44
τ11 sub.EXPECT 0.00
ρ01 0.28
-0.61
-0.29
0.88
N sub 52
Observations 1048
Marginal R2 / Conditional R2 0.032 / NA

eta squared

## Warning: Model failed to converge with 1 negative eigenvalue: -3.4e+01
Parameter Eta2_partial CI CI_low CI_high
CUE_high_gt_low 0.0042515 0.95 0.0000000 1
STIM_linear 0.0000241 0.95 0.0000000 1
EXPECT 0.0008306 0.95 0.0000000 1
STIM_quadratic 0.0012481 0.95 0.0000000 1
CUE_high_gt_low:STIM_linear 0.0115479 0.95 0.0026863 1
CUE_high_gt_low:EXPECT 0.0041285 0.95 0.0000000 1
STIM_linear:EXPECT 0.0127555 0.95 0.0000000 1
CUE_high_gt_low:STIM_quadratic 0.0008924 0.95 0.0000000 1
EXPECT:STIM_quadratic 0.0000898 0.95 0.0000000 1
CUE_high_gt_low:STIM_linear:EXPECT 0.0116769 0.95 0.0028550 1
CUE_high_gt_low:EXPECT:STIM_quadratic 0.0011455 0.95 0.0000000 1

Cohen’s d

## boundary (singular) fit: see help('isSingular')
## Warning: Model failed to converge with 1 negative eigenvalue: -3.4e+01
t df d
CUE_high_gt_low -0.6841367 109.62025 -0.1306855
STIM_linear -0.0535606 118.79228 -0.0098284
EXPECT -0.2785735 93.34973 -0.0576651
STIM_quadratic -0.5310507 225.67653 -0.0707005
CUE_high_gt_low:STIM_linear -3.1751545 862.94066 -0.2161745
CUE_high_gt_low:EXPECT 0.6737079 109.48503 0.1287728
STIM_linear:EXPECT 1.3480570 140.65082 0.2273354
CUE_high_gt_low:STIM_quadratic -0.9083575 923.79518 -0.0597722
EXPECT:STIM_quadratic -0.1519717 257.26620 -0.0189497
CUE_high_gt_low:STIM_linear:EXPECT 3.2510315 894.57159 0.2173920
CUE_high_gt_low:EXPECT:STIM_quadratic 1.0361864 936.23069 0.0677293

27.2 NPS_ses01 ~ SES * CUE * STIM

Q. Is the cue effect on NPS different across sessions?

Quick answer: Yes, the cue effect in session 1 (for high intensity group) is significantly different; whereas this different becomes non significant in session 4. To unpack, a participant was informed to experience a low stimulus intensity, when in fact they were delivered a high intensity stimulus. This violation presumably leads to a higher NPS response, given that they were delivered a much painful stimulus than expected. The fact that the cue effect is almost non significant during the last session indicates that the cue effects are not just an anchoring effect.

27.2.0.1 Session wise plots

27.2.1 Here are the stats models: NPS~session * cue * stimulus_intensity

  1. Calculate difference score
  • average high and low cue within run.
  • calculate difference between high and low cue per run
  • each participant has 6 contrast scores
  • run this as a function of stimulus intensity and sessions

27.3 OUTCOME ~ NPS

Q. Do higher NPS values indicate higher outcome ratings? (Pain task only)

Yes, Higher NPS values are associated with higher outcome ratings. The linear relationship between NPS value and outcome ratings are stronger for conditions where cue level is congruent with stimulus intensity levels. In other words, NPS-outcome rating relationship is stringent in the low cue-low intensity group, as is the case for high cue-ghigh intensity group.

27.3.1 outcome_rating * cue

27.3.2 outcome_ratings * stimulus_intensity * cue

27.3.3 demeaned outcome rating * cue

## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 66 rows containing non-finite values (`stat_smooth()`).
## `geom_smooth()` using formula = 'y ~ x'
## Warning: Removed 66 rows containing non-finite values (`stat_smooth()`).
## Warning: Removed 66 rows containing missing values (`geom_point()`).

27.3.4 demeaned_outcome_ratings * stimulus_intensity * cue

27.3.5 Is this statistically significant?

# organize variable names
# NPS_demean vs. NPSpos
model.npsoutcome <- lmer(OUTCOME_demean ~ CUE_high_gt_low*STIM_linear*NPSpos + CUE_high_gt_low*STIM_quadratic*NPSpos + (CUE_high_gt_low*STIM*NPSpos|sub), data = demean_dropna)
## Warning: Model failed to converge with 2 negative eigenvalues: -1.9e-01 -8.4e+00
sjPlot::tab_model(model.npsoutcome,
                  title = "Multilevel-modeling: \nlmer(OUTCOME_demean ~ CUE * STIM * NPSpos + (CUE * STIM *NPSpos | sub), data = pvc)",
                  CSS = list(css.table = '+font-size: 12;'))
Multilevel-modeling: lmer(OUTCOME_demean ~ CUE * STIM * NPSpos + (CUE * STIM *NPSpos | sub), data = pvc)
  OUTCOME_demean
Predictors Estimates CI p
(Intercept) -0.94 -2.07 – 0.20 0.106
CUE high gt low 6.85 4.13 – 9.56 <0.001
STIM linear 33.25 28.03 – 38.48 <0.001
NPSpos 0.10 0.01 – 0.19 0.030
STIM quadratic 0.83 -2.15 – 3.80 0.586
CUE high gt low * STIM
linear
0.69 -5.29 – 6.68 0.820
CUE high gt low * NPSpos -0.07 -0.29 – 0.14 0.510
STIM linear * NPSpos -0.03 -0.32 – 0.26 0.854
CUE high gt low * STIM
quadratic
-3.38 -8.38 – 1.62 0.185
NPSpos * STIM quadratic -0.01 -0.22 – 0.21 0.949
(CUE high gt low * STIM
linear) * NPSpos
-0.05 -0.54 – 0.44 0.830
(CUE high gt low
NPSpos)
STIM quadratic
0.10 -0.30 – 0.50 0.625
Random Effects
σ2 225.77
τ00 sub 71.35
τ11 sub.CUE_high_gt_low 22.32
τ11 sub.STIMlow 245.73
τ11 sub.STIMmed 126.99
τ11 sub.NPSpos 0.07
τ11 sub.CUE_high_gt_low:STIMlow 53.41
τ11 sub.CUE_high_gt_low:STIMmed 1.46
τ11 sub.CUE_high_gt_low:NPSpos 0.12
τ11 sub.STIMlow:NPSpos 0.18
τ11 sub.STIMmed:NPSpos 0.15
τ11 sub.CUE_high_gt_low:STIMlow:NPSpos 0.45
τ11 sub.CUE_high_gt_low:STIMmed:NPSpos 0.22
ρ01 0.28
-0.97
-0.96
-0.33
-0.61
0.60
-0.19
0.18
0.65
-0.07
-0.77
N sub 52
Observations 1065
Marginal R2 / Conditional R2 0.467 / NA

27.4 NPS ~ expectation_rating

Q. What is the relationship betweeen expectation ratings & NPS? (Pain task only)

Do we see a linear effect between expectation rating and NPS dot products? Also, does this effect differ as a function of cue and stimulus intensity ratings, as is the case for behavioral ratings?

Quick answer: Yes, expectation ratings predict NPS dotproducts; Also, there tends to be a different relationship depending on cues, just by looking at the figures, although this needs to be tested statistically.

27.4.1 NPS ~ expect * cue

27.4.2 NPS ~ expect * cue * stim

27.4.3 NPS ~ demeaned_expect * cue

27.4.4 NPS ~ demeaned_expect * cue * stim

27.4.5 NPS_demean ~ demeaned_expect * cue

27.4.6 NPS ~ demeaned_expect * cue * stim

27.4.7 Is this statistically significant?

model.npsexpectdemean <- lmer(NPSpos ~ 
                          CUE_high_gt_low*STIM_linear*EXPECT_demean + 
                          CUE_high_gt_low*STIM_quadratic*EXPECT_demean + 
                          (CUE_high_gt_low+STIM+EXPECT_demean|sub), data = demean_dropna
                    )
sjPlot::tab_model(model.npsexpectdemean,
                  title = "Multilevel-modeling: \nlmer(NPSpos ~ CUE * STIM * EXPECT_demean + (CUE + STIM + EXPECT_demean| sub), data = pvc)",
                  CSS = list(css.table = '+font-size: 12;'))
Multilevel-modeling: lmer(NPSpos ~ CUE * STIM * EXPECT_demean + (CUE + STIM + EXPECT_demean| sub), data = pvc)
  NPSpos
Predictors Estimates CI p
(Intercept) 7.37 5.30 – 9.44 <0.001
CUE high gt low 0.20 -1.26 – 1.67 0.783
STIM linear 1.67 -0.18 – 3.52 0.077
EXPECT demean -0.02 -0.05 – 0.01 0.200
STIM quadratic -1.00 -2.48 – 0.48 0.187
CUE high gt low * STIM
linear
-1.06 -4.40 – 2.29 0.535
CUE high gt low * EXPECT
demean
0.01 -0.06 – 0.07 0.788
STIM linear * EXPECT
demean
0.02 -0.04 – 0.09 0.461
CUE high gt low * STIM
quadratic
0.83 -2.05 – 3.70 0.573
EXPECT demean * STIM
quadratic
-0.04 -0.10 – 0.02 0.238
(CUE high gt low * STIM
linear) * EXPECT demean
0.12 -0.02 – 0.26 0.088
(CUE high gt low * EXPECT
demean) * STIM quadratic
0.06 -0.06 – 0.19 0.321
Random Effects
σ2 72.24
τ00 sub 58.53
τ11 sub.CUE_high_gt_low 3.37
τ11 sub.STIMlow 6.67
τ11 sub.STIMmed 5.06
τ11 sub.EXPECT_demean 0.00
ρ01 0.39
-0.62
-0.25
0.62
N sub 52
Observations 1048
Marginal R2 / Conditional R2 0.025 / NA
demean_dropna$EXPECT <- demean_dropna$event02_expect_angle
model.npsexpect <- lmer(NPSpos ~ 
                          CUE_high_gt_low*STIM_linear*EXPECT + 
                          CUE_high_gt_low*STIM_quadratic*EXPECT + 
                          (CUE_high_gt_low+STIM+EXPECT|sub), data = demean_dropna
                    )
## Warning: Model failed to converge with 1 negative eigenvalue: -3.4e+01
sjPlot::tab_model(model.npsexpect,
                  title = "Multilevel-modeling: \nlmer(NPSpos ~ CUE * STIM * EXPECT + (CUE + STIM + EXPECT| sub), data = pvc)",
                  CSS = list(css.table = '+font-size: 12;'))
Multilevel-modeling: lmer(NPSpos ~ CUE * STIM * EXPECT + (CUE + STIM + EXPECT| sub), data = pvc)
  NPSpos
Predictors Estimates CI p
(Intercept) 7.35 5.11 – 9.60 <0.001
CUE high gt low -0.89 -3.43 – 1.65 0.494
STIM linear -0.08 -3.03 – 2.87 0.957
EXPECT -0.00 -0.03 – 0.02 0.781
STIM quadratic -0.66 -3.09 – 1.77 0.595
CUE high gt low * STIM
linear
-8.90 -14.40 – -3.40 0.002
CUE high gt low * EXPECT 0.01 -0.02 – 0.05 0.501
STIM linear * EXPECT 0.03 -0.01 – 0.07 0.178
CUE high gt low * STIM
quadratic
-2.19 -6.91 – 2.54 0.364
EXPECT * STIM quadratic -0.00 -0.04 – 0.03 0.879
(CUE high gt low * STIM
linear) * EXPECT
0.13 0.05 – 0.21 0.001
(CUE high gt low
EXPECT)
STIM quadratic
0.03 -0.03 – 0.10 0.300
Random Effects
σ2 72.11
τ00 sub 36.66
τ11 sub.CUE_high_gt_low 2.10
τ11 sub.STIMlow 6.43
τ11 sub.STIMmed 5.44
τ11 sub.EXPECT 0.00
ρ01 0.28
-0.61
-0.29
0.88
N sub 52
Observations 1048
Marginal R2 / Conditional R2 0.032 / NA
demean_dropna$EXPECT <- demean_dropna$event02_expect_angle
model.npsd_expectd <- lmer(NPS_demean ~ 
                          CUE_high_gt_low*STIM_linear*EXPECT_demean + 
                          CUE_high_gt_low*STIM_quadratic*EXPECT_demean + 
                          (CUE_high_gt_low+STIM+EXPECT_demean|sub), data = demean_dropna
                    )
sjPlot::tab_model(model.npsd_expectd,
                  title = "Multilevel-modeling: \nlmer(NPS_demean ~ CUE * STIM * EXPECT_demean + (CUE + STIM + EXPECT_demean| sub), data = pvc)",
                  CSS = list(css.table = '+font-size: 12;'))
Multilevel-modeling: lmer(NPS_demean ~ CUE * STIM * EXPECT_demean + (CUE + STIM + EXPECT_demean| sub), data = pvc)
  NPS_demean
Predictors Estimates CI p
(Intercept) -0.08 -0.74 – 0.57 0.810
CUE high gt low 0.23 -1.21 – 1.67 0.754
STIM linear 1.78 -0.06 – 3.63 0.058
EXPECT demean -0.02 -0.05 – 0.01 0.180
STIM quadratic -0.90 -2.33 – 0.53 0.216
CUE high gt low * STIM
linear
-0.96 -4.20 – 2.28 0.561
CUE high gt low * EXPECT
demean
0.01 -0.04 – 0.06 0.709
STIM linear * EXPECT
demean
0.02 -0.04 – 0.09 0.481
CUE high gt low * STIM
quadratic
0.74 -2.04 – 3.51 0.602
EXPECT demean * STIM
quadratic
-0.04 -0.09 – 0.02 0.229
(CUE high gt low * STIM
linear) * EXPECT demean
0.11 -0.02 – 0.24 0.109
(CUE high gt low * EXPECT
demean) * STIM quadratic
0.05 -0.07 – 0.17 0.405
Random Effects
σ2 68.35
τ00 sub 3.09
τ11 sub.CUE_high_gt_low 3.81
τ11 sub.STIMlow 8.21
τ11 sub.STIMmed 6.20
τ11 sub.EXPECT_demean 0.00
ρ01 0.60
-0.99
-0.99
-0.46
N sub 52
Observations 1048
Marginal R2 / Conditional R2 0.026 / NA