power¶
-
hyppo.tools.power(test, sim_type, sim=None, n=100, alpha=0.05, reps=1000, auto=False, **kwargs)¶ Computes empircal power for hypothesis tests
- Parameters
test (
strorlist) -- The name of the independence test (from thehyppo.independencemodule, thehyppo.d_variatemodule, or thehyppo.conditionalmodule) that is to be tested. If MaxMargin, accepts list with first entry "MaxMargin" and second entry the name of another independence test. Forhyppo.ksample.KSampleput the name of the independence test. For other tests inhyppo.ksamplejust use the name of the class.sim_type (
"indep","ksamp","gauss","multi","condi") -- Type of power method to calculate. Depends on the type ofsim.sim (
str, default:None) -- The name of the independence simulation (from thehyppo.toolsmodule). that is to be used. Set toNoneif using Gaussian simulation curve.n (
int, default:100) -- The number of samples desired by the simulation (>= 5).alpha (
float, default:0.05) -- The alpha level of the test.reps (
int, default:1000) -- The number of replications used to estimate the null distribution when using the permutation test used to calculate the p-value.auto (
bool, default:False) -- Automatically uses fast approximation when n and size of array is greater than 20 or test has a non-permutation based p-value. IfTrue, and sample size is greater than 20, thenhyppo.tools.chi2_approxwill be run.repsis irrelevant in this case. See documentation fortestif this parameter applies.**kwargs -- Additional keyword arguements for
sim.
- Returns
empirical_power (
ndarrayoffloat) -- Estimated empirical power for the test.