Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Paired t-test | What Is Hypothesis Testing?
Quizzes & Challenges
Quizzes
Challenges
/
Applied Hypothesis Testing & A/B Testing

bookPaired t-test

A paired t-test is a statistical method used to compare the means of two related groups. You use this test when you have two measurements from the same subjects, such as before-and-after results for a treatment or matched pairs in an experiment. The paired t-test helps you determine if the average difference between these paired observations is significantly different from zero.

You should use a paired t-test when:

  • You measure the same group of subjects twice, such as before and after an intervention;
  • You have matched pairs, like twins or matched subjects, where each pair experiences both conditions;
  • The data points in one group are directly related to those in the other group.

This is different from an independent t-test, which is appropriate when comparing two unrelated groups. The paired t-test accounts for the fact that the data points are not independent, which increases statistical power and reduces variability due to subject differences.

The function ttest_rel from scipy.stats is used to perform the paired t-test in Python. This function compares two related samples and calculates whether their means are significantly different, based on the differences between paired observations.

123456789101112
import numpy as np from scipy.stats import ttest_rel # Example: Before and after test scores for the same students before_scores = np.array([78, 85, 69, 90, 88, 76, 95, 80]) after_scores = np.array([82, 88, 70, 92, 91, 78, 97, 85]) # Perform paired t-test t_stat, p_value = ttest_rel(after_scores, before_scores) print(f"T-statistic: {t_stat:.3f}") print(f"P-value: {p_value:.4f}")
copy
question mark

Which of the following scenarios is most appropriate for a paired t-test, rather than an independent t-test?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 8

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

Suggested prompts:

What does the p-value mean in this context?

How do I interpret the t-statistic result?

Can you explain when not to use a paired t-test?

Awesome!

Completion rate improved to 3.23

bookPaired t-test

Deslize para mostrar o menu

A paired t-test is a statistical method used to compare the means of two related groups. You use this test when you have two measurements from the same subjects, such as before-and-after results for a treatment or matched pairs in an experiment. The paired t-test helps you determine if the average difference between these paired observations is significantly different from zero.

You should use a paired t-test when:

  • You measure the same group of subjects twice, such as before and after an intervention;
  • You have matched pairs, like twins or matched subjects, where each pair experiences both conditions;
  • The data points in one group are directly related to those in the other group.

This is different from an independent t-test, which is appropriate when comparing two unrelated groups. The paired t-test accounts for the fact that the data points are not independent, which increases statistical power and reduces variability due to subject differences.

The function ttest_rel from scipy.stats is used to perform the paired t-test in Python. This function compares two related samples and calculates whether their means are significantly different, based on the differences between paired observations.

123456789101112
import numpy as np from scipy.stats import ttest_rel # Example: Before and after test scores for the same students before_scores = np.array([78, 85, 69, 90, 88, 76, 95, 80]) after_scores = np.array([82, 88, 70, 92, 91, 78, 97, 85]) # Perform paired t-test t_stat, p_value = ttest_rel(after_scores, before_scores) print(f"T-statistic: {t_stat:.3f}") print(f"P-value: {p_value:.4f}")
copy
question mark

Which of the following scenarios is most appropriate for a paired t-test, rather than an independent t-test?

Select the correct answer

Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 8
some-alt