I want to write a method to test multiple hypothesese for a pair of schools . I want to consider all possible pairs of words (Research Thesis Proposal AI Analytics), and test the hypothesis that the words counts differ significantly across the two schools, using the specified alpha (0.05) threshold.
Only need to conduct tests on words that have non-zero values for both schools. I.e., every row and column in the contingency table should sum to >0.
Finally, want to return a tuple with the (i) the total number of tests conducted, and (ii) the number of significant tests.
df:
Names Research Thesis Proposal AI Analytics Data
TAMU 54 0 0 6 5 0
uiuc 33 43 5 0 76 81
USC 4 1 0 7 21 4
UT Austin 22 31 0 0 55 0
UCLA 55 6 7 9 11 12
def school_term_hypotheses(filename,college1, college2, alpha):
df=pd.read_csv(filename)
df=df[(df['Name'] == college1) | (df['Name'] == college2)]
df=df.loc[:, df.ne(0).all()]
df=df.set_index('Unnamed: 0')
#chi,p=chi2_contingency(df)[:2]
#return(p)
school_term_hypotheses("test.csv", 'TAMU','UT Austin' 0.05)
I am clueless what to do after getting a df with non zero values. need some help figuring how do I test multiple hypothesese.