查看: 5561| 回复: 9
跳转到指定楼层
上一主题 下一主题
收起左侧

[数学应数] 请教t-test vs. f-test, 请地里大牛解迷惑

全局:

注册一亩三分地论坛,查看更多干货!

您需要 登录 才可以下载或查看附件。没有帐号?注册账号

x
最近FB面经里面看到有这么一个问题What is the difference between t-test and f-test? Do we need to do F-test if t-test is done?

对于第一问,Google的解答是:t-test is used to test if two sample have the same mean. The assumptions are that they are samples from normal distribution. f-test is used to test if two sample have the same variance. 1point 3 acres

这个看似很简单明了。但是关于第二问,似乎答案不是那么简单。那么我就看了Youtube StatQuest的一个视频:
https://www.youtube.com/watch?v=NF5_btOaCig 这个看起来t test可以用f test解决。看下面的评论有人说 It actually takes me a while to realize the F-statistic shown in this video is the same as standard T-statistics. Great vid! 然后StatQuest本人回答是I know, it's a little weird to look at a t-test from this perspective, but it shows how the F-statistic is a generalization of T-statistics. (Here's a cool hint - just like the F-statistic is a generalization of T-statistics, Chi-square statistics are a generalization of normal statistics....)

那么问题来了,如果可以用f-test解决t-test, 为什么还有t-test? 。。。
. 1point3acres
求大神解答啊!愿意给好的解答奖励大米。提前谢啦!

上一篇:data science方向online degree求推荐
下一篇:有人最近在北美考了SAS ADV的吗 预约考试怎么搜不到
全局:
我觉得这两个问题太笼统了。

单纯回答第一问,ttest ftest不一样当然是因为一个test statistic follows t distribution另一个follows f distribution. 这是最直接的答案。  
.1point3acres
楼主搜索的第一问答案明显假定 ttest说的是2sample ttest 而ftest 也是用来比较两个sample的。 但是ttest ftest不单单在比较两个sample方面。比如ttest还有 one sample ttest. Ftest还有ANOVA里的应用。同时ttest不是必须假定sample服从正态分布的,只需要sample mean服从正态分布就行了。所以才有中心极限定理的应用。

这个问题如果假定是比较两个sample.那么一般的情况是,你要先选择做equal variance的ttest还是unequal variance的ttest. 那么这个时候要先比较一下两个sample 是不是from population with same variance. 这个时候用的ftest. 之后从两个不同结果可以选择做equal或者unequal variance ttest. Unequal好像是叫welch's test. 一般default都是welch因为不会先假设equal variance.
.--
如果你考虑检测association between a continuous variable and a binary variable的话 t test和anova都可以。你可以用ttest检测这个关系也可以用anova的f test检测这个东西。 你会发现equal variance ttest和anova的ftest会return same p values. 因为f test 的 test statistic 就是ttest的test statistic的平方。这个时候你是不是可以说这两个一样了呢?

总而言之。笼统的从统计上看这个问题 没有什么意义。 如果是从比较两个sample的角度,可能还有点可以说的。但是从比较两个sample的角度 考虑anova的话, 这两个ttest还是可以认为是一样的。所以我认为这个问题提的没什么技术含量和参考价值。

评分

参与人数 6大米 +6 收起 理由
梦想家510 + 1 很有用的信息!
ohlalalalala + 1 赞一个!
poppincharlie + 1 赞一个
tonyke930 + 1 给你点个赞!
wzmg + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

推荐
Coooonnie 2020-8-2 05:28:53 | 只看该作者
全局:
F test is to answer 'Is there a relationship between the response and predictors' Ha is 'At lease one coefficient is non-zero'.
T- test is test of significance of an individual coefficient.

第二问是必须的。 因为我记得multicolinearity 的一种很有可能出现的情况就是overall F test is significant but each of the individual t tests are not.

评分

参与人数 1大米 +1 收起 理由
tonyke930 + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
 楼主| tonyke930 2020-8-2 05:19:59 | 只看该作者
全局:
自己找到解答了:视频下面讨论区有。哈哈~
回复

使用道具 举报

🔗
hypnoz 2020-8-2 10:00:01 | 只看该作者
本楼:
全局:
MARK一下
回复

使用道具 举报

🔗
 楼主| tonyke930 2020-8-2 14:35:35 | 只看该作者
全局:
UBSHY 发表于 2020-8-2 12:55
我觉得这两个问题太笼统了。
. .и
单纯回答第一问,ttest ftest不一样当然是因为一个test statistic follows t  ...
-baidu 1point3acres
谢谢详细解答!很清楚了!
回复

使用道具 举报

🔗
 楼主| tonyke930 2020-8-2 14:37:09 | 只看该作者
全局:
Coooonnie 发表于 2020-8-2 05:28.google  и
F test is to answer 'Is there a relationship between the response and predictors' Ha is 'At lease on ...

有道理, 学习了
回复

使用道具 举报

全局:
其实就是AB testing的基础常见问题,记住F test 检查两组数的Variance。但是我一般直接做santiy check看CI. T two sample test看两组数是否有显著性差异。

评分

参与人数 1大米 +1 收起 理由
tonyke930 + 1 给你点个赞!

查看全部评分

回复

使用道具 举报

🔗
 楼主| tonyke930 2020-8-2 23:25:39 来自APP | 只看该作者
全局:
yyviolin 发表于 2020-08-02 06:32:07
其实就是AB testing的基础常见问题,记住F test 检查两组数的Variance。但是我一般直接做santiy check看CI. T two sample test看两组数是否有显著性差异
这个回复也有道理!想顺着这个展开来问问这么学习AB testing应付面试。我自己学习过Udacity的那门AB testing课,也学过Lisa Qian的AB testing from DS perspective. 但是查了一下笔记没有记得有关于两组variance比较...对于这种基础问题,请问您是怎么进行准备的?提前谢谢
回复

使用道具 举报

全局:
谢谢分享学到了 zszsasz
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册账号
隐私提醒:
  • ☑ 禁止发布广告,拉群,贴个人联系方式:找人请去🔗同学同事飞友,拉群请去🔗拉群结伴,广告请去🔗跳蚤市场,和 🔗租房广告|找室友
  • ☑ 论坛内容在发帖 30 分钟内可以编辑,过后则不能删帖。为防止被骚扰甚至人肉,不要公开留微信等联系方式,如有需求请以论坛私信方式发送。
  • ☑ 干货版块可免费使用 🔗超级匿名:面经(美国面经、中国面经、数科面经、PM面经),抖包袱(美国、中国)和录取汇报、定位选校版
  • ☑ 查阅全站 🔗各种匿名方法

本版积分规则

>
快速回复 返回顶部 返回列表