Exercise 1

A t-test is suitable for comparing a single mean to an hypothesized mean or two means to each other. If using two means these may be collected from paired observation (the same individuals) or from independent samples (two different groups).

In these examples we will work with the data set from Haun et al. 2019. To download and load the data set:

library(tidyverse)
download.file("https://ndownloader.figstatic.com/files/14702420", destfile = "./data/hypertrophy.csv")

hypertrophy <- read_csv("./data/hypertrophy.csv")

We will start by looking at the variables SUB_ID, CLUSTER and T3T1_PERCENT_CHANGE_RNA. These variables can be selected by using the code below.

hyp1 <- hypertrophy %>%
  select(SUB_ID, CLUSTER, T3T1_PERCENT_CHANGE_RNA) %>%
  print()

The T3T1_PERCENT_CHANGE_RNA variable is the percentage change in total RNA content per muscle weight from the beginning to the end of the training period.

Using all participants, let’s say that we want to assess if training increases RNA content. What kind of test would you use and how can we formulate a null hypothesis using this limited data?

Try to write ?t.test in the console to read the help pages for the t.test if you are not sure.

Here is a possible solution


Exercise 2

The same test can be perfomed using the raw data. We will use the raw variables to test in RNA changes with training. The variables of interest are:

hyp2 <- hypertrophy %>%
  select(SUB_ID, CLUSTER, T1_RNA, T3_RNA) %>%
  print()

Using this new data set, how would you test if RNA changes wit training. What kind of test do you choose?

Here is a possible solution


Exercise 3

An independent, two sample t-test compares means from two groups that are not in any meaningful way related.

Calculate any difference of RNA increases between T1 and T3 between the HIGH and LOW cluster group. Are the groups different (at the population level)?

Here is a possible solution


Exercise 4

When writing up results it is good practice to include the test statistic together with a mean difference, a confidence interval and a p-value.

How can you use R to get all these values from a single test? Use the t-test performed in exercise 2 to get all values from the test function.

Here is a possible solution


Exercise 5

When writing results in R markdown we can add results from a test automatically in the test. Try to write Rmarkdown combined with R code to create the following output:

Total RNA content increased from T1 to T3 with 90.5 units (95% CI: [51.5, 129.5], t(29) = 4.74, p = 0).

Here is a possible solution