Project 2 — NHST Reproduction of [Author Year]

Author

Your Names (2–3 of you)

Published

August 18, 2026

Setup

library(tidyverse)
library(here)
library(gt)
library(gtsummary)
library(infer) # bootstrap CIs from the Part 2 workflow
library(effectsize) # Cohen's d, eta-squared, Cramer's V

── Are you inside an RStudio project? ──────────────────────────────────────

here() resolves paths from the project root, and it only knows where that is

if an .Rproj file exists. The starter zip deliberately does not include one,

because RStudio names it after whatever your team calls the folder. If you

have not created it yet, this stops with a useful message instead of failing

later with a confusing “file not found”.

if (!any(grepl(“\.Rproj$”, list.files(here::here())))) { stop(“No .Rproj found at the project root. Create one first:”, “File > New Project > Existing Directory, pointing at this folder.”, “See the Project setup and reproducibility guide.”) }

Introduction

Methods

The original study

Our reproduction

# TODO: Import the analytic dataset.
# raw <- read_rds(here("data", "your_reproduction_dataset.Rds"))

The codebook

This codebook is the crosswalk between the original paper and your reproduction. It should help a reader move from the paper’s terminology to your analytic dataset without guessing.

# TODO: Build the codebook table. Example structure:
#
# codebook <- tibble(
#   variable = c("group", "outcome_score", "wave_year"),
#   description = c("Intervention vs control",
#                   "Self-reported anxiety scale total",
#                   "Survey wave year"),
#   type = c("factor", "double", "integer"),
#   values = c("Treatment, Control",
#                   "0-40, higher = more anxiety",
#                   "2019"),
#   missing = c("none after exclusions",
#                   "any item missing -> total NA",
#                   "no missing"),
#   source = c("derived from cohort_id in original; paper calls this 'condition'",
#                   "raw (paper calls this 'STAI_total')",
#                   "raw")
# )
#
# codebook |>
#   gt() |>
#   tab_header(title = "Codebook for the analytic dataset",
#              subtitle = "Crosswalk between [Author Year] and our reproduction")

Results

# TODO: Any final wrangling needed before the test.
# analytic <- raw |>
#   filter(...) |>
#   mutate(group = factor(group, levels = c("Control", "Treatment")))

Descriptive summary

# TODO: tbl_summary() or tbl_cross() showing what the two groups look like.
# This step matters more than it may seem: it tells you whether you appear to
# have reconstructed the same sample before you put much weight on the test.

The reproduction test

# TODO: Run the test the original paper ran.
# For a two-sample t-test:
# t_result <- analytic |>
#   t_test(outcome_score ~ group)
#
# For ANOVA:
# aov_result <- analytic |>
#   aov(outcome_score ~ group, data = _)  # or use infer's anova workflow
#
# For chi-square:
# chi_result <- analytic |>
#   chisq_test(outcome_var ~ predictor_var)
#
# For paired t:
# pt_result <- analytic |>
#   t_test(outcome ~ time, paired = TRUE)
# TODO: Compute the appropriate effect size.
# Cohen's d:    effectsize::cohens_d(outcome ~ group, data = analytic)
# eta-squared:  effectsize::eta_squared(aov_result)
# Cramer's V:   effectsize::cramers_v(table(analytic$outcome, analytic$predictor))

APA-formatted result

Result:

Visualization

A chart that helps the reader see the result, not just read the number.

# TODO: A clean chart of the central comparison. For a two-group t-test, that
# might be group means with 95% CIs as intervals. For a chi-square, a tidy
# stacked-proportion chart. Apply the M03 + Project 1 design moves -- the chart
# should serve the result, not decorate it.

Discussion

The reproduction checklist

Put the original and reproduced numbers side by side. This table should make it easy for a reader to see what matched closely, what differed, and where the important gaps are.

# TODO: Build a tibble comparing the original and your reproduction, then pipe to gt().
# Example structure:
#
# checklist <- tribble(
#   ~quantity,           ~original,         ~reproduction,    ~match,
#   "Sample size (N)",   "182",             "192",           "close",
#   "Test statistic",    "t(180) = 2.55",   "t(190) = 2.41", "close",
#   "p-value",           ".012",            ".017",          "same direction",
#   "Effect size",       "d = 0.38",        "d = 0.36",      "close",
#   "95% CI",            "[0.07, 0.69]",    "[0.06, 0.66]",  "overlapping"
# )
#
# checklist |>
#   gt() |>
#   tab_header(title = "Reproduction checklist",
#              subtitle = "[Author Year] vs our reproduction")

References