statsmodels.stats.oneway.simulate_power_equivalence_oneway#
- statsmodels.stats.oneway.simulate_power_equivalence_oneway(means, nobs, equiv_margin, vars_=None, k_mc=1000, trim_frac=0, options_var=None, margin_type='f2', rng=None)[source]#
Simulate Power for oneway equivalence test (Wellek’s Anova)
This function is experimental and written to evaluate asymptotic power function. This function will change without backwards compatibility constraints. The only part that is stable is pvalue attribute in results.
Effect size for equivalence margin.
- Parameters:
- meansarray_like
Mean of samples to be compared. Currently only four groups are supported.
- nobs
ndarray Number of observations for the samples.
- equiv_margin
float Equivalence margin in terms of effect size. Effect size can be chosen with margin_type. default is squared Cohen’s f.
- vars_array_like,
optional Variances of the samples used to simulate the data. If None, then unit variance, i.e., standard deviation equal to 1, is used for all samples.
- k_mc
int,optional Number of Monte Carlo replications.
- trim_frac
floatin[0, 0.5),optional Optional trimming for Anova with trimmed mean and winsorized variances, see trim_frac in anova_oneway.
- options_var
listofstr,optional List of use_var options that are used in the loop over Monte Carlo replications. If None, then
["unequal", "equal", "bf"]is used.- margin_type{“f2”, “wellek”},
optional Type of effect size used for equivalence margin.
- rng
int, array_likeofint,numpy.random.Generator,numpy.random.RandomState,optional If rng is None, a new
Generatoris created using fresh entropy from the operating system. If rng is an int or array of ints, a newGeneratoris created, seeded with rng. If rng is already aGeneratororRandomStateinstance, that instance is used.
- Returns:
SimulatePowerEquivalenceResultNamedtuple with Monte Carlo results in the attributes f_stat, other, pvalue and reject, each an ndarray with one row per Monte Carlo replication and one column per entry in options_var.