Code
# Core tidyverse
library(tidyverse) # includes ggplot2, dplyr, tidyr, readr, purrr, tibble, stringr, forcats
# Tables & reporting
library(knitr)
library(kableExtra)
# Stats helpers
library(broom)
## These need to be installed on your PC.
Suggested Report Structure — This template follows the requested sections. Each section contains guidance text and an empty R code cell for your analysis. Download it from hereand work on it with your own Rstudio.
Load commonly used libraries for statistical analysis and data manipulation.
# Core tidyverse
library(tidyverse) # includes ggplot2, dplyr, tidyr, readr, purrr, tibble, stringr, forcats
# Tables & reporting
library(knitr)
library(kableExtra)
# Stats helpers
library(broom)
## These need to be installed on your PC.
Once all the chunks execute correctly (no errors when running all the code, Ctrl +Alt + R
) you can render the qmd
file. Follow the instructions here to render the document to a PDF. Remove this message and any irrelevant text from the final submission.
Aim. State clearly what you want to investigate (e.g., association between X and Y).
Relevance. Explain why the topic matters (theory, policy, practice).
Gap & Research Question (RQ). Identify what is missing in the current knowledge and pose 1 RQ (avoid yes/no questions; ask how, to what extent, which factors).
Structure. Briefly preview how the rest of the article is organized.
What we know. Summarise key findings from prior studies relevant to your RQ.
Predictor rationale. Justify the inclusion of variables (theory-driven, prior empirical evidence).
Remaining gap. Specify precisely the gap this report addresses (e.g., population, geography, time period, variable, method).
Note: The goal is a clean, sensible analysis grounded in existing ideas—not necessarily novel theory.
Data. Briefly describe the dataset (who collected it, when, sample size, key variables).
Transformations. Describe any recoding/aggregation (e.g., bin income into bands; reduce age groups from 11 to 3). Provide justification.
Techniques. Outline and justify the statistical methods used (e.g., GLM/LM, logistic regression, mixed models, matching).
Important: do not include statistics here, or graphs, or tables.
# summary variables, distribution, plots, etc
Present the variables Start with descriptive statistics for your variables and distribution. If relevant, include discuss one-to-one associations (briefly, e.g. correlation plots). You can provide correlation plots and/or boxplots but do not overload the report with graphs.***
# run the model, show tables summarising the Regression model.
Results + interpretation. Present estimates and interpret them in plain language, tying back to the RQ. The Regression model should the core of this section!! Link to literature. Compare/contrast with prior findings. Selective visuals. Use clear charts/tables to highlight key results only (avoid clutter). ————————————————————————
Summary. Recap the main findings vis‑à‑vis the RQs (do not introduce new results).
Limitations. Offer a brief, honest self‑critique (data, measurement, design, external validity).
Implications. Indicate what the findings suggest for practice, policy, or future research.