Skip to content

Hypothesis Testing allows professionals to test their theories and assumptions before putting them into action. This Repository includes all the Hypothesis test to validate a statement using Empirical data .

License

Notifications You must be signed in to change notification settings

Gourav052003/Advanced-Statistical-Hypothesis-Testing-with-SciPy-and-statsmodels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hypothesis-Testing

Hypothesis Testing allows professionals to test their theories and assumptions before putting them into action. This Repository includes all the Hypothesis test to validate a statement using Empirical data .

ht

Types of Hypothesis Testing

Hypothesis tests are divided into two categories:

  1. Parametric tests – are used when the samples have a normal distribution. In general, samples with a mean of 0 and a variance of 1 follow a normal distribution.

  2. Non-Parametric tests – If the samples do not follow a normal distribution, non-parametric tests are used.

Two types of Hypothesis Testing can be created depending on the number of samples to be compared:

  1. one-Sample – If there is only one sample that must be compared to a specific value, it is called a single sample.

  2. two-Samples – if you’re comparing two or more samples. Correlation and sample difference are two tests that could be used in this situation. Samples can be paired or not in both circumstances. Dependent samples are sometimes known as paired samples, while independent samples are known as unpaired samples. Natural or matched couplings occur in paired samples.

Reasons to use Parametric Tests:

  • Reason 1: Parametric tests can handle skewed and non-normal distributions well.It may come as a surprise, but parametric tests can perform well with non-normal continuous data if the sample size criteria in the table below are followed.

  • Reason 2: When the dispersion of each group is different, parametric tests can perform well. Nonparametric tests don’t require that your data follow a normal distribution, but they do have other requirements that can be difficult to achieve. Whereas nonparametric tests compare data of the groups that must have the same dispersion. Nonparametric tests may not yield accurate results if your groups have a different distribution.

  • Reason 3: Because of the Statistical Power of Parametric Tests. By comparison, it can be seen that Nonparametric tests have less statistical power than parametric tests.

Reasons to use Non-Parametric Tests

  • Reason 1: The median represents your field of study better.The fact that you can run a parametric test on non-normal data doesn’t mean you should.The median, for example, can better measure the centre of a skewed distribution, such as income, when 50% are above and 50% are below the median. Even if the average person’s income remains the same, when a few billionaires are included in a sample, the mathematical mean climbs dramatically. When your distribution is sufficiently skewed, changes far out in the tail have a large impact on the mean, yet the median continues to reflect the distribution’s centre. A random sampling of 100 people from each distribution yields statistically different means, but not significantly different medians for these two distributions.

  • Reason 2: Your sample size is quite small.If you don’t meet the sample size requirements for parametric testing and aren’t confident that your data is normally distributed, you should use a nonparametric test. When your sample size is limited, you may not be able to identify the distribution of your data because distribution tests lack the power to provide meaningful results. You’re in a tight spot with no feasible solutions in this situation. Nonparametric tests have lower power, to begin with, and when you combine that with a small sample size, you have a double whammy!

  • Reason 3: You can’t get rid of your ordinal or ranking data or outliers. Outliers can dramatically influence the outcomes of typical parametric tests, which can only examine continuous data. Some nonparametric tests, on the other hand, can handle ordinal and ranking data while avoiding outliers. Check the nonparametric test assumptions because each one has different data requirements.

Conclusion

The requirement to choose between a parametric and nonparametric test is usually assumed to arise when your data fails to meet a parametric test assumption. When you have a limited sample size and non-normal data, this can happen. However, while parametric tests can typically manage non-normal data, other factors often come into play. Nonparametric tests, on the other hand, have rigid assumptions that you can’t ignore.

Whether you choose the mean or the median to depict the centre of your data’s distribution is typically a deciding factor.

  • Consider a parametric test if the mean adequately represents the centre of your distribution and your sample size is large enough. They are more powerful.

  • Even if you have a big sample, consider the nonparametric test if the median better represents the centre of your distribution.

Finally, if your sample size is exceedingly tiny, you may be forced to use a nonparametric test. If at all feasible, please collect more data next time! As you can see, the sample size requirements aren’t that stringent. When you have a limited sample size and must utilise a less efficient nonparametric test, your chances of identifying a significant effect when one exists can be slim!

About

Hypothesis Testing allows professionals to test their theories and assumptions before putting them into action. This Repository includes all the Hypothesis test to validate a statement using Empirical data .

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published