I am using a dataset and taking input dataframe df. I am doing a hypothesis testing that for all features male and female mean are same. I am doing 2 sample z statistic. I am doing the following:

  1. select features whose skewness is between -0.5 and 0.5 to have moderate normally distributed features
  2. among the selected features calculating z-statistic to check null hypothesis, for p=0.05, using critical value of 1.96, 2 tailed tests.

Problem is when I am testing I am having absolute z statistic over 10,12 which is much higher than 1.96 so, null hypothesis is rejected. But even after step 1, how such large z statistics are possible.

def z_test(self, df, threshold_val=1.96, show_top=1):
                1. sample size=population size
                2. normal distribution
            df=dataframe of numerical features
            threshold_val= z score of 1.96 for 95% confidence(p<0.05)
    return z_scores[z_scores.abs()>threshold_val]

something like these are z scores that reject the null hypothesis: 1st column feature name, 2nd column is 2 sample z scores :

enter image description here

My question is this correct? One thing is that I have already limited the skewness between -0.5 to 0.5 so these features are not largely skewed or anything, but still getting values over 16, how? Even this will suffice if results are ok, meaning testing is correct and just beating null hypothesis by large margin?

  • $\begingroup$ It just means that you have a tiny p-value. What does skewness have to do with that? // It might help to ask another question about what you’re trying to do overall with the analysis of features for males and females. $\endgroup$
    – Dave
    Oct 9 at 13:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.