Topic 5: Hypothesis Testing Flashcards
(36 cards)
What is the simple null vs composite null, and the composite one sided vs 2 sided alternative (2,2)
-H0: θ = θ0 is the simple null
-H0: θ ≤ or ≥ θ0 is the composite null
-H1: θ ≠ θ0 is the composite 2 sided alternative
-H1: θ < or > θ0 is the composite 1 sided alternative
What is a type one error (2)
-A type 1 error is when you reject a true H0 (finding innocent as guilty)
-P(T1 error) = a = significance level (how often you are willing to incorrectly reject the null hypothesis
What is a type 2 error (2)
-A type 2 error is the probability of accepting a false H0 (finding guilty as innocent)
-P(T2 error) = β
What is the power of a test (2)
-The power of a test is the probability of correctly rejecting a false H0
-This is 1 - β
What is the p value (1)
-The probability of getting the result you do with the null hypothesis
What is the decision rule (2)
-If the p value < a, you reject H0, but you don’t reject if the p value > a
-The higher a is, the more liberal you are
What are the 5 steps in a hypothesis test (5)
-Specify the null
-Specify the alternative
-Choose the significance level and corresponding critical region
-Calculate the test order null hypothesis
-Compare the test statistic with the critical value
What is the normal distribution of a sample n with known variance, and how do we standardise this (2)
-x̄ ~ N(µ, σ2/n)
-Z = (x̄ - µ)/√σ2/n
How would you set up the single mean hypothesis test if the distribution is not normal, n > 25 and with a known variance (3)
-Suppose there’s n observations from a non-normal distribution, with unknown mean µ and known variance σ2
-By the CLT (if n > 25) we can say x̄ ~a N(µ, σ2/n)
-We then do the 5 step procedure
How would you set up a single mean hypothesis test with an unknown distribution and unknown variance, and n > 25 (3)
-Suppose there’s n observations from a non-normal distribution, with unknown mean µ and unknown variance σ2, with sample variance estimator S2
-By the CLT (if n > 25) we can say x̄ ~a N(µ, S2/n)
-We then do the 5 step procedure
How do we set up a single mean hypothesis test with a bernoulli distribution and CLT (4)
-Take a bernoulli distribution, where P(X = 1) = π, P(X = 0) = 1 - π
-E(X) = π, V(X) = π(1-π), so E(x̄) = π, V(x̄) = π(1-π)/n (unknown mean and population variance)
-By the CLT with H0: µ = π0, x̄ ~a N(π0, π0(1 - π0)/n)
-Now, the 5 step procedure is the same as before
How do we set up a single mean hypothesis test with a normal distribution and unknown variance (5)
-Suppose n observations from a normal distribution, with unknown σ2 and sample variance estimator S2
-E(x̄) = µ, V(x̄) = σ2/n
-If we then divide the normal standardisation formula with the Chi-squared formula ((n-1)S2/σ2(n-1), this is equal to (X_ - µ)/(S2/√n)
-This approximates to a standard normal distribution/(chi squared with n-1 DoF/n-1) which is the t-ratio
-Hence, we run the five step procedure but with a tn-1 distribution
What is the standardisation process for a t distribution (1)
-(x̄ - µ)/(√S2/n) ~ tn-1
How can we apply the CLT to a t distribution (1)
-For n > 25, the t distribution is approximated by a standard normal distribution
What are the expected value’s and variance when testing for the difference in means (2)
-E(X̄1 - X̄2) = µ1 - µ2
-V(X̄1 - X̄2) = σ21/n1 + σ22/n2
What is the 5-step procedure for testing the difference of means with a normal underlying distribution and known population variances (1,5)
-X̄1 - X̄2 ~ N(µ1 - µ2,σ21/n1 + σ22/n2)
1: H0: µ1 - µ2 = D, so X̄1 - X̄2 ~ N(D,σ21/n1 + σ22/n2)
2: H1: µ1 - µ2 ≠ D
3: The critical values are ± za/2
4: The test statistic is Z = ((x̄1 - x̄2) - D)/√(σ21/n1 + σ22/n2)
5: Decision rule, compare test statistic and critical values
How do we set up an equality of means hypothesis test with a non-normal underlying distribution, known population variance and n>25 (2)
-By the CLT, we can get X̄1 - X̄2 ~aN(µ1 - µ2, σ21/n1 + σ22/n2)
-Then, the 5 step procedure is as usual
How do we set up an equality of means hypothesis test with a non-normal underlying distribution, unknown population variance and n>25 (2)
-By the CLT, we can get X̄1 - X̄2 ~aN(µ1 - µ2, S21/n1 + S22/n2)
-Then, the 5 step procedure is as usual
How would we do an equality of means test coming from a bernoulli distribution where n > 25 (1,5)
-If X1 and X2 come from a bernoulli distribution, then x̄1 - x̄2 ~a N(µ1 - µ2, σ21/n1 + σ22/n2)
The 5 step procedure is hence:
-H0: π1 - π2 = 0 and so under H0 x̄1 - x̄2 ~a N(0, π0(1-π0)/n1 + π0(1-π0)/n2)
-H1: π1 - π2 ≠ 0
-The critical values are +-za/2
-The test statistic is z = (x̄1 - x̄2 - 0)/√(p0(1-p0)(1/n1 + 1/n2), where p0 = (n1x̄1 + n2x̄2)/(n1 + n2)
-Make your decision rule
How would we do an equality of means test if the underlying distribution is normal, and the population variances are unknown, but equal (5,1)
-H0: µ1 - µ2 = D0
-H1: µ1 - µ2 ≠ D0
-The critical values are from a t-distribution, denoted ±ta/2, (n1+n2-2)
-The test statistic is t = ((x̄1 - x̄2) - D0)/√s20(1/n1 + 1/n2), where s20 = ((n1 - 1)s21 + (n2 - 1)s22)/(n1 + n2 - 2)
-Make the decision rule
-Note to use this test you have to prove in a prior test that the population variances aren’t different
How would we do an equality of means test if the underlying distribution is normal, and the population variances are unknown, but not equal (5,1)
-H0: µ1 - µ2 = D0
-H1: µ1 - µ2 ≠ D0
-The critical values are from a t-distribution, denoted ±ta/2, DoF, where DoF = [(s21/n1) + (s22/n2)]2/(((s21/n1)2/(n1-1)) + ((s22/n2)2/(n2-1)))
-The test statistic is t = ((x̄1 - x̄2) - D0)/√(s21/n1 + s22/n2
-Make the decision rule
-Note to use this test, you have had to have proven the population variances aren’t the same
How do we test for a single variance (1,5)
-To formulate a hypothesis for testing the population variance, the distribution of the random variable X must be normally distributed
-H0: σ2 = σ20
-H1: σ2 > σ20
-The critical value is from a χ2 distribution, denoted χ2a, n-1
-The test statistic is (n-1)s2/σ20
-Make the decision rule (reject if TS > CV)
How can we test for the equality of variance (1,5)
-To formulate this test, the distribution of random variables X1 and X2 must be normally distributed
-H0: σ21 = σ22
-H1: σ21 ≠ σ22
-The critical value is from the F distribution, denoted Fa/2n1-1, n2-1
-The test statistic is F = s21/s22 (always put the higher sample standard deviation on the top)
-Make the decision rule (reject if TS > CV)
When do you use matched pairs (3)
-This is to test 2 events which aren’t independent
-Formulating about µ1 - µ2, when X1 and X2 are with the same sample
-Apart from artificial examples, if you can’t get matched pairs, you go as close as possible