How to know which Statistical Test to use for Hypothesis Testing? | by Satyam Kumar | Towards Data Science

Statistics is an integral part of Data Science and Machine Learning. Statistics is a subfield of mathematics that refers to the formalization of relationships between variables in the form of mathematical equations. It tries to find relationships between variables to predict the outcomes. Statistics is all about, involving the study of collection analysis, interpretation, presentation, and organization.
There is a lot of statistical tests, to measure the relationship within or between variables. During a data science project, often a question arises in Data Scientist’s mind, that which statistical techniques to use for what kind of data or variables and when. In this article, you can read about a basic understanding of several types of statistical tests and when and how to use them for your dataset.
One sample test is a statistical procedure considering the analysis of one column or feature. It can be a percentage distribution analysis (categorical variable) or mean analysis (continuous variable).
On the other hand, a two-sample test is a statistical procedure to compare or calculate the relationship between two random variables.
As discussed above, a one-sample test involves hypothesis testing of one random variable.
One sample T-test for Mean: For a numerical or continuous variable, you can use a one-sample T-test for Mean, to test that where your population means is different than a constant value. For example, A MNC is interested to test the mean age of their employees is 30. They can use the one-sample t-test to get the result.
Here, t-stat follows a t-distribution having n-1 DOFx̅: mean of the sampleμ: mean of the populationS: Sample standard deviationn: number of observations
One sample T-test for Proportion: One sample proportion test is used to estimate the proportion of the population. For categorical variables, you can use a one-sample t-test for proportion to test the distribution of categories.
p̂: Observed probability of one certain outcome occurringp0: hypothesized probabilityn: number of trials.
In hypothesis testing, a two-sample test is performed on the data of two random variables, each obtained from an independent population. The test can be used to test the statistically significant difference between the two samples.
Once you figure out the purpose and datatype of your random variable, there are basically 3broad categories of datatype combinations:
Two Continuous variables
One Continuous and another Categorical variable
Two Categorical variables
When your experiment is trying to find a relationship between two continuous variables, you can use correlation statistical tests.
Pearson Correlation is a statistical technique used to measure the degree of relationships between two linearly related variables. The value of its coefficient ranges between [1, -1], whether 1 denoted positively correlated, -1 denotes negatively correlated, and 0 denotes no correlation.
Spearman Rank correlation between two random variables is equal to the Pearson correlation between the rank values of the two variables. It can be used to measure the monotonic relationship between two continuous random variables. The value of its coefficient ranges between [1, -1], whether 1 denoted positively correlated, -1 denotes negatively correlated, and 0 denotes no correlation.
When your experiment is trying to draw a comparison or find the difference between one categorical (with two categories) and another continuous variable, then you need to work on the two-sample T-test, to find the significant difference between the two variables.
When your experiment is trying to draw a comparison or find the difference between one categorical (with more than two categories) and another continuous variable, then you use the ANOVA (Analysis of Variance) test.
When your experiment is trying to draw a comparison or find the difference between the two categorical random variables, then you can use the chi-square test, to test the statistical difference.
In this article, we have discussed statistical techniques, and when to use what test to derive relationships or conclusions between or within random variables. Using the above discussed statistical techniques you can access the impact of one variable onto the other variable.
Correlation between two continuous variables is used to measure their relationships. All the other statistical tests can be used to draw a comparison between the two random variables, and the p-value can be used to accept or reject the null hypothesis.
[1] Statistics Solutions: https://www.statisticssolutions.com/correlation-pearson-kendall-spearman/
Loved the article? Become a Medium member to continue learning without limits. I’ll receive a small portion of your membership fee if you use the following link, with no extra cost to you.
satyam-kumar.medium.com
Thank You for Reading