Statistics in Research
Introduction
Welcome to the Statistics in Research website. Here you can freely access video discussions and accompanying lessons that explore data analysis procedures across a wide range of research applications.
The data associated with each application may be used as a standalone resource for exploration. The lessons then provide a structured and comprehensive introduction to data analysis (New Zealand high school up to undergraduate university level) and the use of the statistical software R (About R).
Videos
How to use this series
Website structure
If you are unfamiliar with the R language you should first work through Getting started with R Chapter 2 . This contains instructions for using R, including downloading and installing the required software and a walk-through of the building blocks of its functionality. Subsequent lessons will examine particular techniques in detail via applications.
The videos have been grouped according to the type of data being analysed (Continuous, Count, and Time Series), and further ordered according to the complexity of techniques that are being taught.
Early lessons step through the relevant techniques in detail and code is able to be directly copied into your R Markdown, so you can get a good understanding of the procedures.
Lesson structure
Data is provided to download in Excel format, along with an overview of the variables in the data set for teachers to assess relevance.
Videos are embedded in the html document. They focus on the application and statistical methodologies for real data collected or produced by an active researcher. The results discussed are not always replicable, typically as a result of differences in the data sets used (availability and privacy reasons), however the techniques addressed are the same. They do not rely on any statistical package, and give an appreciation for the research and lesson plan.
Objectives state the main statistical techniques and concepts that will be stepped through in the subsequent lesson, specifying which techniques are presented for the first time or are an opportunity to refine skills.
Tasks aim to teach statistical skills in an accessible and interesting way. Although they are presented for direct implementation in R, the Excel format of data allows the translation of tasks to any software of choice.
The first task of every lesson installs any necessary R packages and loads the data into R. Subsequent tasks then explore a variety of relevant techniques.
R code is provided to help build confidence in R, in addition to practice calculations where code is written from scratch using R Markdown. The content is structured so that earlier lessons provide more support with R and later lessons encourage self-directed learning.
Each task has a tab structure to guide users.
The first tab is the Task which presents instructions for a particular analysis technique.
The second tab is the Code, this provides directly executable and reproducible R code relevant to the task. Depending on the particular task this may contain the complete necessary code, but often some slight modifications are required to answer all components of a task.
The Solution tab provides the complete R code to answer the task, as well as showing the expected R output. This can be used to check your work.
Some tasks also contain an optional Extension which does not have solution code provided. This may involve utilising the task technique in a different context, examining additional concepts, or some external research.
Interacting with the lessons
To replicate code (both in the later sections of this Introduction and the lessons themselves), you can use the “Copy to clipboard” feature. Hover in the top right of the code chunks we provide, then click to copy the contents of the chunk to your clipboard (button shown below). You can then paste and execute this code within chunks in your R Markdown script.
Note that some of the code chunks included in these lessons utilise a horizontal slider to improve formatting. This operates in the same way as the vertical sliders used to scroll down pages. Scrolling may be necessary to view the entirety of a code chunk.
As the lessons progress, some code is hidden and additional techniques are taught. This will allow you to test your learning by trying to perform some of the calculations independently, before checking your answers by revealing the code.
Code is shown and hidden by clicking the “> Code” button above each chunk.
If you want to show or hide all of the code in a lesson, you can utilise the “</> Code” button in the top left corner (across from the main title).
Important Information is indicated using green call-out boxes.
Previous Lessons are linked using orange call-out boxes. These are automatically collapsed, but can be revealed with a click.
Previous Tasks within the same lesson are indicated using blue call-outs. They are automatically collapsed, but can be revealed with a click.
Acknowledgements
The creation of this resource was made possible by contributions from researchers across a range of disciplines (credited in their respective videos). The videos were initially recorded and edited by Robert van der Vyver in the University Media Production Unit. The lessons and site have been developed and updated by Matthew Schofield, John Harraway, Greg Trounson and Jessica Allen, with funding support from a Committee for the Advancement of Teaching and Learning (University of Otago) grant.