# Independent samples t-test

**What is a T test? **

This is a type of statistical test which determines whether or not there is a statistically significant difference between the mean value of two independent groups i.e. is the difference between the groups larger than what would be expected from random chance. This test is a parametric test, meaning that it assumes that the information within both groups are normally distributed.

There are different types of t test which can be used depending on whether you are using unpaired ‘independent’ variables or paired ‘dependent’ variables. For this particular section we are going to focus on the independent T-test, also known as the Students T test.

**When can I used this test? **

- Comparing the blood results between patients with a particular condition vs those without the condition. E.g raised ALP in those with gallstone disease.
- Determining if the treatment effect of a novel drug in a randomised control trial is significant compared to the control intervention.

**Why is it called the ‘Students’ T-Test **

In the early 20^{th} Century, Wiliam Sealy Gosset was a mathematician who worked for the Guinness brewery in Dublin. He found the the statistical tests that were used at the time were not helpful for the work he was doing for the factory. He therefore developed his own test, the t-test. He wanted to publish his works but had to publish it under a pseudonym as the brewery wanted to avoid divulging any company secrets. Therefore this was published under the name ‘Student’^{[1]}.

**How should I prepare my data? **

The data should be split into 2 columns with each observation as a new row. The first column will contain categorical information related to which group of the study the entry is from for each row. The second column will contain numerical values which are the variables obtained. When naming columns in the excel file avoid using spaces and brackets as this can sometimes cause errors; an alternative that can be used to a space is to use an underscore "_" instead of a space.

**Worked Example**

This is a worked example using information from the excel file provided below.

For this fictitious example, the data is from an randomised control trial to investigate the effect of a novel immunotherapy agent for bowel cancer compared to the current gold standard treatment. The first column shows which treatment arm or group the patients were in. Those in the control group received the current gold standard and those in the intervention group received the new treatment. The second column shows the reduction in size of the tumour after 1 year of usage of the medication.

The purpose of using a t-test for this example is to determine whether the reduction in tumour size of patients receiving the new medication is statistically significant compared to those receiving the current gold standard i.e is the different observed between these two groups due to random chance or not.

When looking at the results there are a few important points to mention

**Steps**

- Click analyse above
- Select browse and upload the worked example “Independent T Test Worked Example” and wait for it to upload
- If you have used a .csv file at this point you need to define your separator from the options provided, if you have used a .xlsx file this is not necessary.
- Select the checkboxes for treatment arm and tumour reduction. This tells the software that these are the two variables of interest but does not define which column contains the group definitions and which column contains the numerical values for analysis.
- For the drop down menu for ‘define continuous’ select Tumour Reduction
- For ‘Define Categorical’ select Treatment Arm
- You may then click on the various tabs provided

- Summary shows descriptive information regarding the 2 groups i.e. N, Mean, Standard Deviation and Standard Error.
- Group statistics provides the test statistic (t), degrees of freedom (df) and p-value followed by an explanation of whether the alternative hypothesis is true or not as well as the 95% confidence interval. This is provided for the students t-test (two sample t-test) first and then Welch T test (welch two sample t-test) below.
- Levene
- Tables - The majority of information related to the T test can be found under this heading.
- Error bars
- Box plot

- You can download your results by pressing the download button after selecting the file type from the check list.

**References**

- Student’s T-test – Britannica Encyclopaedia [https://www.britannica.com/science/Students-t-test}

Written By Shahi Ghani