Module functions.matrixmixer.significances

Functions

def alpha_two_to_one_tailed(alpha: float)

corrects alpha level for a one sided t-test by halfing it

Args

alpha : float
two-tailed alpha level

Returns

float
one-tailed alpha level
def bonferroni_correction(n: int, alpha: float)

Perform Bonferroni correction on p-values.

Parameters: n (int): number of tests performed alpha (float): Desired family-wise error rate.

Returns: corrected_alpha (float): Corrected significance level after Bonferroni correction.

def find_nominal_significances(table: dict, break_object: dict, code: int, break_value_labels: dict, alpha: float)

finds all significanes of a nominal variable, sets all variables for the dictionaries objects

Args

table : dict
table object to add significances to
break_object : dict
break object to add significances to
code : int
code of the answer
break_value_labels : dict
value labels of the break
alpha : float, optional
significance level. Defaults to 0.05.
def find_ordinal_significances(table: dict, break_object: dict, break_value_labels: dict, alpha: float)

finds all significanes of a ordinal or scale variable, sets all variables for the dictionaries objects

Args

table : dict
table object to add significances to
break_object : dict
break object to add significances to
break_value_labels : dict
value labels of the break
alpha : float, optional
significance level. Defaults to 0.05.
def manual_ttest_ind(arr1: , arr2: ) ‑> Tuple[float, float]

performs manual t-test statistic calculation for two arrays of data

Args

arr1 : np.array
array of sample 1
arr2 : np.array
array of sample 2

Returns

tuple(t_stat, p_value): returns the t-statistic as well as the p-value

def manual_ztest_prop(p1: float, n1: float, p2: float, n2: float) ‑> Tuple[float, float]

performs manual z-test statistic calculation for two samples

Args

p1 : float
proportion sample 1
n1 : float
size sample 1
p2 : float
proportion sample 2
n2 : float
size sample 2

Returns

tuple(z_stat, p_value): returns the z-statistic as well as the p-value