Basic statistics - 10. The unpaired t-test | Independent samples t-test

The unpaired t-test | Independent samples t-test

Basic definition

One-sample t-test : Basic statistics - 07. The one-sample t-test and p-values

Unpaired Test

Example: When

Note: Two different groups should be independent.

In blow, we should used paired t-test:

Another example:

Example: How

How an unpaired t-test works by using the following example, we want to test if the upper blood pressure is different between people in the age 20 to 35 compared to people in the age 36 to 55.

To test this one is collected four random individuals from the relevant population where people are at age between 20 to 35 and four individuals from the population where people are in age between 36 to 55.

We'll use unpaired t-test to test if there is a difference in the high blood pressure between people in the two age groups.

The null hypothesis in this case states that the two population means are equal.

The H1 is means historic blood pressure is different between the two age groups.

We set the significant level alpha = 0.05.

let's first calculate the means stored blood pressure for the two age groups. The means is total blood pressure of the four individuals in the younger group is 124 and 129 of the four individuals in the older group. We can see that the mean pressure is higher in order group than younger group, but we can't be sure if this result is duo to chance , because we randomly choose eight people from population.

So the unpaired t-test can help us determine if this absurd difference in the sample means is due to chance or if it's actually reflects that there is a true difference in the means of systolic blood pressure.

size since we have four observations from each group our two groups have the same sample size. X bar 1 denotes a sample mean of group 1, X bar 2 denotes a sample mean of group 2, so numerator represents the difference between two groups . S1 represents the sample variance of group 1, S2 represents the sample variance of group 1, the n1 and n2 denote the sample size of group 1 an group 2.

Remember that the sample variance is calculated at the sum of the square differences between observations and the mean divided by n minus 1. for example to calculate the variance of group 2.

The square root of the variance divided by the sample size is the standard error of the mean.

The denominator therefore represents the standard error of the difference between the two sample means , which tells us the uncertainty of the difference we have observed, this equation is only valid if the two groups have the same sample size.

if the sample sizes of the two groups are not equal, the equation will become more complicated. this is because we put more weight on the variance of the group with the largest sample size.

Then we can calculate t=-2.74 , which represents our t statistic this number can be interpreted as the younger individuals have systolic blood pressure that is on average 2.74 standard errors lower than the older individuals.

We use t-distribution with degrees of freedom = total sample size - 2, 2 is because we estimate two means.

The we can calculate the area at the left-hand side of -2.74 and to the right-hand side of 2.74. We used two-sided test, the area is 0.034, so p-value = 0.034.



And the results from a t-test are usually reported together with 95 confidence interval this equation can be used to calculate the confidence interval for the difference between the means.

we see that we are 95 certain that the two difference between the population means lies somewhere between negative 9.5 and negative 0.5.

Note that this interval does not include the value 0, because 0 is greater than the upper limit of the confidence interval.

相关推荐
爱听歌的周童鞋21 天前
Steve Brunton | Probability Bootcamp | 笔记 | 第四部分:高级统计 | Lecture 40 | 矩母函数的可加性质
statistics·steve brunton·probability·mgf·additivity
爱听歌的周童鞋21 天前
Steve Brunton | Probability Bootcamp | 笔记 | 第三部分:高级概率 | Lecture 43 | 概率中的尾和公式
statistics·steve brunton·probability·tail sum·ccdf
爱听歌的周童鞋21 天前
Steve Brunton | Probability Bootcamp | 笔记 | 第四部分:高级统计 | Lecture 41 | 协方差与相关性
statistics·steve brunton·probability·covariance·correlation
爱听歌的周童鞋21 天前
Steve Brunton | Probability Bootcamp | 笔记 | 第四部分:高级统计 | Lecture 37 | 矩母函数
moments·statistics·steve brunton·probability·mgf
爱听歌的周童鞋22 天前
Steve Brunton | Probability Bootcamp | 笔记 | 第四部分:高级统计 | Lecture 35 | 大数定律
statistics·steve brunton·probability·lln·sample mean
青春不败 177-3266-052024 天前
基于R、Python的Copula变量相关性分析及AI大模型应用
人工智能·python·r语言·贝叶斯·统计学·copula
青春不败 177-3266-05201 个月前
R语言数据统计分析与ggplot2高级绘图
r语言·生态学·科研绘图·统计学·ggplot2·环境科学
爱听歌的周童鞋1 个月前
Steve Brunton | Probability Bootcamp | 笔记 | 第一部分:概率导论 | Lecture 8 | 条件概率
statistics·steve brunton·probability·conditionalprob
爱听歌的周童鞋1 个月前
Steve Brunton | Probability Bootcamp | 笔记 | 第一部分:概率导论 | Lecture 7 | 二项分布与多项分布
statistics·multinomial·steve brunton·probability·binomial
统计学小王子1 个月前
关于离散变量和连续变量的联合分布的一些讨论
统计学