4.2 Hypothesis Tests - T-Test Flashcards
chi-squared distribution, t-distribution, two-sided t-test, one-sided t-test, large sample size, two-sample t-test, p-values
What is the t-test used for?
-in situations where the exact variance of observed samples is unknown, we can test the hypothesis Ho:μ=μo against the alternative H1:μ≠μo using the test statistic |t|
Two Sided T-Test Test Statistic |t|
Definition
|t| = 1/√n * Σ (xi-μo)/σx^
- where σx^ is the sample standard deviation
- since σx^ is not a constant bu depends on the data, even if we compute the t from samples which follow a normal distribution, the t value itself will not be normally distributed
T-Test
Defintion
- the t-test rejects Ho:μ=μo if |t|>c for a critical value c
- before we can use the t-test, we need to choose a value of c that will keep the probability of type I errors below α
What do we use to derive the critical values for the t-test?
-the chi-squared probability distribution
Chi-Squared Distribution
Definition
- let X1,…,Xv ~ N(0,1) be i.i.d
- then the distribution of ΣXi² is called the χ²-distribution with v degrees of freedom, the sum is taken from i=1 to i=v
- the distribution is denoted by χ²(v)
Chi-Squared Distribution
Expectation and Variance Lemma
-let Y~χ²(v), then:
E(Y) = v
and:
Var(Y) = 2v
Chi-Squared Distribution
Expectation and Variance Lemma Proof
-write Y as the sum of X1,…,Xn~N(0,1) squared
CDF of the Chi-Squared Distribution in R
-the R command:
pchisq(x,v)
-gives the value Ф(x) of the CDF of the χ²(v) distribution
α-Quantile of the Chi-Squared Distribution in R
-the R command:
qchisq(α,v)
-can be used to obtain the α-quantile of the χ²(v) distribution
Chi-Squared Theorem
-let X1,…,Xn~N(μ,σ² ) i.i.d. and consider:
Y = Σ (Xi,X_)² /σ²
-where the sum is taken from i=1 to i=n and X_ is the sample average of Xi
-then:
a) Y~χ²(n-1)
b) the random variables X_ and Y are independent
T-Distribution
Definition
-let Z~N(0,1) and Y~χ²(v) be independent
-then the distribution of:
T = Z / √(Y/v)
-is called the t-distribution with v degrees of freedom
-this distribution is denoted by t(v)
T-Test Sample of Xi Random Variables Normally Distributed Lemma
-let X1,…,Xn~N(μ,σ²), and let:
T = 1/√n * Σ (Xi-μo)/σx^
-where σx^ is the sample standard deviation of Xi
-then T~t(n-1)
CDF of the T-Distribution in R
-the R command pt(x,v) gives the value Ф(x) of the CDF of the t(v)-distribution
α-Quantile of the T-Distribution in R
-the R command qt(x,v) gives the value α-quantile the t(v)-distribution
Two-Sided T-Test
Description
-let x1,…,xn be observations of Xi~N(μ,σ²) with unknown variance σ² and assume that we want to test Ho:μ=μo against H1:μ≠μo