Equal variance
Different industries have different levels of investment from venture capitalists (VCs). However, if you look at a sample of VC investments and see slightly different average investment amounts, is it reasonable to assume this difference is statistically significant? This is a perfect situation for ANOVA. However, a key condition for ANOVA is equal variance between all groups of samples. In this exercise you'll test for that using the Levene test of equal variance.
A pandas DataFrame of investments of three industries (Biotechnology, Enterprise Software and Health Care) has been loaded for you in investments_df. The packages pandas as pd, NumPy as np, Matplotlib as plt, and the stats package from SciPy have all been loaded as well.
本练习是课程的一部分
Foundations of Inference in Python
练习说明
- Select the funding for each
marketindividually frominvestments_dfusing the column names given. - Conduct Levene tests for equal variance between each pair of industries, in the following order: (i) Biotechnology and Enterprise Software, (ii) Biotechnology and Health Care, and (iii) Enterprise Software and Health Care, corresponding to
statistic1,statistic2, andstatistic3, respectively. - In each case, return a Boolean that indicates whether the null hypothesis of equal variance is rejected.
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Select each industry separately
biotech_df = ____
enterprise_df = ____
health_df = ____
# Conduct Levene tests for equal variance between funding_total_usd for all pairs of industries
statistic_1, p_value_1 = ____
statistic_2, p_value_2 = ____
statistic_3, p_value_3 = ____
# Print if the p-value is significant at the 5% level
print(____)
print(____)
print(____)