In a paired t-test, we are dealing with paired data. This is where each element in our study has a measurement recorded under two different conditions. We can then find the difference between the paired data to reduce the values into a single data sample. But before doing this, we first have to choose a data set to analyse.
What data source will you be using?
Warning: Other than the 'SleepStudy' data set, the other data sets are synthetic (made up) data.
Now we need to select what data we want to be in condition 1, and what to be in condition 2. The paired difference will be condition 2 - condition 1.
Warning: Condition 1 and condition 2 should be different.
Enter data into the text box below for each sample.
Condition 1:
Condition 2:
Warning: You must have at least two unique values in your manually specified data.
In order to proceed, you must select some data to act as your sample.
We are going to use the box model to represent our null hypothesis.
The only things we need to do to set up the box in this test is to specify the sample data (which we have already done) and specify
the null hypothesis.
For a paired t-test, the null hypothesis is that the difference between the average of condition 2 (\(\mu_2\)) and condition 1
(\(\mu_1\)) is equal to some value we specify. We write \(\mu_2 - \mu_1 \) as \(\mu_d\), where \(d\) stands for
difference.
Hence, the null hypothesis is that the average population mean difference between condition 2 and condition 1 is equal to
some value which we set below.
\( H_0: \) \(\mu_d = \)
In case you are confused about where all the values in the diagram have come from, these come from the sample data that you previously specified. In particular:
Specify what type of alternate hypothesis you will be using below:
Null Hypothesis
Alternate Hypothesis
For the hypothesis test to be valid, we need to check the following assumptions:
The first assumption is that our sample is independent and randomly chosen.
How do we check? We check by investigating the experimental setup.
For example, consider we were investigating data for a sample involving human participants. We could read the accompanying scientific
publication to understand the methodology they used to gather the people in the sample.
The second assumption is that the sample means follow a normal distribution.
How do we check?
Idea 1: Large n
Recall that the central limit theorem tells us that if we take a sufficiently large number of draws from the box, then the sample
means will approximately follow a normal distribution. If confused, please do the exerice at Fundamentals > Box Model Part 2.
Idea 2: QQ-plot, Boxplot and Histogram
We learnt that if our data has some specific properties, then required a smaller value for n for the CLT to apply. In particular...
Step 1) Calculate Expected Value (SE) and Standard Error (SE)
Step 2) Test Statistic Calculation
One way to tell whether we accept or reject the null hypothesis is to observe whether our p-value is below or above the significance level.
Step 1) What is your significance level?
\( \alpha = \)
Error: The value for α must be between 0 and 1.
Step 2) Final Conclusion
A confidence interval in a 1-sample z-test shows the range of population means that are plausible at the chosen confidence level, and if the
hypothesized mean falls outside this range, the null hypothesis is rejected.
We can also use a confidence interval to tell us whether we should accept or reject the null hypothesis. If the expected value DOES NOT lie within the
confidence interval, then we reject the null hypothesis.
Step 1) What is your confidence level?
\( \alpha = \)
Error: The value for confidence level must be between 0 and 1.
Step 2) Final Conclusion