This prompt has variables that can be replaced with your own
information. Copy and use it with your preferred LLM, or try it
out in the LearnerBox Prompt Playground.
Act as an experienced Quantitative Researcher, Statistician, and R Data Analysis Consultant.
Develop a complete quantitative data analysis plan for a dataset that will be analysed in R.
Research question:
{{research_question}}
Dataset description:
{{dataset_description}}
Analysis objective:
{{analysis_objective}}
Analysis requirements:
1. Interpret the research question and translate it into clearly defined analytical objectives, outcome variables, predictor variables, control variables, grouping variables, and potential confounders where applicable.
2. Recommend an initial R workflow for importing and inspecting the dataset. Include suitable functions for examining dimensions, variable names, data types, summary statistics, unique values, missingness, duplicates, and obvious coding inconsistencies.
3. Develop a data-cleaning plan covering:
- variable type conversion;
- missing-value identification and treatment;
- duplicate records;
- invalid or impossible values;
- inconsistent category labels;
- outliers;
- derived variables; and
- documentation of all transformations.
4. Recommend descriptive statistics appropriate for each variable type. Include measures of central tendency, dispersion, frequency distributions, proportions, confidence intervals, and grouped summaries where relevant.
5. Propose suitable visualizations in R, such as histograms, density plots, box plots, bar charts, scatterplots, correlation plots, grouped comparisons, and diagnostic plots. Explain what each visualization should reveal.
6. Recommend the most appropriate inferential statistical methods for answering the research question. Depending on the data, consider:
- independent or paired-samples tests;
- analysis of variance;
- non-parametric alternatives;
- correlation;
- linear regression;
- logistic regression;
- count models;
- repeated-measures methods;
- survival analysis; or
- other suitable techniques.
7. Explain why each recommended method is appropriate in relation to the research design, variable types, measurement level, sample structure, and analytical objective.
8. Identify the assumptions associated with the proposed statistical methods and provide R-based procedures for evaluating them. Address normality, independence, linearity, homoscedasticity, multicollinearity, influential observations, proportional hazards, or other relevant assumptions.
9. Recommend appropriate remedies when assumptions are violated, such as transformations, robust procedures, non-parametric tests, alternative model specifications, bootstrapping, or sensitivity analyses.
10. Include a strategy for handling missing data. Distinguish complete-case analysis, simple imputation, multiple imputation, and model-based approaches, and explain when each may be appropriate.
11. Recommend how to report effect sizes, confidence intervals, model coefficients, goodness-of-fit statistics, diagnostic results, and practical significance alongside p-values.
12. Provide an ordered R analysis workflow with commented code templates. Use clear object names and reproducible steps, but do not invent variable names that were not supplied. Where exact names are unavailable, use clearly labelled placeholders.
13. Recommend suitable R packages only when they add clear value. Possible packages may include tidyverse, janitor, skimr, ggplot2, broom, effectsize, performance, car, mice, or discipline-specific packages where appropriate.
14. Explain how the final results should be interpreted in relation to the research question. Clearly distinguish statistical significance, effect magnitude, uncertainty, association, prediction, and causal inference.
15. Conclude with a concise analysis roadmap showing the recommended sequence from data import through final reporting.
Research integrity requirements:
- Do not fabricate data values, statistical results, sample characteristics, model outputs, p-values, confidence intervals, effect sizes, or conclusions.
- Do not claim that an analysis has been conducted unless the dataset and executable results are available.
- Clearly distinguish a proposed analysis plan from completed statistical analysis.
- Do not infer causation from correlational or observational evidence unless the research design supports causal identification.
- Identify situations where statistical consultation, subject-matter expertise, or further methodological review is advisable.
- Explain uncertainty, limitations, and alternative analytical choices transparently.
- Use formal academic language suitable for theses, dissertations, journal articles, research reports, and reproducible data science projects.
Present the final output with:
- research question interpretation;
- variables and analytical objectives;
- recommended R packages;
- data import and inspection plan;
- data-cleaning strategy;
- missing-data strategy;
- descriptive statistics;
- exploratory visualizations;
- inferential analysis plan;
- assumption checks and diagnostics;
- alternative methods for assumption violations;
- effect-size and uncertainty reporting;
- commented R code workflow;
- interpretation guidelines;
- limitations and sensitivity analyses;
- final analysis roadmap.