• Analysis logbook: cue-expectancy
  • 1 url: your book url like https://bookdown.org/yihui/bookdown
    • 1.1 Usage
    • 1.2 Render book
    • 1.3 Preview book
  • 2 [ beh] expectation ~ cue
    • 2.1 Pain
    • 2.2 Vicarious
    • 2.3 Cognitive
    • 2.4 Individual difference analysis
  • 3 [ beh ] outcome ~ cue
    • 3.1 Pain
    • 3.2 Vicarious
    • 3.3 Cognitive
    • 3.4 Individual differences analysis: random cue effects
    • 3.5 Individual differences analysis 2: random intercept + random slopes of cue effect
  • 4 [ beh ] outcome ~ stimulus_intensity
    • 4.1 Pain
    • 4.2 Vicarious
    • 4.3 Cognitive
    • 4.4 for loop
    • 4.5 Lineplot
    • 4.6 individual differences in outcome rating cue effect
  • 5 outcome_rating ~ cue * stim
    • 5.1 What is the purpose of this notebook?
    • 5.2 model 03 iv-cuecontrast dv-actual
      • 5.2.1 model 03 3-2. individual difference
      • 5.2.2 model 04 iv-cue-stim dv-actual
      • 5.2.3 model 04 4-2 individual differences in cue effects
      • 5.2.4 model 04 4-3 scatter plot
      • 5.2.5 model 04 4-4 lineplot
  • 6 expect-actual ~ cue * trial
    • 6.1 Overview
    • 6.2 plot 1 - one run, average across participants
    • 6.3 plot 2 - average across participant, but spread all 6 runs in one x axis
    • 6.4 Do current expectation ratings predict outcome ratings?
    • 6.5 Additional analysis
  • 7 RT ~ cue
    • 7.0.1 parameters
    • 7.0.2 1) plot RT data
    • 7.0.3 plot RT distribution per participant
    • 7.0.4 exclude participants with RT of 5 seconds
    • 7.1 model 1:
    • 7.2 model 1-1
    • 7.3 model 1-2:
    • 7.4 model 2:
  • 8 RT ~ cue * stim
    • 8.1 Overview model 05 iv-cue dv-RT summary
    • 8.2 Prepare data and preprocess
    • 8.3 model 1:
    • 8.4 model 1-1
    • 8.5 model 1-2:
    • 8.6 model 2: Log transformation
    • 8.7 Conclusion across model 1 and 2
  • 9 cognitive RT tradeoff ~ cue * stim (withinsubject)
    • 9.1 Overview
    • 9.2 Why use multilevel models?
    • 9.3 Terminology
    • 9.4 Model versions
    • 9.5 Method 1 one-sample t
    • 9.6 Method 1-1 aov
    • 9.7 Method 1-2 aov contrast-coding
    • 9.8 Method 1 effectsize
    • 9.9 Method 2 matlab
    • 9.10 Method 3 multilevel modeling
    • Conclusion: Method 1 vs Method 3
    • 9.11 References
    • 9.12 Other links
  • 10 outcome_rating ~ session (“behavioral ICC”)
    • 10.1 Functions
    • 10.2 TODO:
  • 11 [beh] N-1 outcome rating ~ N expectation rating
    • 11.1 expectation_rating ~ N-1_outcome_rating
    • 11.2 Current expectation_rating ~ N-1_outcomerating * cue
    • 11.3 Let’s demean the ratings.
    • 11.4 DEMEAN AND THEN DISCRETIZE
  • 12 (N-2) shifted outcome ratings ~ (N) expectation ratings; Jayazeri (2018)
    • 12.1 Do previous outcome ratings predict current expectation ratings?
    • 12.2 Do these models differ as a function of cue?
    • 12.3 Demean and discretize
  • 13 outcome ~ expect Jayazeri (2018)
    • 13.1 Overview
    • 13.2 Do expectation ratings predict current outcome ratings? Does this differ as a function of cue?
    • 13.3 task-pain, HLM modeling
    • 13.4 Fig. Expectation ratings predict outcome ratings
    • 13.5 binned expectation ratings per task
      • 13.5.1 Pain: binned expectation ratings
      • 13.5.2 Vicarious: binned expectation ratings
      • 13.5.3 Cognitive: binned expectation ratings
    • 13.6 not splitting into cue groups
  • 14 [ beh ] outcome ~ cue * stim * expectrating * n-1outcomerating
    • 14.1 Original motivation:
    • 14.2 Pain
      • 14.2.1 pain plot parameters
      • 14.2.2 loess
    • 14.3 Vicarious
    • 14.4 Cognitive
      • 14.4.1 cognitive parameters
  • 15 [ beh ] outcome_demean ~ cue * stim * expectrating * n-1outcomerating
    • 15.1 linear model
    • 15.2 Q. Are those overestimating for high cues also underestimators for low cues?
    • 15.3 pain run, collapsed across stimulus intensity
    • 15.4 vicarious
    • 15.5 cognitive
    • 15.6 across tasks (PVC), is the slope for (highvslow cue) the same?Tor question
  • 16 [ beh ] outcome_demean_per_run ~ cue * stim * expectrating * n-1outcomerating
    • 16.1 Linear model with three factors: cue X stim X expectation rating
    • 16.2 Pain run, collapsed across stimulus intensity
    • 16.3 vicarious
    • 16.4 cognitive
    • 16.5 across tasks (PVC), is the slope for (highvslow cue) the same?Tor question
  • 17 [beh] Mediation outcome ~ cue * stim * expectrating * n-1outcomerating
    • 17.1 mediation
    • 17.2 mediation 2
    • 17.3 mediation 3: Test same model using mediation() from MBESS
    • 17.4 mediation 4: Test library mediation
  • 18 NPS_contrast_notscaled ~ cue * stim
    • 18.1 Overview
    • 18.2 regressors and contrasts
    • 18.3 main effect: stim-linear high > low
    • 18.4 main_effect: stim-quadratic med > high&low
    • 18.5 interaction: cue X stim-linear
    • 18.6 interaction: cue X stim-quadratic
  • 19 [fMRI] NPS_contrast ~ cue * stim
    • 19.1 Overview
    • 19.2 regressors and contrasts
    • 19.3 main effect: stim-linear high > low
    • 19.4 main_effect: stim-quadratic med > high&low
    • 19.5 interaction: cue X stim-linear
    • 19.6 interaction: cue X stim-quadratic
  • 20 [fMRI] nps_contrast ~ cue * stim (“error, contrast not scaled”)
    • 20.1 Overview
    • 20.2 contrast plot
  • 21 [fMRI] nps_contrast ~ cue * stim
    • 21.1 Overview
    • 21.2 ‘P_simple_stimlin_high_gt_low’, ‘V_simple_stimlin_high_gt_low’, ‘C_simple_stimlin_high_gt_low’,…
    • 21.3 ‘P_simple_stimquad_med_gt_other’, ‘V_simple_stimquad_med_gt_other’, ‘C_simple_stimquad_med_gt_other’,…
    • 21.4 For loop for all the pvc dummy codes
  • 22 nps_dummy ~ stim
    • 22.1 TODO
    • 22.2 regressors and contrasts
    • 22.3 Functions
    • 22.4 Pain
    • 22.5 Vicarious
    • 22.6 Cognitive
  • 23 [fMRI] biomarker NPS ~ cue * stim (2022)
    • 23.1 load libraries
      • 23.1.1 NPS cue effect
    • 23.2 NPS stim effect
    • 23.3 VPS
    • 23.4 VPS cue effect
    • 23.5 VPS stim effect
  • 24 [fMRI] NPSdummy ~ stim * task (contrast-notscaled-error)
  • 25 NPSdummy ~ stim * task (contrast-scaled)
    • 25.1 Raincloud plots
    • 25.2 Line plots
  • 26 [fMRI] NPS ~ singletrial
    • 26.1 NPS ~ paintask: 2 cue x 3 stimulus_intensity
      • 26.1.1 Linear model results (NPS ~ paintask: 2 cue x 3 stimulus_intensity)
      • 26.1.2 2 cue * 3 stimulus_intensity * expectation_rating
    • 26.2 NPS_ses01 ~ SES * CUE * STIM
      • 26.2.1 Here are the stats models: NPS~session * cue * stimulus_intensity
    • 26.3
    • 26.4 OUTCOME ~ NPS
      • 26.4.1 outcome_rating * cue
      • 26.4.2 outcome_ratings * stimulus_intensity * cue
      • 26.4.3 demeaned outcome rating * cue
      • 26.4.4 demeaned_outcome_ratings * stimulus_intensity * cue
      • 26.4.5 Is this statistically significant?
    • 26.5 NPS ~ expectation_rating
      • 26.5.1 NPS ~ expect * cue
      • 26.5.2 NPS ~ expect * cue * stim
      • 26.5.3 NPS ~ demeaned_expect * cue
      • 26.5.4 NPS ~ demeaned_expect * cue * stim
      • 26.5.5 ACCURATE Is this statistically significant?
  • 27 https://stats.stackexchange.com/questions/586748/calculating-trends-with-emtrends-for-three-way-interaction-model-results-in-sa
  • 28 emtrends(model.npsexpectdemean, var = ‘EXPECT_demean’, lmer.df = “asymptotic”)
  • 29 [fMRI] NPSses01ses03 ~ singletrial
    • 29.1 NPS ~ paintask: 2 cue x 3 stimulus_intensity
      • 29.1.1 Linear model results (NPS ~ paintask: 2 cue x 3 stimulus_intensity)
      • 29.1.2 2 cue * 3 stimulus_intensity * expectation_rating
    • 29.2 NPS_ses01 ~ SES * CUE * STIM
      • 29.2.1 Here are the stats models: NPS~session * cue * stimulus_intensity
    • 29.3 OUTCOME ~ NPS
      • 29.3.1 outcome_rating * cue
      • 29.3.2 outcome_ratings * stimulus_intensity * cue
      • 29.3.3 demeaned outcome rating * cue
      • 29.3.4 demeaned_outcome_ratings * stimulus_intensity * cue
      • 29.3.5 Is this statistically significant?
    • 29.4 NPS ~ expectation_rating
      • 29.4.1 NPS ~ expect * cue
      • 29.4.2 NPS ~ expect * cue * stim
      • 29.4.3 NPS ~ demeaned_expect * cue
      • 29.4.4 NPS ~ demeaned_expect * cue * stim
      • 29.4.5 ACCURATE Is this statistically significant?
  • 30 [fMRI] NPSses01ses03 ~ singletrial
    • 30.1 NPS ~ paintask: 2 cue x 3 stimulus_intensity
      • 30.1.1 Linear model results (NPS ~ paintask: 2 cue x 3 stimulus_intensity)
      • 30.1.2 2 cue * 3 stimulus_intensity * expectation_rating
    • 30.2 NPS_ses01 ~ SES * CUE * STIM
      • 30.2.1 Here are the stats models: NPS~session * cue * stimulus_intensity
    • 30.3 OUTCOME ~ NPS
      • 30.3.1 outcome_rating * cue
      • 30.3.2 outcome_ratings * stimulus_intensity * cue
      • 30.3.3 demeaned outcome rating * cue
      • 30.3.4 demeaned_outcome_ratings * stimulus_intensity * cue
      • 30.3.5 Is this statistically significant?
    • 30.4 NPS ~ expectation_rating
      • 30.4.1 NPS ~ expect * cue
      • 30.4.2 NPS ~ expect * cue * stim
      • 30.4.3 NPS ~ demeaned_expect * cue
      • 30.4.4 NPS ~ demeaned_expect * cue * stim
      • 30.4.5 NPS_demean ~ demeaned_expect * cue
      • 30.4.6 NPS ~ demeaned_expect * cue * stim
      • 30.4.7 ACCURATE Is this statistically significant?
  • 31 [fMRI] NPSses04 ~ singletrial
    • 31.1 NPS ~ paintask: 2 cue x 3 stimulus_intensity
      • 31.1.1 Linear model results (NPS ~ paintask: 2 cue x 3 stimulus_intensity)
      • 31.1.2 2 cue * 3 stimulus_intensity * expectation_rating
    • 31.2 NPS_ses01 ~ SES * CUE * STIM
      • 31.2.1 Here are the stats models: NPS~session * cue * stimulus_intensity
    • 31.3 OUTCOME ~ NPS
      • 31.3.1 outcome_rating * cue
      • 31.3.2 outcome_ratings * stimulus_intensity * cue
      • 31.3.3 demeaned outcome rating * cue
      • 31.3.4 demeaned_outcome_ratings * stimulus_intensity * cue
      • 31.3.5 Is this statistically significant?
    • 31.4 NPS ~ expectation_rating
      • 31.4.1 NPS ~ expect * cue
      • 31.4.2 NPS ~ expect * cue * stim
      • 31.4.3 NPS ~ demeaned_expect * cue
      • 31.4.4 NPS ~ demeaned_expect * cue * stim
      • 31.4.5 NPS_demean ~ demeaned_expect * cue
      • 31.4.6 NPS ~ demeaned_expect * cue * stim
      • 31.4.7 Is this statistically significant?
  • 32 [fMRI] NPS ~ singletrial
    • 32.1 NPS ~ 3 task * 3 stimulus_intensity
    • 32.2 NPS ~ paintask: 2 cue x 3 stimulus_intensity
      • 32.2.1 Linear model results (NPS ~ paintask: 2 cue x 3 stimulus_intensity)
      • 32.2.2 2 cue * 3 stimulus_intensity * expectation_rating
    • 32.3 NPS ~ SES * CUE * STIM
      • 32.3.1 Here are the stats models: NPS~session * cue * stimulus_intensity
    • 32.4 OUTCOME ~ NPS
      • 32.4.1 outcome_rating * cue
      • 32.4.2 outcome_ratings * stimulus_intensity * cue
      • 32.4.3 demeaned outcome rating * cue
      • 32.4.4 demeaned_outcome_ratings * stimulus_intensity * cue
      • 32.4.5 Is this statistically significant?
    • 32.5 NPS ~ expectation_rating
      • 32.5.1 demeaned expect rating * cue
      • 32.5.2 Is this statistically significant?
  • 33 fMRI Pain signature ~ single trial
    • 33.1 PVC all task comparison
    • 33.2 Vicarious only Stim x cue interaction
      • 33.2.1 2x3 stimulus intensity * cue
      • 33.2.2 Linear model
      • 33.2.3 VPS stimulus intensity Cohen’s d = 0.2131521
      • 33.2.4 VPS stimulus & cue effect size: stim_d = 0.217, cue_d = 0.013
      • 33.2.5 Lineplots
      • 33.2.6 Linear model with Stim x Cue x Expectation rating
    • 33.3 Vicarious only: Outcome ratings & VPS
      • 33.3.1 outcome ratings * cue
      • 33.3.2 outcome ratings * stim * cue
    • 33.4 Vicarious only: Expectation ratings & VPS
  • 34 Cognitive signature ~ single trial
    • 34.1 PVC all task comparison
    • 34.2 Cognitive only Stim x cue interaction
      • 34.2.1 2x3 stimulus intensity * cue
      • 34.2.2 Linear model
      • 34.2.3 Cog stimulus intensity Cohen’s d = 0.72
      • 34.2.4 Cognitive stimulus & cue effect size: stim_d = 0.73, cue_d = 0.069
      • 34.2.5 Lineplots
      • 34.2.6 Linear model with Stim x Cue x Expectation rating
      • 34.2.7 Session 1: 2x3 stimulus intensity * cue
      • 34.2.8 Session 3: 2x3 stimulus intensity * cue
      • 34.2.9 Session 4: 2x3 stimulus intensity * cue
    • 34.3 Cognitive only: Outcome ratings & Kragel 2018
      • 34.3.1 outcome ratings * cue
      • 34.3.2 outcome ratings * stim * cue
    • 34.4 Cognitive only: Expectation ratings & NPS
  • 35 single trial correlation between cue and stim ~ cue x stim
    • 35.1 Stack data
    • 35.2 plot correlation (one-sample-t)
    • 35.3 Lineplot
  • 36 signature effect size ~ single trial
    • 36.1 effeect size
    • 36.2 contrastt (stim intensity)
    • 36.3 layer in metadata
  • 37 vif
  • Published with bookdown

A Minimal Book Example

Chapter 27 https://stats.stackexchange.com/questions/586748/calculating-trends-with-emtrends-for-three-way-interaction-model-results-in-sa