I have a dataset with several independent variables and few dependent variables I'd like to run multiple t-tests with. All my independent are dummies, whereas my dependent vars are numeric.
I wrote the following loop:
for ind in df[['ind1','ind2', 'ind3','ind4','ind5']]:
for dep in df[['dep1', 'dep2', 'dep3', 'dep4']]:
cat1 = df[df[ind]==1][dep]
cat2 = df[df[ind]==0][dep]
print(ttest_ind(cat1, cat2, equal_var=False))
I run the code but the script does not print the result (not sure why..). Also, I would like to store the difference and the p-values in a dataframe so to graph them later.. how to do it? thanks!