MSMR Report 2025/26

Key Dates

  • Coursework set: 12 noon, Thursday 26th March 2026
  • Coursework due: 12 noon, Thursday 23rd April 2026

Own work policy

  • This is an individual assignment and any work submitted should be your own. This applies to both R code and the written report.
  • Please do not post any code or output related to this report on the discussion forum.
  • Similarity checks will be performed, and further investigations will be carried out if assignments from different groups are similar.

Please see the AI policy on Learn.

Instructions

You need to produce a report answering the tasks detailed in the two Coursework Tasks sections. In a separate file, you will also need to provide the R code which exactly reproduces your reported statistical results (that means numbers, tables, figures should match but excludes formatting differences).

We would like to draw your attention at the following differences from the USMR report:

  • There are two parts to the coursework, each based on the two five-week blocks of the course. Address each part of the report as if it was a journal paper or your dissertation. In other words, think of each part of the report as a single standalone study. You should avoid answering a list of research questions, but providing a comprehensive analysis of the data in light of the question(s) of interest.

  • We would recommend that for both parts of the coursework you write a methods section and a results section. The methods section should detail the appropriate analyses you undertook and how they will provide answers to the research questions. The results section should present and discuss your findings, utilising graphics where necessary to illustrate your points. Analyses will draw on the methodologies we have discussed in lectures and weekly exercises.

What you need to submit

You are required to submit 2 documents. Late penalties will apply until you have submitted BOTH files:

  1. Your final compiled report, detailing your analyses, results, interpretation and conclusions. This should not include any R code (or R output printout), but only text, figures, and properly formatted tables.
    • This must be a PDF file (.pdf extension).
  2. A file containing the R code used to generate your statistical results.
    • This can either be an R script (.R extension) or an Rmd file (.Rmd extension).

Page limit

  • Your report should be no longer than 5 pages.

  • You may use an Appendix, which won’t count towards the page limit, in which you can only place tables and figures (no text). The appendix is a good place for supplementary materials. By this we mean figures and tables that are not strictly necessary for the reader to understand and replicate your results, but provide additional context to your report.

Report Formatting

As with USMR, you are welcome to write in RMarkdown/Quarto and knit to word, html, or pdf. You are also welcome to write code in a .R file and copy-paste results into a standalone word processor when writing up. Please just ensure that the final report is exported to a .pdf file.

We don’t mind which of these approaches you take: The important thing to remember is that the data analysis and modelling results in the report should match those produced in your R or RMarkdown file.

If you do wish to do some or all of your formatting in RMarkdown, then we suggest the following readings for help:

Feel free also to post formatting questions on the Piazza discussion forum.

A note on knitting .Rmd/.qmd directly to pdf

Getting RMarkdown/Quarto to knit directly to pdf can be a pain, and formatting is difficult.

We recommend:

  • knit to .html, then Ctrl+P to print to .pdf
  • knit to .docx, then export to .pdf

Submitting your files

Pre-submission checks

Before submitting, we strongly advise you to check that you code runs. The easiest way to check this is to:

  • if using an .R script: Clear your environment, restart your R session (top menu, Session > Restart R), and run your code line by line to see if any errors arise. Alternatively, try clicking “source” in the top right of your script.
  • if using RMarkdown/Quarto Check that your .Rmd/.Qmd compiles (i.e., can you knit your Rmarkdown document into .html/.pdf/.docx without error?)

Filenames

For both files which you submit, the filename should be your Exam Number with the appropriate extension, and nothing else.

For example, a student with exam number B047847 would submit two files:

  • B047847.pdf
  • B047847.R

Where to submit

Go to the Assessments page on Learn, and look for “Assessment Submission”. There you will find two submission boxes (one for each file). For each file you should complete the “Submit File” popup by entering your exam number in the “Submission Title” box.

Late penalties

Submissions are considered late until both files are submitted on Turnitin (see the PPLS policy on late penalties on the MSc Hub).

Grading

We are primarily marking your report, and not your code
As the compiled report will not contain visible R code, a large part of the challenge comes in clearly describing all aspects of the analysis procedure in software agnostic language. A reader of your compiled document should be able to more or less replicate your analyses without referring to your R code.

Grades and feedback are provided for the finished reports, with marks awarded on:

  • Strategy
    • Clear and useful description of the sample used in the analyses.
    • Appropriate analyses conducted to address the research aims, building on methods taught in the class.
    • Clear explanation of the analyses undertaken (without reliance on reference to R code to describe model structures).
    • Transparent and justified explanations of any decisions made about the data prior to and during analyses.
  • Results
    • Appropriate presentation of the relevant results, with sufficient information of the inferential conclusions (for instance, a test statistic, standard error, and p-value, not just one of these). Remember to cite degrees of freedom where needed.
    • Clear and accurate interpretation (in the form of a written paragraph(s) referencing relevant parts of your results and statistics) leading to a conclusion regarding the question.
    • Use of clearly interpretable plots and tables where appropriate to provide additional presentation of findings.
  • Writing & Formatting
    • Clarity of writing and structure, use of appropriate language avoiding unnecessary jargon or overly complex explanations.
  • Code Check
    • Ability of the code to precisely reproduce the analyses, results, and plots presented in the report.

IMPORTANT: Ensuring Reproducibility.
Some functions (such as fa.parallel()) and processes such as bootstrapping, will involve randomly generating numbers, and so results will vary slightly each time you run them. To ensure that your results are reproducible, at the top of your code, use set.seed() to set the random seed. Choose a number (any length) and pass it to set.seed(). Then, every time you run random number generations, it will produce the same results.
For example:

set.seed(8675309) # This is an example, choose your own! 

Any Questions?

This document contains a basic overview of the task and of how to submit it. If you have any questions concerning the coursework report, we ask that you post them on the designated section of the Piazza discussion forum on Learn. If you have a question, it is likely your classmates may have the same question. Before posting a question, please check the on-line board in case it has already been answered.



COURSEWORK TASKS

Getting your data

Each of you gets your own two datasets for your assignment.
You can read the data into R using the code below, and replacing the B123456 with your exam number (you can find this on your matriculation cards (see here for more information)).

Please note, if you do not give a valid exam number, this will not give you any data.

source("https://edin.ac/4boOrMs")
get_my_data("B123456")

Running the function above will result in two objects appearing in your R environment:

  • gardenpath is the dataset for Part A
  • locus is the dataset for Part B

Part A: gardenpath

Study Background
The City of Edinburgh Council has implemented a new scheme to get young people into gardening. The scheme was coordinated by 15 community allotments (shared gardening spaces) across the city, and was offered to people between the ages of 12 to 25. Each person who took part in the scheme took part in weekly 2-hour gardening sessions at a designated allotment. When signing up for the scheme, participants opted for a preferred type of session: solitary gardening (in which they work mostly alone); paired gardening (in which they are paired with a volunteer from the allotment to work together each week); or community-group gardening (in which they join a larger group scheduled session at which many people are working in the allotment).

Researchers at the Edinburgh Council are interested in the benefits of gardening for improving mental wellbeing in young people, and so asked all the people taking part in the scheme to complete the Rosenberg Self-Esteem Scale (R-SES), a unidimensional scale assessing global self-worth by measuring both positive and negative feelings about the self (scores range from 0 to 30). Participants completed this measure when they signed up, and then subsequently every 3 months for up to 18 months.

Table 1 provides a description of the variables that can be found in the gardenpath data.

TASK
Assess the extent to which improvements in young people’s wellbeing (measured via a scale of self-esteem) with weekly gardening sessions depend on whether these sessions are solitary, paired, or community based gardening.

Table 1: Data Dictionary for gardenpath
variable description
allotment Allotment Location
time Timepoint of study
months Duration (months) since baseline
age Age (years) of participant at baseline
prevexp Whether or not participant had previous experience of gardening (0 = No, 1 = Yes)
gtype Gardening Session Type (1 = Paired, 2 = Community, 3 = Solitary)
participant Participant Name
RSES Rosenberg Self-Esteem Scale (R-SES), a unidimensional scale assessing global self-worth (scores range from 0 to 30)

Part B: locus

Study Background
A research group is studying the impact of locus of control on mental health and whether developing effective coping strategies during adolescence is a mediating mechanism. They have acquired data from a longitudinal study that has collected data on 700 people from the age of 12 up to 24. The study had 5 waves of data collection (every 3 years). The researchers have requested data on a 6-item locus of control measure from the first wave (respondents at age 12), a 8-item coping-strategies measure from the third wave (respondents at age 18), and a measure of ‘internalising problems’ from the final wave (age 24) which included two subscales: one 4-item anxiety measure and one 4-item depression measure (see Data Dictionary). All items are scored on a 5-point scale of agreement.

Previous EFA analyses suggested that the locus of control and coping measures were unidimensional, whereas the optimal factor structure for the internalising problems scale was one with two correlated (anxiety and depression) factors.

TASK
Using the locus dataset, described in Table 2, test the hypothesis that the effects of having a higher internal locus of control on internalising problems are partially mediated by the use of more adaptive coping strategies.

Table 2: Data Dictionary for locus
variable description
ID Unique participant identifier
loc1 When I do well in something, it’s because I tried really hard
loc2 I think I can control most things that are important to me
loc3 What happens to me later in life is mostly up to me
loc4 It is just luck that decides what happens in my life
loc5 People are wrong if they say you can’t change what happens in your life
loc6 I believe that working hard will help me get what I want
cope1 When I encounter a problem, I am able to focus on how to solve it
cope2 I am good at tackling issues head on, rather than avoiding them
cope3 When I have a problem, my feelings tend to get in the way of me solving it
cope4 I am able to approach difficult issues with a problem-solving mindset
cope5 I look for ways to calm down first, so I can think clearly about my problems
cope6 If something bothers me, I talk to someone I trust about my feelings
cope7 I try to plan step-by-step what to do next when I face a problem.
cope8 I take a break to do something I enjoy when I feel overwhelmed.
anx1 I worry a lot
anx2 I feel on the edge of panic
anx3 I feel anxious
anx4 I think a lot about what bad things might happen
dep1 I cry often
dep2 I feel sad for no reason
dep3 I don't find joy in anything
dep4 I feel worthless