Skip to content
1 hidden cell
INE266 5.1 Hypothesis Testing Intro
To be completed....
Hypothesis Testing Introduction
Reject H0 | Fail to reject H0 | |
---|---|---|
H0 is True | Type I Error | |
H0 is False | Type II Error |
1 hidden cell
Example. General picture: Type I Error
Hidden code
Example. General picture: Type II Error
t.test_plot(null.mean=20, null.sd=5,
alt.mean=21.5, alt.sd=15, n=70,
alpha=.05)
Example. Power of test vs Significance of test
par(mfrow=c(2,2))
for (alpha in (.2-.06*(0:3))) {
t.test_plot(null.mean=20, null.sd=7,
alt.mean=21.5, alt.sd=8,
n=70, alpha=alpha,
legend=FALSE)
}
Example. t-test output from R and underlying graphs
observations <- rnorm(50,22,5)
t.test(observations,mu=20)
t.test_plot(observations,null.mean=20)
Example. Increasing n for hypothesis test
par(mfrow=c(2,2))
for (n in (40+20*(0:3))) {
t.test_plot( null.mean=20, alt.mean=22, null.sd=8, n=n, legend=FALSE)
}
Example. Decreasing sample variance for hypothesis test
par(mfrow=c(2,2))
for (sd in (8-(0:3))) {
t.test_plot( null.mean=20, alt.mean=22, alt.sd=sd, n=50, legend=FALSE)
}