You are on page 1of 26

Hypothesis

By: Dr. SIEV Sokly


Population

Sample

Typical hypothesis in
Environmental Science
𝜇 < 𝜇0
X < Xstandard

Xstandard
Frequency

90% 10%

n = 10

x
Frequency

Sample
x

Mean
Variation
x

Mean Xstandard
1. Distribution?
Probability

Population 2. Probability?
x
When H is true When H is false
If H is rejected Type I error No error
false positive
If H is not rejected No error Type II error
false negative

Significance Level (𝛼=0.05)

Common Significant Levels


0.05, 0.01, 0.001

* ** ***
H0: You are not pregnant.

Source of Image: Effect Size FAQs by Paul Ellis


Examples of statistical test related to a population mean

1. Mean of an environmental parameter in area A is greater


than that in area B.
2. Mean of a pollutant concentration in a water body meet
water quality standard or not.
3. A new method to reduce environmental pollution is
effective or not.
4. A new method to reduce health/ecological risk is effective
or not.
t test
Test of mean
Methods for Hypothesis Test

Type of test Parametric Nonparametric

< 2 sample sets t-test Mann-Whitney U-test

Paired sample sets Paired t-test Wilcoxon

> 2 sample sets 1-way ANOVA Kruskal-Wallis

Distribution Chi-square Kolmogorov-Smirnov

Correlation Pearson's r Spearman's r

Crossed comparisons Factorial ANOVA Friedman's; Quade


Variable

Statistic
Appendix on OCWi
𝑋~ 𝑁 𝜇, 𝜎

Variable Probability Density Function (PDF)

𝜇 = mean
𝜎 = standard deviation

Standardized Normal Score

Statistic Deviation from mean


𝑍=
Standard deviation

𝑋−𝜇
= Statistic
𝜎
𝑋−𝜇
For normal distribution, 𝑋~ 𝑁 𝜇, 𝜎 𝑍=
𝜎

For any distribution, 𝑋−𝜇


when n is large,
𝑋 ~ 𝑁 𝜇, 𝜎𝑋 𝑍=
𝜎𝑋

For any distribution, 𝑋−𝜇


when n is not large,
𝑋 ≠ 𝑁 𝜇, 𝑠𝑋 𝑡=
𝑠𝑋

Normal 𝑡𝛼,∞ = 𝑍𝛼
t, n=4

t, n=3

t, n=2

𝑥
Population Sample (n)
𝜇: Population mean 𝑋: Sample mean
𝜎: SD of population 𝑠𝑋 : SD of sample mean

• 𝐻0 : 𝜇 < 𝜇0 --- Null hypothesis <= Your expectation


• 𝐻1 : 𝜇 ≥ 𝜇0 --- Alternative hypothesis
• Check the probability of H1 (p).
𝑋−𝜇0 𝑠2
Statistic 𝑡= , 𝑠𝑋 =
𝑠𝑋 𝑛

Estimate for population,


not sample

𝛼 = 0.05

𝑡𝛼,𝑑𝑓
When H is true When H is false
If H is rejected Type I error No error
false positive
If H is not rejected No error Type II error
false negative

Significance Level (𝛼=0.05)

Common Significant Levels


0.05, 0.01, 0.001

* ** ***
Example 5
Consider the test H0 : µ = 35 vs. Ha : µ > 35 for a
population that is normally distributed.
(a) A random sample of 18 observations taken
from this population produced a sample mean
of 40 and a sample standard deviation of 5.
Using α = 0.025, would you reject the null
hypothesis?
(b) Another random sample of 18 observations
produced a sample mean of 36.8 and a sample
standard deviation of 6.9. Using α = 0.025,
would you reject the null hypothesis?
(c) Compare and discuss the decisions of parts (a)
and (b).
(a)R code:
alpha = 0.025
mu_0 = 35
n = 18
x_bar = 40
s=5
t = (x_bar - mu_0 )/(s/sqrt(n))
p_value = pt(t, df = (n-1), lower.tail = FALSE)
if(p value < = alpha){ print("The null hypothesis
is rejected") } else{ print("There is not enough
evidence to reject the null hypothesis.") }
(b)R code:
alpha = 0.025
mu_0 = 35
n = 18
x_bar = 36.8
s = 6.9
t = (x_bar – mu_0 )/(s/sqrt(n))
p_value = pt(t, df = (n-1), lower.tail = FALSE)
if(p value < = alpha){
print("The null hypothesis is rejected") } else{ print("There is
not enough evidence to reject the null hypothesis.") }
(c) The sample in (a) produces larger t value than that of (b).
The larger t value is, the more frequent H0 is rejected.
Sample Codes for One-side Test for One Sample

x <- c(1,2,2,3)
x
t.test(x, mu=0, alternative="greater") # H0: 𝜇 ≤ 0
t.test(x, mu=2, alternative="greater") # H0: 𝜇 ≤ 2

> t.test(x, mu=0, alternative="greater") # H0: 𝜇 ≤ 0


One Sample t-test

data: x
t = 4.899, df = 3, p-value = 0.008138
alternative hypothesis: true mean is greater than 0
95 percent confidence interval:
1.039243 Inf
sample estimates:
mean of x
2
One-sample hypothesis:
𝜇0
𝑋
• 𝐻0 : 𝜇 < 𝜇0 --- Null
• 𝐻1 : 𝜇 ≥ 𝜇0 --- Alternative
Probability? • Probability of H1 (p).

Data

t distribution
Probability?

Statistic “t”
t 0
t test: test of mean
𝑋 𝜇0
One-sample hypothesis
(One set of samples)

𝑋1 𝑋2
Two-sample hypothesis
(Two sets of samples)
𝑋 𝜇0
One-sample hypothesis

𝑋 − 𝜇0 𝑠2
𝑡= , 𝑠𝑋 =
𝑠𝑋 𝑛

• One-side test
for H0: 𝜇 ≤ 𝜇0
If 𝑡 ≥ 𝑡𝛼 1 ,𝑑𝑓 , then reject H0

• Two-side test
for H0: 𝜇 ≠ 𝜇0
If 𝑡 ≥ 𝑡𝛼 2 ,𝑑𝑓 , then reject H0
Two-sample hypothesis 𝑋1 𝑋2

2 2
𝑋1 −𝑋2 𝑠𝑝 𝑠𝑝
𝑡= , 𝑠𝑋1 −𝑋2 = +
𝑠𝑋1 −𝑋2 𝑛1 𝑛2

• One-side test
for H0: 𝜇1 ≤ 𝜇2 𝑠𝑋1 −𝑋2
If 𝑡 ≥ 𝑡𝛼 1 ,𝑑𝑓 , then reject H0 Standard error of the
difference between
sample means
• Two-side test
for H0: 𝜇1 ≠ 𝜇2 𝑠𝑝2
If 𝑡 ≥ 𝑡𝛼 2 ,𝑑𝑓 , then reject H0 Pooled variance
Confidence interval of t-distribution

𝑃 −𝑡𝛼 2 ,𝑑𝑓 ≤ 𝑡 ≤ 𝑡𝛼 2 ,𝑑𝑓 =1−𝛼


𝜇: Population mean
𝑋−𝜇
∴ 𝑃 −𝑡𝛼 2 ,𝑑𝑓 ≤ ≤ 𝑡𝛼 2 ,𝑑𝑓 =1−𝛼
𝑠𝑋

∴ 𝑃 𝑋 − 𝑡𝛼 2 ,𝑑𝑓 𝑠𝑋 ≤ 𝜇 ≤ 𝑋 + 𝑡𝛼 2 ,𝑑𝑓 𝑠𝑋 =1−𝛼

Confidence limit

𝑠2
𝑠𝑋 = 𝑠 2 : Sample variance
𝑛
1
Confidence interval ∝
𝑛
Exercise
Student’s t Test
1) Make a histogram of a set of your sample data. If necessary,
transform the data so that its symmetry and kurtosis become similar
to normal distribution. If you cannot find data showing normal
distribution, please send an email to Sokly to do this task.

2) Regarding the prepared data, make a null hypothesis appropriate for


one-side t-test by setting a criteria.

3) Test your hypothesis using one-side t-test at 𝛼 = 0.05.

4) State the statistical conclusion.

5) Describe your interpretation on the conclusion.

You might also like