Final Exam Flashcards
(16 cards)
Type I and Type II error
Type I Error - the probability of rejecting the Null Hypothesis (H0) when it is true. Also called the power, and is equal to 1-Beta (not alpha)
Type II Error - the probability of accepting the Null Hypothesis (H0) when it is true. Also is equal to Beta.
Accept H0 | Reject H0
————|———————-|————–
H0 True | Good |Type I Error
————|———————-|————–
H0 False| Type II Error | Good
pnorm function
N(10,4) –> P(X<9) = pnorm(9,10,2)
N(10,4) –> P(X<k) = 0.75 –> k = qnorm(0.75,10,2)
Z test statistic
Z = [X - mu] / [simga/sqrt(n)]
lower tail = Z_alpha
upper tail = Z_1-alpha
Power Function
Shows the probability of rejecting the Null Hypothesis (H0) for different values (ie. mean)
Maximum value under H0 = alpha
Test Statistic for Variance Testing
Chisq_n-1 = [(n-1)s^2] / simga^2
Pooled Variance
Use when you are given sample variances and you can assume true variances are equal.
sp^2 = [(n1-1)s1^2 + (n2-1)s2^2] / [n1 + n2 - 2]
Example test statistic for difference in means: [mu1 - mu2] / sqrt(sp^2(1/n1 + 1/n2)) = t for small samples
use pt and df = n1 + n2 - 2
F Test Statistic
s1^2/s2^2 where s1 is the larger sample variance
df1 = n1 -1, df2 = n2 - 1
use pf and qf
When are UMP and Best Test the same?
For a simple H_0 and simple H_1, the uniformly most powerful (UMP) test of size alpha is the same as the best test.
UMP Test vs GLRT
UMP Test find the most powerful test for a specific hypothesis (specific values), whereas GLRT will find a test for a range (composite set) of values.
Wilks’ Theorem
For large sample reject H0 if -2ln[lamda(X)] > chisq_alpha,1
always greater than 0 so we use qchisq(alpha,1) NOT qchisq(alpha/2,1) even though it is two tailed
H_0: theta = theta_0, H1: theta (does not equal =) theta_0
Test for Independence & Homogeneity
Chisq test
- two categorical variables
- are they related?
W = Sum (O-E)/E
E = n_row/n_tot * n_col/n_tot * n+tot
qchisq(1-alpha, df) –> df = (n_row-1)*(n_col-1)
pchisq(W, df, lower.tail = FALSE) or 1 - pchisq
Goodness of Fit Test
W = Sum (O-E)/E
df = # categories - 1
P-value for 1 and 2 tailed tests
The p-value for a 2 tailed test is 2pnorm or 2pt
Sample Variance Distribution
[(n-1)S^2] / (simga^2) ~ Chisq(n-1)
S^2 ~ [ (simga^2) / (n-1) ] * Chisq(n-1)
S^2 ~ [ (simga^2) / (n-1) ] * Gamma[(n-1)/2, 1/2]
S^2 ~ Gamma[(n-1)/2, (n-1)/(2sigma^2)]
Exponential Random Variables
The minimum of iid exponential random variables is again exponential.
Goodness of fit p-value
Upper tail only so we want:
1-qchisq OR
pchisq(TS, df, lower.tail = FALSE)