LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Foundations of Inference in Python

Kurs anzeigen

Anleitung zur Übung

  • Select the funding for each market individually from investments_df using 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, and statistic3, respectively.
  • In each case, return a Boolean that indicates whether the null hypothesis of equal variance is rejected.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# 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(____)
Code bearbeiten und ausführen