独立t检验和配对t检验_配对学生的t检验是什么?

独立t检验和配对t检验

There’s a neat YouTube channel I discovered a couple of years ago where Eugene O’Loughlin, Ph.D., does some statistical analyses by hand. I thought it was neat because it allows us to see that statistical analysis is not something that only computers can do. Sure, computers can do these analyses much faster than we ever could, but you really can do a lot with just a pen and paper and a good calculator.

几年前,我发现了一个整洁的YouTube频道 ,其中Eugene O'Loughlin博士是 ,手动进行一些统计分析。 我认为这很整洁,因为它使我们看到统计分析不是只有计算机才能完成的事情。 当然,计算机可以比以往更快的速度进行这些分析,但是实际上,您只需笔和纸以及一个好的计算器就可以完成很多工作。

Of course, you need some knowledge of numbers and how they work, and the basic statistical concepts that will help you get the work done, but there’s not much else after that. For example, here is Dr. O’Loughlin doing a paired t-test by hand:

当然,您需要一些数字及其工作方式的知识,以及可以帮助您完成工作的基本统计概念,但是在此之后没有太多其他知识了。 例如,这是O'Loughlin博士手工进行的配对t检验:

Paired t tests are used to test the theory that the average score of a test taken by one group is different (or the same) as the average score of another test taken by the same group. (One group, two tests… Paired.) Now that you’ve seen the video on how to do it by hand, how can you do it in R in a way that teaches you how the base t.test function works internally?

配对t检验用于检验以下理论:一组考试的平均分数与同一组另一考试的平均分数不同(或相同)。 (一组,两个测试…配对。)现在,您已经观看了有关如何手动执行视频的视频,如何在R中以教您基本t.test函数如何在内部工作的方式进行视频处理?

First, The Things You’ll Need to Know

首先,您需要知道的事情

Using Dr. O’s data set up there and his example, we know that we need to know the differences between the tests, the square of the differences, and the sum of the differences and the sum of the squared differences. We also need to know the degrees of freedom (number of pairs minus 1) and then go get the critical value of the t score from a table.

使用O博士在那里设置的数据和他的示例,我们知道我们需要知道测试之间的差异,差异的平方,差异的总和以及差异的平方和。 我们还需要知道自由度(对数减去1),然后从表中获得t分数的临界值。

That’s it… So let’s do it in code:

就是这样...所以让我们在代码中完成它:

# First, the pre-lesson scores:pre <- c(23,25,28,30,25,25,26,25,22,30,35,40,35,30)# Then, the post-lesson scores:post <- c(35,40,30,35,40,45,30,30,35,40,40,35,38,41)# What are the average scores?pre.avg <- mean(pre)
post.avg <- mean(post)

Here, I’ve created the pre and post datasets. Then I went ahead and calculated the average for each set. The average score in the post set is higher than the average score in the pre set, but is that difference statistically significant? Let’s calculate the values we need:

在这里,我创建了前后数据集。 然后我继续计算每组的平均值。 帖子集中的平均分数高于预设中的平均分数,但是这种差异在统计上是否显着? 让我们计算所需的值:

# Differences between the setsdifferences <- pre-post # Pre minus post# Sum of differences between the sets:sum.differences <- sum(differences)# Square the differencesdifferences.sqrd <- differences^2# Sum of the squared differences:sum.sqrd.differences <- sum(differences.sqrd)# Sum of differences squared:sum.differences.sqrd <- sum.differences^2# Number of observation pairsn.obs <- as.integer(length(pre))

Now, we have everything we need to know to calculate the t score:

现在,我们拥有计算t分数所需的所有知识:

t.score= sum.differences / sqrt(
(((n.obs*sum.sqrd.differences)-(sum.differences.sqrd))/
(n.obs - 1)
))# Your t score isView(t.score)

You’ll see that the t score is the same as Dr. O calculated, so our conclusion is the same. Of course, you can do this much faster in R:

您会看到t分数与O博士计算的相同,因此我们的结论是相同的。 当然,您可以在R中更快地执行此操作:

t.test(pre, post, paired = TRUE, alternative = "two.sided")# The alternative is "two.sided" because we're hypothesizing that the two
# sets are different. If we were hypothesizing that the true difference in
# means was greater or less than zero, we would use "greater" or "less" in
# the alternative statement.t.test(pre,post, paired = TRUE, alternative = "less")

And that’s it. You’ve done a paired t test in R the long way and the short way, but now you know how the short way arrives at the calculation that you do by hand and via the short way.

就是这样。 您已经在R和长途中用R完成了配对的t检验,但是现在您知道了短途如何通过手工和短途完成计算。

It is essential for you to know how these functions work “under the hood” because there may come a time when someone programming those functions makes a mistake. Do you really want your work to hinge on how someone else — someone you may not even know — does their proofreading of their code?

对您来说,了解这些功能如何“在后台”工作非常重要,因为有时可能有人对这些功能进行编程会出错。 您是否真的希望您的工作取决于其他人(您甚至可能不认识的人)如何对其代码进行校对?

I didn’t think so.

我不这么认为。

René F. Najera, MPH, DrPH, is a doctor of public health, an epidemiologist, amateur photographer, running/cycling/swimming enthusiast, father, and “all around great guy.” You can find him working as an epidemiologist a local health department in Virginia, grabbing tacos at your local taquería, or on the campus of the best school of public health in the world where he is an associate in the Epidemiology department. All the opinions in this blog post are those of Dr. Najera and do not necessarily represent those of his employers, friends, family or acquaintances.

RenéF. Najera,公共卫生硕士,博士 ,是一名 公共卫生 医生,流行病学家, 业余摄影师 ,跑步/骑自行车/游泳爱好者,父亲和“周围的好人”。 您可以找到他在弗吉尼亚州的一个地方卫生部门担任流行病学家,在您当地的taquería或世界上最好的公共卫生学院的校园里抓玉米饼,在那里他是流行病学部门的助理。 本博客文章中的所有观点均为纳杰拉博士的观点,不一定代表他的雇主,朋友,家人或相识者的观点。

翻译自: https://medium.com/swlh/whats-under-the-hood-of-a-paired-student-s-t-test-87db028e28b4

独立t检验和配对t检验

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值