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.

nobsndarray

Number of observations for the samples.

equiv_marginfloat

Equivalence margin in terms of effect size. Effect size can be chosen with margin_type. default is squared Cohen’s f.

vars_array_like or None

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_mcint

Number of Monte Carlo replications.

trim_fracfloat in [0, 0.5)

Optional trimming for Anova with trimmed mean and winsorized variances, see trim_frac in anova_oneway.

options_varlist of str or None

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” or “wellek”

Type of effect size used for equivalence margin.

rng{None, int, array_like[int], numpy.random.Generator, numpy.random.RandomState}, optional

If rng is None, a new Generator is created using fresh entropy from the operating system. If rng is an int or array of ints, a new Generator is created, seeded with rng. If rng is already a Generator or RandomState instance, that instance is used.

Returns:
resHolder instance

Holder instance 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.