Skip to main content

Inferential Statistics - Hypothesis Testing Part #1


Hypothesis Testing

We have methods to test our hypothesis and these methods can be categorized into two parts.
Parametric Testing: This type of tests make assumptions about the Population parameters and the distributions that the data came from. These types of test includes Student's tests and ANOVA tests, which assume data is from a normal distribution.
Non- parametric Testing: Non-parametric tests are used when there is no or few information available about the population parameters.

Z Test:
To find test statistics, we can use the below formula.



Z test can be done if the below 3 points are satisfied.
1.     Sample size should be > 30.
2.     Population SD should be known.
3.     Variables should be continues.
Steps for Z Test:
1.     State Null & Alternate Hypothesis.
2.     Find the Level of significance (α).
3.     Find Critical Values.
4.     Find test statistic.
5.     Make conclusion.
Example:
1,500 women followed the Atkin’s diet for a month. A random sample of 29 women gained an average of 6.7 pounds. Test the hypothesis that the average weight gain per woman for the month was over 5 pounds. The standard deviation for all women in the group was 7.1.

Given:
Population: 1500
Population SD: 7.1
Sample Size: 29
Sample Mean: 6.7 pounds
To test: Test the hypothesis that the average weight gain per woman for the month was over 5 pounds.
So here the average weight gain of the total population is 5 pounds. So population mean is 5 pounds. We need to test the hypothesis that average weight is above 5 pounds.
Obviously our Null hypothesis is µ > 5 pounds.
If we reject the null hypothesis then it means the sample average weight gained is close to or less than the population average weight gained.
Step #1:
i.e. H0: µ > 5
As H0 > 5, our alternate hypothesis is the opposite of Null Hypothesis.
Here H1 <= 5

Step #2: Level of Significance
As the confidence/significance level is not given then we can consider it as 95% confidence level.
C = 0.95
α = 1 – 0.95 = 0.05

Step #3: Critical Value for 95% confidence level α is 1.645.

Step #4:
The Sample mean – population mean = 6.7 – 5 = 1.7
σ /√n = 7.1/√29 = 7.1/5.38 = 1.3197
z = 1.289 which is < 1.645

Step #5: Conclusion
As the z value is less than critical value, the z value falls in accept region.

So we accept the Null Hypothesis.


T Test or Students T Test:
If the sample size is <30 i.e. n<30 then those samples are considered as small samples.
The methods used for small samples can be used with large samples. But the vice versa is not appropriate.
Per Central Limit Theorem, the distribution will become normal when the sample size increases.
With a small sample the distribution may not be normal, even if it looks normal it is not more like a bell curve as a normal distribution.
When sample size is 30 or less than 30 and the population SD is unknown, then we can use the t-distribution.

Conventions of T Test:
1.     The population from which the samples are drawn is normal
2.     Sample is random.
3.     Population SD is not known.
Applications of t-test:
1.     Test of hypothesis about population mean.
2.     Test the hypothesis about the difference between two means.
3.     Test the hypothesis about coefficient of correlation.

Formula:
To find the interval: ẍ ± t-table value * (s/√n)
To test the hypothesis: (ẍ - 𝛍)/(s/√n)

Example:
A company wants to improve sales. Past sales data indicate that the average sale was $100 per transaction. After training the company’s sales force, recent sales data (taken from a sample of 25 salesmen) indicates an average sale of $130, with a standard deviation of $15. Did the training work? Test your hypothesis at a 5% alpha level.

Step #1:
H0: µ = 100
H1: µ > 100

Step #2:
Level of significance α = 0.05

Step #3:
x̄ = $130.
μ = $100
sample standard deviation(s) = $15.
Sample Size (n) = 25.

Find the t-table value.
Look up 24 degrees of freedom in the left column and 0.05 in the top row. The intersection is 1.711.This is your one-tailed critical t-value.


T value is 1.711.

Step #4:
(130 – 100) / (15/RootOf 25)
= 30/3 = 10

Step #5:
The calculated value is greater than T value 1.711

Conclusion: We fail to accept the null hypothesis.


Comments

Popular posts from this blog

Inferential Statistics - An Introduction

Inferential Statistics                                          An Introduction Inferential statistics helps us to predict/inference from the data. Population: Population is a set of data on which we need to infer. Sample: Sample is a subset of data which is drawn from Population. Parameter: The measures we made on population data are called Parameter. Statistic: The measures we made on Sample data are called Statistic. Population Parameter Sample Statistic Mean – μ Mean – x Variance – σ² Variance – s² Standard Deviation - σ Standard Deviation – s Standard Error: Per CLT, the mean of each sample’s mean will reflect the population mean. In the sampling distribution, the variance between all the sample means from the mean is referred as Standard Error. S.E = σ / √n     ...

Inferential Statistics - Degrees Of Freedom

Degrees Of Freedom: Degrees of freedom refers to the maximum number of logically independent values in a data sample which have the freedom to vary within. Example: If there is a sample of 3 values {5, x, 15} and the mean of all the values is 10. Now it is easy to say that the value of x would be 10 as the mean of these 3 values is 10. But if 2 values from this sample are not known, say {5, x, y} with same mean 10, then we are now cannot be sure about the exact values of x & y. It could be any values from (10, 15), (15, 10), (5, 20), (20, 5) or even (1, 24). So we cannot determine the exact value of these data x & y. These 2 values has a freedom to vary. But the third value do not have the freedom to change as it has to be some value so that the mean will not change. So this value depends upon all the other values. So the degrees of freedom of this sample data of size 3 is 2. Not only with size 3 sample, a sample with any size we can determine onl...