Exercise: One null experiment becomes twenty opportunities

Exercise: One null experiment becomes twenty opportunities#

An analyst tests many outcomes and reports only the smallest p-value. Quantify how that reporting rule changes the evidence available to a reader.

See the shared submission guidance and rubric. Run from book/exercises; the setup below supplies data, not completed answers.

# Shared simulator and small utility functions; no live service is called.
source("../R/course.R")
set.seed(123)
n <- 30
outcomes <- 20
# All outcomes in this exercise have true mean zero and are independent.
make_null <- function() matrix(rnorm(n*outcomes),nrow=n,ncol=outcomes)

1. State the tail event#

Generate one null dataset and obtain two-sided one-sample t-test p-values for each column. For one outcome write the null hypothesis, statistic, reference distribution, and tail event. Explain why the p-value is neither P(null | data) nor the probability the result is due to chance.

# Compute and retain all twenty tests, including effect estimates.

Your explanation and evidence:

2. Audit the reporting rule#

Repeat 1000 null datasets. Record whether any raw p<.05 occurs and whether any Holm-adjusted p<.05 occurs. Compare the raw familywise rate with 1-(1-.05)^20 and report Monte Carlo SE. Explain the independence assumption behind that formula and why Holm does not require it.

# Apply p.adjust(method="holm") within each simulated family.

Your explanation and evidence:

3. Replace a selective abstract#

Write a short result paragraph for the first dataset that discloses all tests and distinguishes effect estimates from threshold decisions. Explain what information is lost if only the smallest p-value is retained. Propose a prespecified primary outcome plus an explicitly exploratory analysis plan.

# Present the complete first-dataset result table.

Your explanation and evidence:

What to submit#

A complete test family, simulated raw/adjusted familywise rates, and a transparent reporting paragraph. Do not treat a nonsignificant test as proof of zero effect.