Effect size computation: shin2014timeconstraintspragmatic

Computes standardized mean differences (d) and sampling variances (v) for the reconstructed high-vs-low stakes contrasts extracted into papers/shin2014timeconstraintspragmatic/shin2014timeconstraintspragmatic.yaml.

Shared helpers

if (!requireNamespace("esc", quietly = TRUE)) {
  stop("Package 'esc' is required for this template.", call. = FALSE)
}

suppressPackageStartupMessages(library(esc))

paper_key <- "shin2014timeconstraintspragmatic"

compute_between_groups <- function(
    paper_key,
    study_id,
    effect_id,
    n_low,
    n_high,
    mean_low,
    mean_high,
    sd_low,
    sd_high,
    notes_on_assumptions = ""
) {
  res_d <- esc::esc_mean_sd(
    grp1m = mean_low,
    grp1sd = sd_low,
    grp1n = n_low,
    grp2m = mean_high,
    grp2sd = sd_high,
    grp2n = n_high,
    es.type = "d"
  )

  res_g <- esc::esc_mean_sd(
    grp1m = mean_low,
    grp1sd = sd_low,
    grp1n = n_low,
    grp2m = mean_high,
    grp2sd = sd_high,
    grp2n = n_high,
    es.type = "g"
  )

  audit <- data.frame(
    paper_key = paper_key,
    study_id = study_id,
    effect_id = effect_id,
    method_used = "between_groups",
    sign_convention = "d = mean(low) - mean(high)",
    n_low = n_low,
    n_high = n_high,
    mean_low = mean_low,
    mean_high = mean_high,
    sd_low = sd_low,
    sd_high = sd_high,
    d = as.numeric(res_d$es),
    v = as.numeric(res_d$var),
    g = as.numeric(res_g$es),
    v_g = as.numeric(res_g$var),
    notes_on_assumptions = notes_on_assumptions,
    stringsAsFactors = FALSE
  )

  yaml_snippet <- sprintf(
    "effect_size:\n  metric: SMD\n  d: %.12f\n  v: %.12f\n  computed_from: groups\n  needs_review: false\n  notes: \"%s\"\n",
    audit$d,
    audit$v,
    gsub(
      pattern = "\"",
      replacement = "'",
      x = paste0(
        "Computed from reconstructed low- vs high-stakes condition summaries in analysis/effect_sizes.qmd ",
        "(method=between_groups; sign convention d = mean(low) - mean(high))."
      )
    )
  )

  list(audit = audit, yaml_snippet = yaml_snippet)
}

Study 1 / Effect s1_e1

Experiment 1, Less-Time: low stakes vs high stakes

inputs_s1_e1 <- list(
  study_id = 1L,
  effect_id = "s1_e1",
  n_low = 38L,
  n_high = 39L,
  mean_low = 3.55,
  mean_high = 4.23,
  sd_low = 1.655,
  sd_high = 1.55,
  notes_on_assumptions = paste(
    "Low-stakes Less-Time condition comes from the Experiment 1 main-text time-contrast summary.",
    "High-stakes Less-Time condition comes from the TEI fig_1 caption recovered from the processed paper outputs.",
    "The paper does not report a direct stakes test at fixed time, so this is a reconstructed between-subjects stakes contrast."
  )
)
inputs_s1_e1
$study_id
[1] 1

$effect_id
[1] "s1_e1"

$n_low
[1] 38

$n_high
[1] 39

$mean_low
[1] 3.55

$mean_high
[1] 4.23

$sd_low
[1] 1.655

$sd_high
[1] 1.55

$notes_on_assumptions
[1] "Low-stakes Less-Time condition comes from the Experiment 1 main-text time-contrast summary. High-stakes Less-Time condition comes from the TEI fig_1 caption recovered from the processed paper outputs. The paper does not report a direct stakes test at fixed time, so this is a reconstructed between-subjects stakes contrast."
res_s1_e1 <- compute_between_groups(
  paper_key = paper_key,
  study_id = inputs_s1_e1$study_id,
  effect_id = inputs_s1_e1$effect_id,
  n_low = inputs_s1_e1$n_low,
  n_high = inputs_s1_e1$n_high,
  mean_low = inputs_s1_e1$mean_low,
  mean_high = inputs_s1_e1$mean_high,
  sd_low = inputs_s1_e1$sd_low,
  sd_high = inputs_s1_e1$sd_high,
  notes_on_assumptions = inputs_s1_e1$notes_on_assumptions
)
res_s1_e1$audit
                         paper_key study_id effect_id    method_used
1 shin2014timeconstraintspragmatic        1     s1_e1 between_groups
             sign_convention n_low n_high mean_low mean_high sd_low sd_high
1 d = mean(low) - mean(high)    38     39     3.55      4.23  1.655    1.55
           d          v          g        v_g
1 -0.4242946 0.05312581 -0.4200375 0.05312581
                                                                                                                                                                                                                                                                                                                 notes_on_assumptions
1 Low-stakes Less-Time condition comes from the Experiment 1 main-text time-contrast summary. High-stakes Less-Time condition comes from the TEI fig_1 caption recovered from the processed paper outputs. The paper does not report a direct stakes test at fixed time, so this is a reconstructed between-subjects stakes contrast.
cat(res_s1_e1$yaml_snippet)
effect_size:
  metric: SMD
  d: -0.424294616455
  v: 0.053125814605
  computed_from: groups
  needs_review: false
  notes: "Computed from reconstructed low- vs high-stakes condition summaries in analysis/effect_sizes.qmd (method=between_groups; sign convention d = mean(low) - mean(high))."

Study 2 / Effect s2_e1

Experiment 1, More-Time: low stakes vs high stakes

inputs_s2_e1 <- list(
  study_id = 2L,
  effect_id = "s2_e1",
  n_low = 43L,
  n_high = 43L,
  mean_low = 2.67,
  mean_high = 2.92,
  sd_low = 1.476,
  sd_high = 1.98,
  notes_on_assumptions = paste(
    "Low-stakes More-Time condition comes from the Experiment 1 main-text time-contrast summary.",
    "High-stakes More-Time condition comes from the TEI fig_1 caption recovered from the processed paper outputs.",
    "The paper does not report a direct stakes test at fixed time, so this is a reconstructed between-subjects stakes contrast."
  )
)
inputs_s2_e1
$study_id
[1] 2

$effect_id
[1] "s2_e1"

$n_low
[1] 43

$n_high
[1] 43

$mean_low
[1] 2.67

$mean_high
[1] 2.92

$sd_low
[1] 1.476

$sd_high
[1] 1.98

$notes_on_assumptions
[1] "Low-stakes More-Time condition comes from the Experiment 1 main-text time-contrast summary. High-stakes More-Time condition comes from the TEI fig_1 caption recovered from the processed paper outputs. The paper does not report a direct stakes test at fixed time, so this is a reconstructed between-subjects stakes contrast."
res_s2_e1 <- compute_between_groups(
  paper_key = paper_key,
  study_id = inputs_s2_e1$study_id,
  effect_id = inputs_s2_e1$effect_id,
  n_low = inputs_s2_e1$n_low,
  n_high = inputs_s2_e1$n_high,
  mean_low = inputs_s2_e1$mean_low,
  mean_high = inputs_s2_e1$mean_high,
  sd_low = inputs_s2_e1$sd_low,
  sd_high = inputs_s2_e1$sd_high,
  notes_on_assumptions = inputs_s2_e1$notes_on_assumptions
)
res_s2_e1$audit
                         paper_key study_id effect_id    method_used
1 shin2014timeconstraintspragmatic        2     s2_e1 between_groups
             sign_convention n_low n_high mean_low mean_high sd_low sd_high
1 d = mean(low) - mean(high)    43     43     2.67      2.92  1.476    1.98
           d          v          g        v_g
1 -0.1431616 0.04663079 -0.1418796 0.04663079
                                                                                                                                                                                                                                                                                                                 notes_on_assumptions
1 Low-stakes More-Time condition comes from the Experiment 1 main-text time-contrast summary. High-stakes More-Time condition comes from the TEI fig_1 caption recovered from the processed paper outputs. The paper does not report a direct stakes test at fixed time, so this is a reconstructed between-subjects stakes contrast.
cat(res_s2_e1$yaml_snippet)
effect_size:
  metric: SMD
  d: -0.143161600270
  v: 0.046630786301
  computed_from: groups
  needs_review: false
  notes: "Computed from reconstructed low- vs high-stakes condition summaries in analysis/effect_sizes.qmd (method=between_groups; sign convention d = mean(low) - mean(high))."

Study 3 / Effect s3_e1

Experiment 2, Less-Time: low stakes vs high stakes

inputs_s3_e1 <- list(
  study_id = 3L,
  effect_id = "s3_e1",
  n_low = 34L,
  n_high = 27L,
  mean_low = 1.85,
  mean_high = 3.07,
  sd_low = 0.857,
  sd_high = 2.22,
  notes_on_assumptions = paste(
    "High-stakes Less-Time condition comes from the Experiment 2 main-text time-contrast summary.",
    "Low-stakes Less-Time condition comes from footnote 32, recovered in the processed full text.",
    "The paper does not report a direct stakes test at fixed time, so this is a reconstructed between-subjects stakes contrast."
  )
)
inputs_s3_e1
$study_id
[1] 3

$effect_id
[1] "s3_e1"

$n_low
[1] 34

$n_high
[1] 27

$mean_low
[1] 1.85

$mean_high
[1] 3.07

$sd_low
[1] 0.857

$sd_high
[1] 2.22

$notes_on_assumptions
[1] "High-stakes Less-Time condition comes from the Experiment 2 main-text time-contrast summary. Low-stakes Less-Time condition comes from footnote 32, recovered in the processed full text. The paper does not report a direct stakes test at fixed time, so this is a reconstructed between-subjects stakes contrast."
res_s3_e1 <- compute_between_groups(
  paper_key = paper_key,
  study_id = inputs_s3_e1$study_id,
  effect_id = inputs_s3_e1$effect_id,
  n_low = inputs_s3_e1$n_low,
  n_high = inputs_s3_e1$n_high,
  mean_low = inputs_s3_e1$mean_low,
  mean_high = inputs_s3_e1$mean_high,
  sd_low = inputs_s3_e1$sd_low,
  sd_high = inputs_s3_e1$sd_high,
  notes_on_assumptions = inputs_s3_e1$notes_on_assumptions
)
res_s3_e1$audit
                         paper_key study_id effect_id    method_used
1 shin2014timeconstraintspragmatic        3     s3_e1 between_groups
             sign_convention n_low n_high mean_low mean_high sd_low sd_high
1 d = mean(low) - mean(high)    34     27     1.85      3.07  0.857    2.22
           d          v          g        v_g
1 -0.7591519 0.07117267 -0.7494606 0.07117267
                                                                                                                                                                                                                                                                                                  notes_on_assumptions
1 High-stakes Less-Time condition comes from the Experiment 2 main-text time-contrast summary. Low-stakes Less-Time condition comes from footnote 32, recovered in the processed full text. The paper does not report a direct stakes test at fixed time, so this is a reconstructed between-subjects stakes contrast.
cat(res_s3_e1$yaml_snippet)
effect_size:
  metric: SMD
  d: -0.759151873123
  v: 0.071172667042
  computed_from: groups
  needs_review: false
  notes: "Computed from reconstructed low- vs high-stakes condition summaries in analysis/effect_sizes.qmd (method=between_groups; sign convention d = mean(low) - mean(high))."

Study 4 / Effect s4_e1

Experiment 2, More-Time: low stakes vs high stakes

inputs_s4_e1 <- list(
  study_id = 4L,
  effect_id = "s4_e1",
  n_low = 35L,
  n_high = 31L,
  mean_low = 2.71,
  mean_high = 5.90,
  sd_low = 1.29,
  sd_high = 4.04,
  notes_on_assumptions = paste(
    "High-stakes More-Time condition comes from the Experiment 2 main-text time-contrast summary.",
    "Low-stakes More-Time condition comes from footnote 32, recovered in the processed full text.",
    "The paper does not report a direct stakes test at fixed time, so this is a reconstructed between-subjects stakes contrast."
  )
)
inputs_s4_e1
$study_id
[1] 4

$effect_id
[1] "s4_e1"

$n_low
[1] 35

$n_high
[1] 31

$mean_low
[1] 2.71

$mean_high
[1] 5.9

$sd_low
[1] 1.29

$sd_high
[1] 4.04

$notes_on_assumptions
[1] "High-stakes More-Time condition comes from the Experiment 2 main-text time-contrast summary. Low-stakes More-Time condition comes from footnote 32, recovered in the processed full text. The paper does not report a direct stakes test at fixed time, so this is a reconstructed between-subjects stakes contrast."
res_s4_e1 <- compute_between_groups(
  paper_key = paper_key,
  study_id = inputs_s4_e1$study_id,
  effect_id = inputs_s4_e1$effect_id,
  n_low = inputs_s4_e1$n_low,
  n_high = inputs_s4_e1$n_high,
  mean_low = inputs_s4_e1$mean_low,
  mean_high = inputs_s4_e1$mean_high,
  sd_low = inputs_s4_e1$sd_low,
  sd_high = inputs_s4_e1$sd_high,
  notes_on_assumptions = inputs_s4_e1$notes_on_assumptions
)
res_s4_e1$audit
                         paper_key study_id effect_id    method_used
1 shin2014timeconstraintspragmatic        4     s4_e1 between_groups
             sign_convention n_low n_high mean_low mean_high sd_low sd_high
1 d = mean(low) - mean(high)    35     31     2.71       5.9   1.29    4.04
          d          v         g        v_g
1 -1.091928 0.06986212 -1.079082 0.06986212
                                                                                                                                                                                                                                                                                                  notes_on_assumptions
1 High-stakes More-Time condition comes from the Experiment 2 main-text time-contrast summary. Low-stakes More-Time condition comes from footnote 32, recovered in the processed full text. The paper does not report a direct stakes test at fixed time, so this is a reconstructed between-subjects stakes contrast.
cat(res_s4_e1$yaml_snippet)
effect_size:
  metric: SMD
  d: -1.091927815590
  v: 0.069862116985
  computed_from: groups
  needs_review: false
  notes: "Computed from reconstructed low- vs high-stakes condition summaries in analysis/effect_sizes.qmd (method=between_groups; sign convention d = mean(low) - mean(high))."