Skip to the content Skip to the Navigation

Jack R Auty

  • Lab Home Page
  • Research
  • Outreach and public engagement
  • Journal Articles
  • Tools
  • Web appsWeb apps created by Jack
    • TDP proteomics explorer
    • Ice breaker
    • Exploration of RNAseq and Epidemiological datasets
    • Feedback selector
    • Novel Object Recognition Task Timer
    • Pomodoro timer
    • Power Calculator
    • Power Calculator Cohen’s D
  • R Code
    • How to use Rmarkdown
    • A complete guide to ANOVAs in R
    • How to make a Rain Cloud Plot (aka a Rotated Violin plot)
    • Generalized mixed modelling
    • How to make a simple bar graph in R
    • Stepwise Multiple Regression
    • Mediation analysis with nuisance variables.
    • Multi-level linear model (repeated measure ANOVA)
    • PCA and 3D PCA
    • Power analyses
    • Student t test
    • ANOVAs One-way and two-way
    • Finding an outlier using Cook’s distance

R Code

  1. HOME
  2. R Code
July 10, 2025 / Last updated : July 15, 2025 jackrrivers R Code

How to use Rmarkdown

This post is a quick guide to setting up an R Markdown file so everything runs smoothly from the start. It assumes you’ve already installed R, RStudio, and the rmarkdown package. Once that’s done, open RStudio and go to File → New File → R Markdown to create a new document. I’ll share the essential […]

July 25, 2023 / Last updated : July 25, 2023 jackrrivers R Code

How to make a Rain Cloud Plot (aka a Rotated Violin plot)

These are great plots. They look good and do not hide any information. They provide quick insights into the data, including its spread, any differences present, and the rough distributions. It is important to choose a graph that matches the statistical test conducted. For instance, if you show mean +/- SEM or SD, you should […]

November 9, 2022 / Last updated : July 18, 2024 jackrrivers R Code

A complete guide to ANOVAs in R

This again is more for my use than anyone else’s. The focus of this post is doing ANOVAs (or linear models, after all everything is a linear model), in a nice readable and publishable way with transformations, post-hocs and graphs. Mostly for appearance reasons, this processes uses lots of packages. Packages should normally be avoided, […]

February 3, 2021 / Last updated : October 3, 2023 jackrrivers R Code

How to make a simple bar graph in R

OK, I’ll be honest, this post is mostly for me. I always forget how to do all of this and end up spending hours on google. So now I can do what all coders do, copy – paste – adjust. So here we go -> how to do a simple bar chart with SEMs, that looks […]

May 20, 2020 / Last updated : August 6, 2025 jackrrivers R Code

Mediation analysis with nuisance variables.

Mediation Analysis with Nuisance Variables Mediation Analysis with Nuisance Variables Jack Auty 2025-08-06 1 Introduction 2 Load Required Packages 3 Citations 4 Load and Prepare Data 5 Distribution of the dependent and explanatory variables 6 Adjust the data for nuisance variables 7 Standardise explanatory variables 8 Build base models and check assumptions 9 Mediation analysis […]

May 15, 2020 / Last updated : May 15, 2020 jackrrivers R Code

Stepwise Multiple Regression

Often you have a truck load of potential explanatory variables, that all might interact with each other, giving a multitude of potential ways the explanatory variables could relate to the dependent variable. You could painstakingly create every possible model or you could do a step-wise regression. Step-wise regression automatically adds and subtracts variables from your model and […]

February 28, 2019 / Last updated : February 28, 2019 jackrrivers R Code

Statistics example datasets

Lecture four datasets    

October 2, 2018 / Last updated : November 13, 2024 jackrrivers R Code

Generalized mixed modelling

Sometimes you know your data can’t follow a normal distribution even after transformation – such as count data or yes/no data. If this is the case, then generalized mixed modelling is the way to go. Basically it’s very similar to general linear modelling which assumes normality of the population distribution, but instead it assumes a […]

April 3, 2018 / Last updated : April 30, 2018 jackrrivers R Code

Finding an outlier using Cook’s distance

A Cook’s distance greater than 1 is a sign that this data point (or random factor) is having a disproportionate influence on your model and should be looked into. Note: I’m not normally a fan of removing data without a valid reason, for me, you need both a statistical and experimental reason for removal. #Loading […]

March 28, 2018 / Last updated : November 24, 2023 jackrrivers R Code

Multi-level linear model (repeated measure ANOVA)

When the data is unbalanced or there are missing values, repeated measures ANOVAs fail to report unbiased results. Furthermore, all the data of one individual will be ignored if data from one time point is missing. Multi-level linear models gets around this by comparing models of the data, not the data itself, using log-likelihood/Chi squared distribution […]

Posts pagination

  • Page 1
  • Page 2
  • »

Copyright © Jack R Auty All Rights Reserved.

Powered by WordPress & Lightning Theme by Vektor,Inc. technology.

MENU
  • Lab Home Page
  • Research
  • Outreach and public engagement
  • Journal Articles
  • Tools
  • Web apps
    • TDP proteomics explorer
    • Ice breaker
    • Exploration of RNAseq and Epidemiological datasets
    • Feedback selector
    • Novel Object Recognition Task Timer
    • Pomodoro timer
    • Power Calculator
    • Power Calculator Cohen’s D
  • R Code
    • How to use Rmarkdown
    • A complete guide to ANOVAs in R
    • How to make a Rain Cloud Plot (aka a Rotated Violin plot)
    • Generalized mixed modelling
    • How to make a simple bar graph in R
    • Stepwise Multiple Regression
    • Mediation analysis with nuisance variables.
    • Multi-level linear model (repeated measure ANOVA)
    • PCA and 3D PCA
    • Power analyses
    • Student t test
    • ANOVAs One-way and two-way
    • Finding an outlier using Cook’s distance