ANOVA
既然您已经通过 Levene 检验验证了方差齐性,并且从可视化上评估了对数变换后薪资的大致正态性,现在就可以进行 ANOVA 检验了!回顾一下,ANOVA 的目的是判断生物技术、企业软件和医疗保健公司的平均融资额是否相同。由于这 3 个组满足 ANOVA 的前提条件,您可以确信该检验的结论是有效的。
您之前创建的 DataFrame(biotech_df、enterprise_df 和 health_df)已经为您加载好。pandas(导入为 pd)、NumPy(导入为 np)、Matplotlib(导入为 plt)以及 SciPy 中的 stats 包也都已加载。您在前一练习中计算的融资额对数变换结果也已提供。
本练习是课程的一部分
Python 推断基础
练习说明
- 使用 3 个对数变换后的融资额按以下参数顺序进行单因素 ANOVA 检验:Biotechnology、Enterprise Software、Health Care。
- 当 p 值在 5% 水平上显著时打印结果。
交互式实操练习
通过完成这段示例代码来试试这个练习。
biotech_log_funding = np.log(biotech_df['funding_total_usd'])
enterprise_log_funding = np.log(enterprise_df['funding_total_usd'])
health_log_funding = np.log(health_df['funding_total_usd'])
# Conduct a one-way ANOVA test to compare the log-funding
s, p_value = ____
# Print if the p-value is significant at 5%
____