Home/Blog/ChatGPT Prompts for Statistical Analysis: 12 With Checks
Blog

ChatGPT Prompts for Statistical Analysis: 12 With Checks

P
promptstudio

12 ChatGPT prompts for statistical analysis: pick the right test, check assumptions, run it with code, read the output and write an APA results paragraph.

ChatGPT Prompts for Statistical Analysis: 12 With Checks

ChatGPT prompts for statistical analysis are most useful when they make the model choose a test for your design, check its assumptions and report numbers from code it actually ran, not numbers it guessed. Give it your question, your variables, your design and the raw data. Below are 12 prompts for statistical analysis, grouped from planning to write-up, plus a worked example with a Welch t test.

The statistical analysis prompt that picks the test and writes it up returns hypotheses, a variable map, the test and its fallback, assumption checks, results with code, an APA style paragraph and the limits of the design.

Plan the analysis

1. Question to hypotheses

My research question is [question]. Write H0 and H1 in plain words and in symbols, and say whether a one or two tailed test fits and why.

2. Which test fits

Outcome [variable and type], predictor [variable and type], design [independent, paired, repeated], n per group [n]. Name the test that fits, the fallback test, and the assumptions I must check.

3. Sample size check

I expect an effect of about [effect size, with where the estimate comes from]. Show the power calculation for [test] at alpha [level] and 80 percent power, with code, and say what happens if my effect estimate is too optimistic.

Check the data

4. Assumption checks

Here is my data [values]. Write and run code for normality, equal variance and outlier checks for [test], and explain what each result means for my test choice.

5. Clean before testing

List checks to run before analysis on this dataset [columns and a few rows]: missing values, impossible values, duplicates. Do not delete anything; flag rows and ask me.

6. Descriptives table

Compute n, mean, SD, median and range for [outcome] by [group] from this data, show the code, and format the table in APA style.

Run and read the test

7. Run the test with code

Run [test] on this data [values] in Python with scipy. Report the statistic, degrees of freedom, exact p value, 95 percent confidence interval and effect size. Show the code.

8. Read my output

Here is output from [SPSS, R, Excel] [paste]. Explain each number in plain words and tell me which ones belong in the write-up.

9. Borderline result

My p value is [value] and the robustness check gives [value]. Write two honest sentences on how strong this evidence is, without the words "trend toward significance".

Write it up

10. APA results paragraph

Turn these results [numbers] into one APA 7 results paragraph with the right rounding and italics notes, and list anything missing.

11. Plain language summary

Explain this result [paragraph] to a manager who has no statistics background, in 80 words, including what it does not prove.

12. Flagship: pick the test and write it up

ResearchQuestion [question], Variables [names, types], Design [design and assignment], DataPaste [values, n per group], AlphaAndTails [alpha, tails], ReportStyle [style]. Return hypotheses, variable map, test choice, assumption checks, results with code, write-up and limits.

Worked example: retrieval quizzes against re-reading

In the flagship example, one teacher compares two intact class sections of 12 students. The quiz section averages 76.75 and the re-reading section 72.08. Welch's t test gives t(21.2) = 2.12, p = .046, a 4.67 point difference with a 95 percent confidence interval from 0.10 to 9.23, and Cohen's d of 0.87. The useful part is the limits section: the sections were not randomly assigned, so the result is a difference between classes, not proof that quizzing caused it, and the Mann-Whitney check lands at .056, so the evidence is modest. Every number comes from the scipy code printed in the output.

Variations

  • Three or more groups: ask for one-way ANOVA or Welch's ANOVA with post hoc comparisons.
  • Before and after scores: set the design to paired and ask for a paired t test or Wilcoxon signed-rank test.
  • Categories, not scores: ask for a chi-square test of independence with expected counts checked.

Tips

  • Paste raw values when you can. With only means and SDs, the model cannot check normality or outliers.
  • Ask for the code every time and rerun it yourself if the tool cannot execute it. A number with no code behind it may be made up.
  • Report exact p values, confidence intervals and an effect size, not just "significant".
  • A p value below .05 does not prove an effect or show its size; read it with the confidence interval, the effect size and the design.
  • Check the write-up against the output line by line before you submit it.
  • The class data is invented, and PromptDig is not affiliated with OpenAI or the SciPy project.

Related on PromptDig

Working from survey data? See the ChatGPT prompts for survey analysis. In a spreadsheet, try the ChatGPT prompts for Excel data analysis, and for scripts, the pandas data analysis script generator. More in the Research hub, browse all prompts, or share an analysis prompt you rely on.

Share this article