I want to estimate the needed sample size to compute a Chi Squared (Test for homogenity) test for discrete data using Python and need a hint how to do it.
In general I want to estimate if the failure rates of two production processes differ significantly (alpha = 5%) or not.
I have only found the statsmodels.stats.gof.chisquare_effectsize() function but this seems to work only for a goodness of fit test.
Is there any way how I can determine the needed sample size?
I appreciate every answer.
You can use statsmodels.stats.GofChisquarePower().solve_power() However, you need to adjust the degrees of freedom (df) to account for the number of variables. You can accomplish this with the n_bins parameter.
115.94688728433769