iArt.test

iArt.test(*, Z, X, Y, G='iterative+linear', S=None, L=10000, threshold_covariate_median_imputation=0.1, randomization_design='strata', verbose=False, covariate_adjustment=0, random_state=None, alternative='greater', alpha=0.05)

Imputation-Assisted Randomization Tests (iArt) for testing the null hypothesis that the treatment has no effect on the outcome.

Parameters

Zarray_like

Z is the array of observed treatment indicators

X, Yarray_like

X is 2D array of observed covariates, Y is 2D array of observed outcomes,

Sarray_like, default: None

S is the array of observed strata indicators

threshold_covariate_median_imputationfloat, default: 0.1

The threshhold for missing covariate to be imputed with median in advance for performance improvement

Gstr or function, default: ‘iterative+linear’

A string for the eight available choice or a function that takes (Z, M, Y_k) as input and returns the imputed complete values

Lint, default: 10000

The number of Monte Carlo simulations

randomization_design{‘strata’,’cluster’}, default: ‘strata’

A string indicating the randomization design

verbosebool, default: False

A boolean indicating whether to print training start and end

covarite_adjustmentint, default: 0

if 0, covariate adjustment is not used if linear, linear covariate adjustment is used if xgboost, xgboost covariate adjustment is used if lightgbm, lightgbm covariate adjustment is used

random_state{None, int, numpy.random.Generator,`numpy.random.RandomState`}, default: None

If seed is None (or np.random), the numpy.random.RandomState singleton is used. If seed is an int, a new RandomState instance is used, seeded with seed. If seed is already a Generator or RandomState instance then that instance is used.

alternative{‘greater’,’less’,’two-sided’}, default: ‘greater’

A string indicating the alternative hypothesis

alphafloat, default: 0.05

Significance level

Returns

p_valuesarray_like

1D array of p-values for lenY outcomes

rejectarray_like

A boolean indicating whether the null hypothesis is rejected for each outcome