Applied Statistics: Inferential Statistics
Inferential statistics is something that is very important and essential for Machine Learning. Descriptive statistics gives an in-depth idea about the data, but the decision-making algorithms for Machine Learning are all built upon inferential statistics. Concept of Hypothesis testing is something that actually is helpful to predict future outcomes.
Before we dive deep into the Hypothesis
testing let us understand some concepts:
Concept of Sampling Distribution:
To analyze the sample and make inferences
about the population is the main purpose of Sampling Distribution.
Sampling Distribution: Distribution of a
particular sample statistic of all possible samples that can be drawn from a
population.
Central Limit theorem:
· If n samples are drawn from a population that has a mean and standard deviation then the sampling distribution follows a normal distribution.
· Corresponding Z-score transformation would be as shown below:
· If the population is normal, this holds true even for smaller sample sizes.
· However, if the population is not normal, this holds true for sufficiently large sample sizes.
· Sampling Distribution of the mean of any independent random variable will be normal.
· This applies to both discrete and continuous distributions.
· The random variable should have a well-defined mean and variance.
· Applicable even when the original variable is not normally distributed
· Assumption 1: The data must be randomly sampled
· Assumption 2: The sample values must be independent of each other.
· Assumption 3: The 10% condition: When the sample is drawn without replacement, the sample size n, should be no more than 10% of the population.
Hypothesis:
A Hypothesis is an unproven proposition or supposition that tentatively explains certain facts or phenomena.
For a population, a hypothesis can be very well defined as follows:
Let us consider
an example of the formulation of the Hypothesis:
Coca-Cola’s
most selling product is 600ml coke and since 600ml info is on the label we
assume it to be true. But is it actually true?
Steps for this example
in the formulation of the Hypothesis:
- Collect 100 bottles from all over the country, so that we have a random sample.
- Measure volume of each bottle in the sample to find the mean of 100 bottles.
- Use sample mean to test assumption (status quo, this being the key in making the inferences about the population from the sample).
When formulating Hypothesis:
Negative: Am I testing a status quo that already exists? This is the Null hypothesis, where there is the negation of the research question. Always contains equality, =, >=, <=
Positive: Am I testing an assumption or claim, that is something beyond what I know? This is the alternate hypothesis, where there is a research question to be proven. Doesn’t contain equality, !=, <, >
Null and Alternative Hypothesis: All statistical conclusions are made in reference to the null hypothesis. We either reject the null hypothesis or fail to reject the null hypothesis. We do not accept the null hypothesis. From the start, we assume the null hypothesis to be true, later the assumption is rejected or we fail to reject it.
When we reject the hypothesis, we can conclude that the alternative hypothesis is supported.
If we fail to reject the null hypothesis, it does not mean that we have proven the null hypothesis is true. Failure to reject the null hypothesis doesn’t equate to proving that it is true. It just holds up our assumptions or the status quo.
Type 1 and Type 2 errors:
H0 = Hypothesis
In simple terms, we can
consider an example of a criminal. In the court of law, there is only a consideration
if the criminal is guilty or not guilty. If the criminal is guilty, he is guilty.
If he is not guilty then it doesn’t mean that he is innocent. This is what we can relate to the null hypothesis.
Also, if the criminal is innocent, he is innocent, he is innocent. If he is not
innocent doesn’t mean he is guilty. Court of law protects the innocent. It is
considered that an innocent person shouldn’t be punished. This is important
than the not guilty case. Type 1 error is the same as an innocent person sent to jail
and type 2 error is like the person is guilty and set free. It is more important, that type 1 error is more important than type 2.
If the probability of
making a type 1 error is determined by “α”, the probability of a type 2 error
is “β”. Beta depends on the power of the test (i.e the probability of not
committing a type 2 error, which is equal to 1-β).
Type 1 error = Confidence
level = 1 – α
Type 2 error = Power of
test = 1 – β
If α = 5%, that means it
is a good hypothesis test so the hypothesis will be 100 – 5 = 95%
Similarly, the Power of the test
is the ability to fail to reject.
Steps in Hypothesis
testing:
- Before data collection, develop a clear research problem.
- Before data collection, establish both null and alternate hypothesis
- Before data collection, determine appropriate statistical test
- Before data collection, choose type1 and error rate α. His could be assumed to be 0.05 unless specified.
- Before data collection, state the decision rule: When to reject the null hypothesis
- Now gather the sample data
- Calculate test statistic
- State statistical conclusion based on the p-value
- Make inference based on conclusions (If p-value is low, the null hypothesis is rejected)









Comments
Post a Comment