Lecture 2 Hypothesis Test I - Updated2
Lecture 2 Hypothesis Test I - Updated2
Lecture 2
3
Probability distributions
4
Probability density function
x
• How to find the quantitative relation between
– probability density function (PDF)
– x value and value
• Cumulative or not?
• Left tailed or right tailed?
• How to generate a normal distribution in excel?
6
Probability distributions
• Examples
– A normal distribution with η=8mg/L and σ=1 mg/L;
– Look for the value with 95% of data below?
– Look for the probability that the value is read
below 6.4mg/L?
7
Probability distributions
• t distribution
– In normal distributions, both η and σ are known;
– In practice, σ is often not known and we use s to
replace σ:
– Bell shaped and symmetric but tails are wider.
– Width of the t distribution depends on degree of
freedom.
Probability distributions
x
x axis moves by its own values;
t
t is a normalized value for linkage with formular
9
Probability distributions
• Example
– What is the 97.5th percentile of a t distribution with
degree of freedom 24 ?
– T.INV.2T(0.05, 24)=2.06
OR -T.INV(0.025,24)
– T.DIST.2T(2.064,24)
11
Probability distributions
12
Probability distributions
• Example:
13
Important notes
• Background
– Parametric vs. Nonparametric tests
– Sampling distribution
– Test levels and p values
– Error types and power of test
– Confidence intervals
– The elements of hypothesis tests
• Parametric tests
– One sample t test
– Tests for Differences of Mean under Independence
– Tests for Differences of Mean for Paired Samples
• Nonparametric tests
– Resampling test or Monte Carlo test
– Bootstrap
Test of Hypothesis
– One-sample t Test
• Compare the mean of a distribution with a specified value
• Test levels
– Test level, or the rejection level, level of
significance, is the sufficiently improbable region
of the null distribution.
– Test level is chosen manually. Commonly 5%;
sometimes 10% or 1% is also chosen.
• p value
– The p-value is the smallest level of significance
that would lead to rejection of the null hypothesis
with the given data
Important concepts
• Confidence intervals
• Instead of asking “what is the probability that Z falls within
limits a and b in the normal distribution”, it is more
important to ask “Within what intervals or limits does X% of
the population lie in the normal distribution”.
• The X% is referred as the “confidence level”.
• The interval correspond to
this level is called the
“confidence intervals”
or “confidence limits”.
Confidence interval
21
Confidence interval
• Example Se
22
Steps for hypothesis test
Sample distribution
Test value in one sample t test
Critical t value
Test level, α
Sample value t
corresponding t value
x
Sample value, x
http://www.wadsworth.com/psychology_d/special_features/ext/workshops/t_testsample1.html
Read and type Greek letters correction
https://www.keynotesupport.com/internet/special-
characters-greek-letters-symbols.shtml
• Alt 945 α
• Alt 951 η
• Alt 956 μ
• Alt 960 π
• Alt 961 ρ
• Alt 963 σ
https://www.thespruceeats.com/the-greek-
25
alphabet-1705558
Application examples
• Applications:
– 1. In laboratory quality control checks, the analyst measures the
concentration of test specimens that have been prepared or
calibrated so precisely that any error in the quantity is negligible.
The specimens are tested according to a prescribed analytical
method and a comparison is made to determine whether the
measured values and the known concentration of the standard
specimens are in agreement.
– 2. The desired quality of a product is known, by specification or
requirement, and measurements on the process are made at
intervals to see if the specification is accomplished.
– 3. A vendor claims to provide material of a certain quality and the
buyer makes measurements to see whether the claim is met.
– 4. A decision must be made regarding compliance or
noncompliance with a regulatory standard at a hazardous waste
site.
One-sample t Test
• Assumptions:
1. Dependent variables should be normally distributed in the
population.
2. Samples drawn from the population should be random.
3. Cases of the samples should be independent.
4. We should know the population mean.
• Hypothesis:
– A. Null hypothesis: assumes that there are no significance
differences between the population mean and the sample
mean.
– B. Alternative hypothesis: assumes that there is a significant
difference between the population mean and the sample
mean.
One-sample t Test
• Procedures:
4. Hypothesis testing:
Compare the calculated value with the table value. If the calculated value is
greater than the critical value, then we will reject the null hypothesis, and accept
the alternative hypothesis.
One-sample t Test
– t > t0.05, H0 is
rejected
– Or, calculated
t value corresponds
to a p value;
– p < 0.05, H0 is
rejected
One-sample t Test
• Example
– 1. Calculate the standard deviation
Measured DO
0.305 mg/L concentration
Unit mg/L
1 1.20
– 2. Calculate t value 2
3
1.40
1.40
1.30
t = 2.407 4
5 1.20
6 1.35
7 1.40
In Excel TDIST(t, df, tails)=0.03 <0.05 8 2.00
9 1.95
10 1.10
11 1.75
Ho is rejected. 12 1.05
13 1.05
14 1.40
Significant test
• Significance test
• Form of hypothesis test with null and alternative hypothesis;
• Significance level represents the risks of falsely rejecting H0
Significant test
• Previous example:
– Null hypothesis is “the mean is 8.0mg/L”
– Alternative hypothesis is “the mean < 8.0mg/L”
– Test at significance level =0.05
32
Significant test
• Another example:
33