-
Graphing Data 4
-
Lecture1.1
-
Lecture1.2
-
Lecture1.3
-
Lecture1.4
-
-
Mean and Standard Deviation 5
-
Lecture2.1
-
Lecture2.2
-
Lecture2.3
-
Lecture2.4
-
Lecture2.5
-
-
Distributions 6
-
Lecture3.1
-
Lecture3.2
-
Lecture3.3
-
Lecture3.4
-
Lecture3.5
-
Lecture3.6
-
-
Correlation and Linear Regression 7
-
Lecture4.1
-
Lecture4.2
-
Lecture4.3
-
Lecture4.4
-
Lecture4.5
-
Lecture4.6
-
Lecture4.7
-
-
Probability 3
-
Lecture5.1
-
Lecture5.2
-
Lecture5.3
-
-
Counting Principles 3
-
Lecture6.1
-
Lecture6.2
-
Lecture6.3
-
-
Binomial Distribution 3
-
Lecture7.1
-
Lecture7.2
-
Lecture7.3
-
-
Confidence Interval 7
-
Lecture8.1
-
Lecture8.2
-
Lecture8.3
-
Lecture8.4
-
Lecture8.5
-
Lecture8.6
-
Lecture8.7
-
-
Proportion Confidence Interval 3
-
Lecture9.1
-
Lecture9.2
-
Lecture9.3
-
-
Hypothesis Testing 5
-
Lecture10.1
-
Lecture10.2
-
Lecture10.3
-
Lecture10.4
-
Lecture10.5
-
-
Comparing Two Means 5
-
Lecture11.1
-
Lecture11.2
-
Lecture11.3
-
Lecture11.4
-
Lecture11.5
-
-
Chi-squared Test 3
-
Lecture12.1
-
Lecture12.2
-
Lecture12.3
-
The Null Hypothesis Part 2
Solution
import numpy as np
mean = np.mean(pts)
std = np.std(pts)
t = (mean-400)/(std/len(pts)**.5)
print(t)
By applying the formula, we can get the t value to use. If we want the bounds….
SE = std/(len(pts)**.5)
bounds = (mean-SE*t,mean+SE*t)
print(bounds)
Notice that the left side of the bound is 400, which is equal to the null hypothesis. Let’s find a confidence level from this t-score. If we want to turn a z or t score into the percentage under it, we can use scipy.stats.norm.cdf(). We will get the cdf for -t, and from there we can get the percentage under the curve.
(.5-scipy.stats.norm.cdf(-t))*2
So here we say that the percentage likelihood that the null hypothesis is not true is a little over 50%. This isn’t a great percent, usually we would want it to be 95% or 99%.
What about a null hypothesis of a mean of 385?
t = (mean-385)/(std/len(pts)**.5)
print(t)
print((.5-scipy.stats.norm.cdf(-t))*2)
Now, we can see that the t value is higher, we are a lot more certain that 385 is not the true mean. We are about 98% sure that the true mean is something different.