🔬 Research

Statistical Analysis Prompt: Pick the Test and Write It Up

Paste your question, variables and data: get hypotheses, the right statistical test with assumption checks, code to run, an APA style write-up and limits.

4.0
1Reviews
P
November 15, 2026

Prompt

Act as a biostatistician who consults for graduate students and analysts: you pick the statistical test that fits the design, check its assumptions, and write results that say exactly what the data support. You never invent a number. If you can run code on the pasted data, run it and show the code; if you cannot, give the code and leave the results as placeholders.

Inputs:
- Research question in one sentence: [ResearchQuestion]
- Variables, their type (continuous, ordinal, categorical) and how they were measured: [Variables]
- Design: independent groups, paired, repeated measures, and how people got into groups: [Design]
- The data as raw values or a pasted table, with sample size per group: [DataPaste]
- Alpha level and one or two tailed: [AlphaAndTails]
- Report style (APA 7, journal, plain language for a manager): [ReportStyle]

Generate:
1. Hypotheses: H0 and H1 in plain words and in symbols.
2. Variable map: outcome, predictor, level of measurement, sample size per group.
3. Test choice: the test that fits, why, and the fallback test if an assumption fails.
4. Assumption checks: which to run (normality, equal variances, independence, outliers), the results if you ran them, and what each result means for the test choice.
5. Results: test statistic, degrees of freedom, p value, confidence interval, effect size, and the code used (Python with scipy, or R).
6. Write-up: one results paragraph in the ReportStyle, numbers rounded the way that style expects.
7. Limits: what the design does not allow you to claim, and any result that is borderline.

Rules: report exact p values rather than stars; never call a result significant without the alpha; never claim cause from a non-random design.

Instructions

Paste raw values when you can; summary numbers alone limit the assumption checks. If your chat tool can run code (ChatGPT's data analysis, for example), ask it to run the code and show it; otherwise run the code yourself and paste the output back. Variation: for three or more groups ask for one-way ANOVA or Welch's ANOVA with post hoc tests; for before and after scores from the same people, set Design to paired. Tip: check every number in the write-up against the code output before you submit. This is study help, not a replacement for your supervisor or a statistician on high-stakes work. The class sections in the example are invented.

Generated Output

This image was generated using the prompt above.

Statistical Analysis Prompt: Pick the Test and Write It Up - Result

Examples

Example Input

ResearchQuestion: Do students who took weekly retrieval quizzes score higher on the unit test than students who re-read their notes?
Variables: unit test score out of 100 (continuous); study method (retrieval quizzes or re-reading)
Design: two intact class sections taught by the same teacher; section A used weekly quizzes, section B re-read notes; students were not randomly assigned
DataPaste: A: 78, 71, 84, 69, 75, 80, 73, 88, 70, 77, 82, 74 | B: 72, 68, 79, 65, 74, 70, 76, 69, 81, 67, 73, 71 (n = 12 each)
AlphaAndTails: 0.05, two tailed
ReportStyle: APA 7

Example Output

1. HYPOTHESES
H0: mean unit test scores are equal for the two study methods (muA = muB).
H1: the means differ (muA is not equal to muB). Two tailed, alpha = .05.

2. VARIABLE MAP
Outcome: unit test score, continuous, 0 to 100. Predictor: study method, 2 independent groups. n = 12 per group.

3. TEST CHOICE
Welch's independent samples t test: two independent groups, continuous outcome, and Welch does not assume equal variances. Fallback if normality fails badly: Mann-Whitney U.

4. ASSUMPTION CHECKS (run on the pasted data)
Shapiro-Wilk: A p = .82, B p = .92, no sign of non-normality (small samples have little power to detect it).
Levene (median centered): p = .43, variances similar; Welch is still fine.
Outliers: none beyond 1.5 IQR in either group.
Independence: students in one section can talk to each other; note as a limit.

5. RESULTS
A: M = 76.75, SD = 5.89. B: M = 72.08, SD = 4.81.
Welch t(21.2) = 2.12, p = .046. Mean difference 4.67 points, 95% CI [0.10, 9.23].
Cohen's d = 0.87 (pooled SD).
Robustness: Mann-Whitney U = 105.5, p = .056.
Code:
from scipy import stats
a = [78,71,84,69,75,80,73,88,70,77,82,74]
b = [72,68,79,65,74,70,76,69,81,67,73,71]
print(stats.shapiro(a), stats.shapiro(b), stats.levene(a, b, center="median"))
t = stats.ttest_ind(a, b, equal_var=False)
print(t, t.df, t.confidence_interval(0.95))
print(stats.mannwhitneyu(a, b))

6. APA 7 WRITE-UP
Students in the retrieval quiz section (M = 76.75, SD = 5.89) scored higher on the unit test than students in the re-reading section (M = 72.08, SD = 4.81), Welch's t(21.16) = 2.12, p = .046, 95% CI [0.10, 9.23], d = 0.87.

7. LIMITS
Sections were intact classes, not randomly assigned, so the result shows a difference between sections, not that quizzing caused it. The p value sits just under .05 and the Mann-Whitney check is .056, so call the evidence modest. The confidence interval runs from almost zero to about 9 points. With 12 students per group, a replication with more sections would be worth more than a stronger claim.

Share this prompt

Reviews (0)

Please login to leave a review.
Loading reviews...