
Note: To ensure that the assumption of independence of observations was met, as discussed earlier, participants could only be in one of these two groups and the two groups did not have any contact with each other. After 6 months, the cholesterol concentration of participants (in mmol/L) was measured in the exercise group and the control group. This group was called the " control" group. The other group continued with their typical daily activities (i.e., they remained "sedentary").

This experimental group was called the " exercise" group. One group underwent an exercise intervention where participants took part in a 6-month exercise programme consisting of four 1-hour exercise sessions per week. These 21 participants were randomly assigned to one of two groups. In this fictitious study, the researcher recruited 21 participants who were classified as being " sedentary" (i.e., they engaged in only low daily activity and did not exercise). For example, a cholesterol concentration of 3.57 mmol/L would be associated with better cardiovascular health compared to a cholesterol concentration of 6.04 mmol/L. One measure of cardiovascular health is the concentration of cholesterol in the blood, measured in mmol/L, where lower cholesterol concentrations are associated with improved cardiovascular health. R and RStudio ExampleĪ researcher wanted to know whether exercise could improve a person’s cardiovascular health. Therefore, start by reading the example we use throughout this introductory guide in the next section.

#Load data in r studio how to#
On this page, we set out the example we use to illustrate how to carry out an independent-samples t-test using R, before showing how to set up your data using Microsoft Excel, R and RStudio. On the previous page you learnt about the type of research where an independent-samples t-test can be used and the critical assumptions of the independent-samples t-test that your study design, variables and data must meet in order for the independent-samples t-test to be the correct statistical test for your analysis. Independent-samples t-test using R, Excel and RStudio (page 2)
