stat1012 statistics for life sciences quick revision notes
TRANSCRIPT
STAT1012 Statistics for Life Sciences 1
STAT1012 Statistics for Life Sciences
Quick Revision Notes
Fall, 2019
LEUNG Man Fung, Heman
(Reference: lecture and tutorial notes)
STAT1012 Statistics for Life Sciences 2
Contents I) Descriptive Statistics .................................................................................................................... 4
Central tendency ......................................................................................................................... 4
Dispersion ................................................................................................................................... 4
Graphical methods ...................................................................................................................... 5
II) Probability ................................................................................................................................... 6
Notations..................................................................................................................................... 6
Probability theory ....................................................................................................................... 6
Conditional probability ............................................................................................................... 6
III) Discrete Probability Distributions .............................................................................................. 8
Discrete random variables .......................................................................................................... 8
Binomial distribution .................................................................................................................. 8
Poisson distribution .................................................................................................................... 9
Hypergeometric distribution (not required) ............................................................................... 9
Geometric distribution (not required) ........................................................................................ 9
Negative binomial distribution (not required) ......................................................................... 10
IV) Continuous Probability Distributions ...................................................................................... 11
Continuous random variables ................................................................................................... 11
Uniform distribution ................................................................................................................. 11
Normal distribution ................................................................................................................... 11
Some remarks (not required) ................................................................................................... 12
V) Point Estimation ....................................................................................................................... 13
Sampling .................................................................................................................................... 13
Point estimator ......................................................................................................................... 13
Mean ......................................................................................................................................... 14
Variance .................................................................................................................................... 15
Binomial proportion .................................................................................................................. 15
Poisson rate............................................................................................................................... 15
VI) Interval Estimation .................................................................................................................. 16
Confidence interval ................................................................................................................... 16
Mean ......................................................................................................................................... 16
STAT1012 Statistics for Life Sciences 3
Variance .................................................................................................................................... 17
Binomial proportion .................................................................................................................. 17
Poisson rate............................................................................................................................... 17
VII) Hypothesis Testing ................................................................................................................. 18
Terminologies ........................................................................................................................... 18
One sample z-test ..................................................................................................................... 19
One sample t-test ..................................................................................................................... 19
One sample chi-squared test .................................................................................................... 19
One sample binomial proportion test ...................................................................................... 20
Some remarks (not required) ................................................................................................... 20
STAT1012 Statistics for Life Sciences 4
I) Descriptive Statistics
Data type: Qualitative (special: Categorical), Quantitative (Discrete, Continuous)
Population: the whole set of entities of interest
Sample: a subset of the population
Central tendency
Sample mean: οΏ½Μ οΏ½π =1
πβ ππ
ππ=1
Sequential update property: οΏ½Μ οΏ½π =1
π[(π β 1)οΏ½Μ οΏ½πβ1 + ππ]
Mode: the value which has the greatest number of occurrence (may not be unique)
Median: the βmiddleβ value, or the average of the two values closest to βmiddleβ after sorting
Percentile: the p-th percentile (π π
100) is a value such that p% of the data are less than or equal to
π π
100. In particular, upper quantile = π0.75, median = π0.5, lower quantile = π0.25
Denote the sorted data by π(1), π(2), β¦ , π(π) where π(1) β€ π(2) β€ β― β€ π(π). This is equivalent to
saying that π(1) is the smallest, π(2) is the second smallest etc.
Median: π0.5 = π(
π+1
2) if n is odd or
1
2[π
(π
2)
+ π(
π
2+1)
] if n is even
Percentile: π π
100= π(π) where π = πππ’ππππ (
ππ
100) if
ππ
100 is not an integer
Otherwise, π π
100=
1
2[π
(ππ
100)
+ π(
ππ
100+1)
]
Dispersion
Symmetric: the left hand side of the distribution mirrors the right hand side
Unimodal: the mode is unique
Skewness: measure of asymmetry
Left-skewed (negatively skewed): mean < median, have a few extreme small values
STAT1012 Statistics for Life Sciences 5
Right-skewed (positively skewed): mean > median, have a few extreme large values
Symmetric β mean = median (converse not true)
Symmetric + unimodal β mean = median = mode (converse not true)
Range: maximum β minimum (π(π) β π(1))
Interquartile range: π0.75 β π0.25
Sample variance: π2 =1
πβ1β (ππ β οΏ½Μ οΏ½)2π
π=1 or π2 =1
πβ1β (ππ
2 β ποΏ½Μ οΏ½2)ππ=1
Sample standard deviation: ππ· = βπ2
Graphical methods
Bar graph: use for categorical data, show the number of observations in each category
Histogram: use for quantitative data, showing the number of observations in each range
Stem-and-leaf plot: ordered the data into a tree-like structure
Boxplot: show 5 numbers (min, Q1, median, Q3, max), help locate outliers (As a rule of thumb,
some people define outliers as values > Q3 + 1.5*IQR or < Q1 β 1.5*IQR)
STAT1012 Statistics for Life Sciences 6
II) Probability
Notations
Sample space: the set of all possible outcomes, often denoted as Ξ©
Outcome: a possible type of occurrence
Event: any set of outcomes of interest, can be denoted as πΈ β Ξ©
Probability (of an event): denoted by π(πΈ), always lies between 0 and 1 (both inclusive)
π(πΈ) =# ππ ππ’π‘πππππ ππ πΈ
# ππ ππ’π‘πππππ ππ Ξ©
Union: either A or B occurs, or they both occurs, denoted by π΄ βͺ π΅ (logically equivalent to OR)
Intersection: both A and B occur, denoted by π΄ β© π΅ (logically equivalent to AND)
Complement: A does not occur, denoted by π΄πΆ (logically equivalent to NOT)
Commutativity: π΄ βͺ π΅ = π΅ βͺ π΄, π΄ β© π΅ = π΅ β© π΄
Associativity: (π΄ βͺ π΅) βͺ πΆ = π΄ βͺ (π΅ βͺ πΆ), (π΄ β© π΅) β© πΆ = π΄ β© (π΅ β© πΆ)
Distributive laws: (π΄ β© π΅) βͺ πΆ = (π΄ βͺ πΆ) β© (π΅ βͺ πΆ), (π΄ βͺ π΅) β© πΆ = (π΄ β© πΆ) βͺ (π΅ β© πΆ)
DeMorganβs laws: (π΄ βͺ π΅)πΆ = π΄πΆ β© π΅πΆ , (π΄ β© π΅)πΆ = π΄πΆ βͺ π΅πΆ
Probability theory
Mutually exclusive: A and B are mutually exclusive if π(π΄ β© π΅) = 0 (cannot co-occur)
Independence: π(π΄ β© π΅) = π(π΄)π(π΅) iff A and B are independent. Their complements (A and
BC; AC and B; AC and BC) will be pairwise independent as well
Addition law: π(π΄ βͺ π΅) = π(π΄) + π(π΅) β π(π΄ β© π΅)
Multiplication law: if π΄1, β¦ , π΄π are mutually independent, then π(π΄! β© β¦ β© π΄π) = π(π΄1) Γ β¦ Γ
π(π΄π)
Conditional probability
Conditional probability: π(π΅|π΄) =π(π΄β©π΅)
π(π΄), if π(π΅|π΄) = π(π΅), then A and B are independent
STAT1012 Statistics for Life Sciences 7
Relative risk: π π (π΅|π΄) =π(π΅|π΄)
π(π΅|π΄πΆ)
Total probability rule: π(π΅) = π(π΅|π΄)π(π΄) + π(π΅|π΄πΆ)π(π΄πΆ)
Exhaustive: if π΄1, β¦ , π΄π are exhaustive, then π΄1 βͺ β¦ βͺ π΄π = Ξ© (at least one of them must occur)
Generalized total probability rule: let π΄1, β¦ , π΄π be mutually exclusive and exhaustive events. For
any event B, we have π(π΅) = β π(π΅|π΄π)π(π΄π)ππ=1
Bayes' theorem: conditional probability + generalized total probability rule. let π΄1, β¦ , π΄π be
mutually exclusive and exhaustive events. For any event B,
π(π΄π|π΅) =π(π΄π β© π΅)
π(π΅)=
π(π΄π)π(π΅|π΄π)
π(π΅)=
π(π΄π)π(π΅|π΄π)
β π(π΅|π΄π)π(π΄π)ππ=1
B
STAT1012 Statistics for Life Sciences 8
III) Discrete Probability Distributions
Random variables: numeric quantities that take different values with specified probabilities
Discrete random variable: a R.V. that takes value from a discrete set of numbers
Continuous random variable: a R.V. that takes value over an interval of numbers
Discrete random variables
Probability mass function: a pmf assigns a probability to each possible value x of the discrete
random variable X, denoted by π(π₯) = π(π = π₯)
β π(π₯π)ππ=1 = 1 (total probability rule)
Cumulative distribution function: a cdf gives the probability that X is less than or equal to the
value x, denoted by πΉ(π₯) = π(π β€ π₯)
Expected value: π = πΈ(π) = β π₯ππ(π = π₯π)ππ=1 (the idea is βprobability weighted averageβ)
Variance: π2 = πππ(π) = β (π₯π β π)2π(π = π₯π)ππ=1 , alternatively πππ(π) = πΈ(π2) β [πΈ(π)]2
Translation/rescale: πΈ(ππ + π) = ππΈ(π) + π, πππ(ππ + π) = π2πππ(π)
Linearity of expectation: πΈ(β ππππ=1 ) = β πΈ(ππ)
ππ=1
Binomial distribution
Factorial: π! = π Γ (π β 1) Γ β¦ Γ 1, note that 0! = 1
Permutation (order is important): πππ =
π!
(πβπ)!
Combination (order is not important): πΆππ =
π!
π!(πβπ)!, also denoted as (π
π)
Binomial distribution: probability distribution on the number of successes π in π independent
experiments, each experiment has a probability of success π, then π~π΅(π, π)
Pmf: π(π = π₯) = (ππ₯
)ππ₯(1 β π)πβπ₯ for π₯ = 0, 1, 2, β¦ , π
Mean: πΈ(π) = ππ
Variance: πππ(π) = ππ(1 β π)
Skewness: right-skewed if p<0.5, symmetric if p=0.5, left-skewed if p>0.5
STAT1012 Statistics for Life Sciences 9
Poisson distribution
Poisson distribution: probability distribution on the number of occurrence π (usually of a rare
event) over a period of time or space with rate π, then π~ππ(π)
Pmf: π(π = π₯) =πβπππ₯
π₯! for π₯ = 0, 1, 2, β¦
Mean: πΈ(π) = π
Variance: πππ(π) = π
Skewness: right-skewed
Poisson limit theorem (poisson approximation to binomial): if π~π΅(π, π) where π β₯ 20, π <
0.1 and ππ < 5, then π β π~ππ(π) where π = ππ
Hypergeometric distribution (not required)
Hypergeometric distribution: probability distribution on the number of success π in π trials
without replacement, from a finite population of size π1 + π2 = π β₯ π that contains π1 trials
classified as success, then π~π»π¦πππππππππ‘πππ(π1, π2, π)
Pmf: π(π = π₯) =(π1
π₯ )( π2πβπ₯)
(ππ)
for π₯ = max(0, π β π2) , β¦ , min (π, π1)
Mean: πΈ(π) = π (π1
π)
Variance: πππ(π) = π (π1
π) (
π2
π) (
πβπ
πβ1)
Geometric distribution (not required)
Geometric distribution: probability distribution on the number of trials π when the first success
occurs, each trial has a probability of success π, then π~πΊππ(π)
Pmf: π(π = π₯) = (1 β π)π₯β1π for π₯ = 1, 2, β¦
Mean: πΈ(π) =1
π
Variance: πππ(π) =1βπ
π2
Memoryless: π(π > π + π|π > π) = π(π > π) . Geometric distribution is the only discrete
distribution with this property
STAT1012 Statistics for Life Sciences 10
Negative binomial distribution (not required)
Negative binomial distribution: probability distribution on the number of times π when the π
success occurs, each trial has a probability of success π, then π~ππ΅(π, π)
Pmf: π(π = π₯) = (π₯β1πβ1
)(1 β π)π₯βπππ for π₯ = π, π + 1, β¦
Mean: πΈ(π) =π
π
Variance: πππ(π) =π(1βπ)
π2
STAT1012 Statistics for Life Sciences 11
IV) Continuous Probability Distributions
Continuous random variables
Probability density function: a pdf specifies the probability of the random variable falling within
a particular range of values, denoted by π(π₯)
π(π β€ π β€ π) = β« π(π₯)ππ₯π
π, which is the area under the curve from a to b
π(π = π) = β« π(π₯)ππ₯π
π= 0 for all π
β« π(π₯)ππ₯β
ββ= 1 (total probability rule)
Cumulative distribution function: a cdf gives the probability that X is less than or equal to the
value x, denoted by πΉ(π₯) = π(π β€ π₯) = β« π(π‘)ππ‘π₯
ββ
π(π β€ π β€ π) = β« π(π₯)ππ₯π
π= πΉ(π) β πΉ(π) (by the fundamental theorem of calculus)
Expected value: π = πΈ(π) = β« π₯π(π₯)ππ₯β
ββ
Variance: π2 = πππ(π) = β« (π₯ β π)2π(π₯)ππ₯β
ββ= β« π₯2π(π₯)ππ₯
β
βββ π2
(Note: Calculus is NOT required in our course)
Uniform distribution
Uniform distribution: if π follows uniform distribution on the interval [π, π], then it has the same
probability density at any point in the interval and we denote it by π~π(π, π)
Pdf: π(π₯) =1
πβπ for π β€ π₯ β€ π, otherwise 0
Cdf: πΉ(π₯) = β«1
πβπππ‘
π₯
π= [
π‘
πβπ]
π
π₯
=π₯βπ
πβπ for π β€ π₯ β€ π
Mean: πΈ(π) =π+π
2
Variance: πππ(π) =(πβπ)2
12
Normal distribution
Normal distribution: if π follows normal distribution with mean π and variance π2 , then
π~π(π, π2), often used to represent continuous random variable with unknown distributions
STAT1012 Statistics for Life Sciences 12
Pdf: π(π₯) =1
β2πππ
β1
2π2(π₯βπ)2
for ββ < π₯ < β
Shape: bell-shape, symmetric about the mean, unimodal
Standard normal distribution: π~π(0,1)
Cdf of standard normal: denoted as Ξ¦(π§) = π(π β€ π§)
π(π β€ π β€ π) = π(π β€ π) β π(π β€ π) = Ξ¦(π) β Ξ¦(π)
Ξ¦(βπ§) = 1 β Ξ¦(π§) by symmetric property
Percentile of standard normal: Ξ¦(1.645) = 0.95, Ξ¦(1.96) = 0.975
Standardization: if π~π(π, π2), then πβπ
π~π(0,1)
π(π < π < π) = π (πβπ
π< π <
πβπ
π) = Ξ¦ (
πβπ
π) β Ξ¦ (
πβπ
π)
De MoivreβLaplace theorem (normal approximation to binomial): if π~π΅(π, π) , π(π < π <
π) β π(π + 0.5 β€ π β€ π β 0.5) where π~π(ππ, ππ(1 β π)). The 0.5s are continuity correction
Normal approximation to poisson: if π~ππ(π), π(π β€ π) β π(π β€ π + 0.5) where π~π(π, π)
Some remarks (not required)
Statistical parameter: a numerical characteristic of a statistical population or a statistical model.
We are given these numbers (e.g. π, π, π) in previous chapters but in reality we do not know
these numbers. These lead to the next part of our course: Statistical Inference
Why approximation: one major reason is that calculating binomial probability involves
combination and large factorials are hard/costly to compute in previous centuries
Variance of sum: πππ(π + π) = πππ(π) + πππ(π) + 2πΆππ£(π, π)
Tower rule of expectation: πΈ(π) = πΈ[πΈ(π|π)]
Law of total variance (EVE): πππ(π) = πΈ[πππ(π|π)] + πππ[πΈ(π|π)]
Sum of poisson: if π~ππ(π1), π~ππ(π2) independently, then π + π~ππ(π1 + π2)
Sum of normal: if π~π(π1, π12), π~π(π2, π2
2) independently, then π + π~π(π1 + π2, π12 + π2
2)
Square of standard normal: if π~π(π, π2), the π2 = [πβπ
π]
2
~π12
Sum of chi square: if π~ππ2, π~ππ
2 , then π + π~ππ+π2
STAT1012 Statistics for Life Sciences 13
V) Point Estimation
Statistical inference: process of drawing conclusions from data that are subject to random
variations
Estimation: estimate the values of specific population parameters based on the observed data
Hypothesis testing: test on whether the value of a population parameter is equal to some specific
value based on the observed data
Sampling
Sample: the data obtained after the experiments are performed, usually denoted by π₯1, β¦ , π₯π
Random sample: the data before the experiments are performed, usually denoted by π1, β¦ , ππ
Non-probability sample: some elements of the population have no chance of being selected
Probability sample: all elements in the population has known nonzero chance to be selected
Simple random sample: all elements in the population has the same probability to be selected
Systematic sample: elements are selected at regular intervals through certain order
Stratified sample: all elements are classified into different stratums and each stratum is sampled
as an independent sub-population
Cluster sample: all elements are divided into different clusters and a simple random sample of
clusters is selected
Coverage error: exists if some groups are excluded from the frame and have no chance of being
selected
Non-response error: people who do not respond may be different from those who do respond
Measurement error: due to weaknesses in question design, respondent error, and interviewerβs
impact on the respondent
Sampling error: Chance (luck of the draw) variation from sample to sample
Point estimator
Point estimator: a rule for calculating a single value to βbest guessβ an unknown population
parameter of interest based on the observed data
STAT1012 Statistics for Life Sciences 14
(Note: estimator π(π) is random, estimate π(π₯) is fixed, estimand π is the unknown parameter)
Unbiasedness: πΈ(π) = π
Minimum variance: πππ(π) β€ πππ(οΏ½ΜοΏ½) β οΏ½ΜοΏ½ β Ξ
Independent and identically distributed (i.i.d.): an assumption where the random variables
π1, β¦ , ππ are sampled such that they are independent and follows the same distribution
Central limit theorem (CLT, LindebergβLΓ©vy): Let π1, β¦ , ππ be i.i.d. random variables with mean
π and finite variance π2, then as n tends to infinity (>30 in practice), οΏ½Μ οΏ½πβ π (π,
π2
π)
Mean
Estimand: π = π = πΈ(π)
Sample mean (estimator): π = οΏ½Μ οΏ½ =1
πβ ππ
ππ=1
Expectation: πΈ(οΏ½Μ οΏ½) =1
πβ πΈ(ππ)
ππ=1 =
ππ
π= π (unbiased)
Variance: πππ(οΏ½Μ οΏ½) =1
π2β πππ(ππ)
ππ=1 =
ππ2
π2 =π2
π (by i.i.d.)
Distribution: οΏ½Μ οΏ½~π (π,π2
π). If π1, β¦ , ππ~π(π, π2), then this follows from the fact that sum of
independent normal is normal (remarks in section IV).
If π1, β¦ , ππ follows some other distribution, then this follows from the CLT when n is large
(usually >30). Otherwise ( π β€ 30 ) we have βπ (οΏ½Μ οΏ½βπ
π) ~π‘πβ1 , where π‘πβ1 is a Studentβs t-
distribution with degree of freedom n-1.
STAT1012 Statistics for Life Sciences 15
Variance
Estimand: π = π2 = πππ(π)
Sample variance (estimator): π = π2 =1
πβ1β (ππ β οΏ½Μ οΏ½)2π
π=1 , πβ²2 =1
πβ (ππ β π)2π
π=1 if π is known
Expectation: πΈ(π2) = π2 (unbiased)
Variance: πππ(π2) =2π4
πβ1 (not required)
Distribution: (πβ1)π2
π2 ~ππβ12 β π2~
π2
πβ1ππβ1
2 (right-skewed)
Binomial proportion
Estimand: π = π = πΈ(π) where π1, β¦ , ππ~π΅(1, π) (similar to mean case)
Estimator: οΏ½ΜοΏ½ = οΏ½Μ οΏ½ =1
πβ ππ
ππ=1
Expectation: πΈ(οΏ½ΜοΏ½) =1
πβ πΈ(ππ)
ππ=1 =
ππ
π= π (unbiased)
Variance: πππ(οΏ½ΜοΏ½) =1
π2β πππ(ππ)
ππ=1 =
ππ(1βπ)
π2 =π(1βπ)
π (by i.i.d.)
Distribution: οΏ½ΜοΏ½~π΅(π, π) because the sampling distribution is binomial. For π > 30 or ποΏ½ΜοΏ½οΏ½ΜοΏ½ > 5,
normal approximation gives οΏ½ΜοΏ½~π (π,π(1βπ)
π)
Poisson rate
Estimand: π = π where π~ππ(ππ) with π as the total number of units
Estimator: οΏ½ΜοΏ½ =π
π
Expectation: πΈ(οΏ½ΜοΏ½) =1
ππΈ(π) =
ππ
π= π (unbiased)
Variance: πππ(οΏ½ΜοΏ½) =1
π2πππ(π) =
ππ
π2=
π
π (by i.i.d.)
Distribution: οΏ½ΜοΏ½~ππ(ππ) because the sampling distribution is Poisson. For π > 30 or οΏ½ΜοΏ½π > 10,
normal approximation gives οΏ½ΜοΏ½~π (π,π
π)
STAT1012 Statistics for Life Sciences 16
VI) Interval Estimation
Confidence interval
Confidence interval: an interval associated with a confidence level 1 β πΌ that may contain the
true value of an unknown population parameter
Meaning of confidence level: in the long run, 100(1 β πΌ)% of all the confidence intervals that
can be constructed will contain the unknown true parameter (NOT the probability that an interval
will contain the parameter)
Elements of confidence interval: {π, ππΌ, π π(π)}, where π is the point estimate, ππ is the critical
value from an asymptotic distribution under the confidence level 1 β πΌ, π π(π) is the standard
error of the point estimate
Mean
Confidence interval (π is known): οΏ½Μ οΏ½ Β± π§πΌ
2Γ
π
βπ
Confidence interval (π is unknown, π > 30): οΏ½Μ οΏ½ Β± π§πΌ
2Γ
π
βπ
Confidence interval (π is unknown, π β€ 30): οΏ½Μ οΏ½ Β± π‘πβ1,πΌ
2Γ
π
βπ (differs in degree of freedom)
Margin of error: πΈ = ππΌ Γ π π(π) (width is 2πΈ which helps determine sample size)
Critical values: standard normal and t-distribution are symmetric around 0 β π1βπΌ
2= ππΌ
2
STAT1012 Statistics for Life Sciences 17
One-sided confidence interval: π > οΏ½Μ οΏ½ β π§1βπΌ Γπ
βπ or π < οΏ½Μ οΏ½ + π§1βπΌ Γ
π
βπ
(Note: this is essentially adjusting the critical value, which arises naturally when we are not
interested in the other bound, e.g. weight > 0 so negative lower bound is not interested)
Variance
Confidence interval (π is unknown): ((πβ1)π 2
ππβ1,1β
πΌ2
2 ,(πβ1)π 2
ππβ1,
πΌ2
2 )
Confidence interval (π is known): (ππ β²2
ππ,1β
πΌ2
2 ,ππ β²2
ππ,
πΌ2
2 ) = (β (ππβπ)2π
π=1
ππ,1β
πΌ2
2 ,β (ππβπ)2π
π=1
ππ,
πΌ2
2 ) (differs in d.f.)
Critical values: chi-squared distribution is not symmetric, so cannot simplify
Binomial proportion
Confidence interval (π > 30 or ποΏ½ΜοΏ½οΏ½ΜοΏ½ > 5): οΏ½ΜοΏ½ Β± π§πΌ
2Γ π π(οΏ½ΜοΏ½) β οΏ½ΜοΏ½ Β± π§πΌ
2Γ β
π(1βπ)
π
(Note: the standard error here is an approximated version from the lecture notes)
Confidence interval (exact method): solve for ππΏ , ππ from {π(π β₯ ποΏ½ΜοΏ½|π = ππΏ) =
πΌ
2
π(π β€ ποΏ½ΜοΏ½|π = ππ) =πΌ
2
where
π~π΅(π, π)
Poisson rate
Confidence interval (exact method): solve for ππΏ , ππ from {π(π β₯ οΏ½ΜοΏ½π|π = ππΏ) =
πΌ
2
π(π β€ οΏ½ΜοΏ½π|π = ππ) =πΌ
2
where
π~ππ(ππ)
Confidence interval (bootstrap method): generate π sample of size π with replacement from π.
Calculate the point estimate from each bootstrap sample. Sort the means and the bootstrap
confidence interval is given by the corresponding percentiles.
(Note: bootstrap is a very powerful method which can be applied to many statistical problems
that do not require close form)
STAT1012 Statistics for Life Sciences 18
VII) Hypothesis Testing
Terminologies
Statistical hypothesis: a claim (assumption) about a population parameter
Null hypothesis: π»0, the hypothesis to be tested (default position)
Alternative hypothesis: π»1, a hypothesis challenge (against) π»0 (what we want to conclude)
Hypothesis testing: a procedure to make decision on hypothesis based on some data samples.
The idea is to assume π»0 is true first. If the population under π»0 is unlikely to generate the data
sample, then we can make a decision to reject π»0 (and thus accept π»1).
Test statistics: a quantity (statistics) derived from the sample to help perform hypothesis test
Level of significance: πΌ, defines the unlikely value of the sample if π»0 is true
Critical value: cutoff values from the distribution of test statistic under π»0 given πΌ
p-value: probability of obtaining a test statistics at least as extreme as the observed sample value
given π»0 is true
βAccept the null hypothesisβ: if we fail to reject π»0, we cannot accept it because doing so violates
the idea of prove by contradiction. It is possible that π»0 is not true but we have not collected
enough data to reject it
Type I error: πΌ, reject π»0 when π»0 is true (false positive).
(Note: traditional statistical procedure controls type I error by the level of significance, so thatβs
why both of them are πΌ)
STAT1012 Statistics for Life Sciences 19
Type II error: π½, do not reject π»0 when π»0 is false (false negative)
π»0 is true π»0 is false
Do not reject π»0 Correct inference (true negative, probability = 1-Ξ±)
Type II error (false negative, probability = Ξ²)
Reject π»0 Type I error (false positive, probability = Ξ±)
Correct inference (true positive, probability = 1-Ξ²)
One sample z-test
Assumption: known π, from normal distribution or of large size (π β₯ 30)
Hypothesis: (1) {π»0: π = π0
π»1: π β π0 or (2) {
π»0: π = π0
π»1: π > π0 or (3) {
π»0: π = π0
π»1: π < π0
Test statistics: π§0 =οΏ½Μ οΏ½βπ0
π
βπ
, π0~π(0,1) under null
Decision rule: reject if (1) |π§0| > π§1βπΌ
2; (2) π§0 > π§1βπΌ; (3) π§0 < π§πΌ
p-value: reject if π0 < πΌ where (1) π0 = π(π0 > |π§0|); (2) π0 = π(π0 > π§0); (3) π0 = π(π0 <
π§0)
One sample t-test
Assumption: unknown π
Hypothesis: (1) {π»0: π = π0
π»1: π β π0 or (2) {
π»0: π = π0
π»1: π > π0 or (3) {
π»0: π = π0
π»1: π < π0
Test statistics: π‘0 =οΏ½Μ οΏ½βπ0
π
βπ
, π0~π‘πβ1 under null
Decision rule: reject if (1) |π‘0| > π‘πβ1,1βπΌ
2; (2) π‘0 > π‘πβ1,1βπΌ; (3) π‘0 < π‘πβ1,πΌ
One sample chi-squared test
Assumption: unknown π, from normal distribution
STAT1012 Statistics for Life Sciences 20
Hypothesis: (1) {π»0: π2 = π0
2
π»1: π2 β π02 or (2) {
π»0: π2 = π02
π»1: π2 > π02 or (3) {
π»0: π2 = π02
π»1: π2 < π02
Test statistics: π02 =
(πβ1)π 2
π02 , Ξ§0
2~ππβ12 under null
Decision rule: reject if (1) π02 > π
πβ1,1βπΌ
2
2 or π02 < π
πβ1,πΌ
2
2 ; (2) π02 > ππβ1,1βπΌ
2 ; (3) π02 < ππβ1,πΌ
2
One sample binomial proportion test
Assumption: binomial sample with π > 30 or ππ0π0 > 5
Hypothesis: (1) {π»0: π = π0
π»1: π β π0 or (2) {
π»0: π = π0
π»1: π > π0 or (3) {
π»0: π = π0
π»1: π < π0
Test statistics: π§0 =οΏ½Μ οΏ½βπ0
βπ0(1βπ0)
βπ
, π0~π(0,1) under null
Decision rule: reject if (1) |π§0| > π§1βπΌ
2; (2) π§0 > π§1βπΌ; (3) π§0 < π§πΌ
Some remarks (not required)
Duality of confidence interval with hypothesis test: π»0 is rejected at significance level πΌ if and
only if the corresponding confidence interval does not contain the value claimed by π»0 with
confidence level 1 β πΌ (true for common cases)
Power: π(ππππππ‘ π»0|π»1 ππ π‘ππ’π) . As higher power implies a lower type II error, traditional
procedures usually fix the type I error and search for tests with high power
Bayesian inference: most procedures in this course are frequentist procedures. Taking interval
estimation as an example, if we want our interval to have probability 1 β πΌ covering the
unknown parameter, we should seek credible interval from Bayesian inference instead
(confidence interval does not guarantee that). Consider taking more courses from our
department if you are interested :)