Assessment Template

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 here, then upload it to the myLabs folder in RStudio (see Setup, section 5) and work on it there.

Start your .qmd file with this YAML header:

---
title: "ENVS225 Assignment"
author: "Anonymous"
date: "2026-10-05"
format:
  html:
    self-contained: true
    toc: true
    toc-depth: 2
    code-fold: show
execute:
  warning: false
  message: false
---

Setup

Load commonly used libraries for statistical analysis and data manipulation.

# Core tidyverse
library(tidyverse)    # includes ggplot2, dplyr, tidyr, readr, purrr, tibble, stringr, forcats
Warning: package 'ggplot2' was built under R version 4.4.3
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   4.0.0     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.1
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
# Tables & reporting
library(kableExtra)
Warning: package 'kableExtra' was built under R version 4.4.2

Attaching package: 'kableExtra'

The following object is masked from 'package:dplyr':

    group_rows
# Stats helpers
library(broom)

## Already installed in your codespace. On your own PC, install them first.

Load your data. If R cannot find the file, see Setup.

# df <- read.csv("../data/your_file.csv")   # uncomment and change to your file
Important

Where figures and tables go. Put each figure or table in the section that uses it, straight after the paragraph where you first discuss it. Do not collect them at the end of the report or in an appendix. Each section below says which figures and tables it needs, if any. Most reports need about 3 tables and 2–3 charts in total. More charts do not earn more marks: choose each one because it shows something your text discusses (see Lab: Data Visualisation, Parts 3 and 4). Remember that tables count towards the word count.

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 an HTML file. Remove this message and any irrelevant text from the final submission.


Introduction

Context. Explain why the topic matters (theory, policy, practice), briefly drawing on existing literature.
Aim. State clearly what you want to investigate (e.g., association between X and Y).
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 report is organised.

Figures and tables: none. This section is text only.


Literature Review

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.

Figures and tables: none. This section is text only.


Methods and Data

Figures and tables in this section: one table (the variables table below). No charts.

Data

Describe the dataset: who collected it, when, whether records are individuals (e.g. FRS, SAR) or geographical units (e.g. Census districts), how many records you use, and any filtering or sampling you applied.

Variables

Name your dependent variable and your independent variables, with their type (numerical or categorical) and units. For categorical variables, state the reference category. Present them in one short table (Variable, Description, Type, Units or categories): it describes the variables, it does not report results.

Table 1: Variables used in the analysis. Source: …
# a small table describing your variables (e.g. build a data.frame and show it with kbl()); refer to it as @tbl-variables

Transformations

Describe any recoding or aggregation (e.g., bin income into bands; reduce age groups from 11 to 3) and justify it. No table or chart needed: if you recode a variable, show its new categories in the variables table above.

Analysis

State which model you use and why, based on your dependent variable: multiple linear regression for a numerical dependent variable, logistic regression for a binary one.

Important: do not report results here. Descriptive statistics, model output and charts of your data go in Results and Discussion.


Results and Discussion

Figures and tables in this section: one summary table and 2–3 charts (descriptive statistics), then one model table (regression model). This is where almost all of your figures and tables belong.

Descriptive statistics

Summarise all the variables in your model in one table: mean, standard deviation, median and range for numerical variables; counts and percentages for categorical variables (e.g. vtable::st() or kbl(), see the Week 5 lab, Data Visualisation).

Table 2: Descriptive statistics of the variables in the model. Source: …
# one summary table of all model variables; refer to it as @tbl-descriptives

Then add 2–3 charts, each chosen for the variables it shows. Pick from:

  • Distribution of the dependent variable: histogram (numerical) or bar chart (categorical or binary).
  • Dependent vs a key independent variable: scatterplot (both numerical), boxplot (categorical vs numerical), or stacked percentage bar chart (both categorical).
  • Associations between independent variables: correlation matrix or correlogram for numerical variables; Chi-squared test and Cramér’s V for categorical variables. This also flags variables that are too closely related to include together.

Comment on what each table and chart shows. Do not overload the report with graphs, and do not show the same result in both a table and a chart. Put each chart in its own code chunk, straight after the paragraph that discusses it.

# one chart per chunk; refer to this chart in your text as @fig-dependent

Regression model

Present the model in one table:

  • Multiple linear regression: coefficients, standard errors (or 95% confidence intervals), p-values, adjusted R², number of observations.
  • Logistic regression: odds ratios with 95% confidence intervals, p-values, number of observations.

For each independent variable, report the direction and size of the association in the units of the dependent variable (e.g. percentage points, or odds for logistic regression), whether it is statistically significant, and that it holds with the other variables held constant. Interpret categorical variables against their reference category. Then report the model fit and, in a sentence or two, what the diagnostic checks showed (see the Week 2 lab, Multiple Linear Regression): describe them in words, you do not need to include the diagnostic plots. The regression model should be the core of this section!

Table 3: Regression model of … Source: …
# run the model and show a table summarising it (e.g. tidy() + kbl()); refer to it as @tbl-model

Discussion

Answer your research question. Compare and contrast your findings with the literature: where do they agree, where do they differ, and why might that be? Remember that regression shows associations, not causes. No new figures or tables here: refer back to the ones above (e.g. “as @tbl-model shows…”).

Captions and labels (all figures and tables): give each one a number and a descriptive title (the fig-cap / tbl-cap options above do this), label axes with units, state the data source, and refer to each one in the text.


Conclusion

Summary. Recap the main findings vis‑à‑vis the RQ (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.

Figures and tables: none. This section is text only.


References

List every source you cite, in one consistent referencing style (e.g. Harvard). References are not included in the word count.