You are on page 1of 18

6/1/2020

Ho Chi Minh City University of Technology –


Bach Khoa
Content
 Part 4: Probability
 4.1 Probability
 4.2 Variables
Applied Statistics in  4.3 Sampling distributions
Construction Management  Part 5: Inference for relationships
 5.1 Estimation
 5.2 Confidence intervals
Lecturer: Nguyen Hoai Nghia (Jack), Ph.D.
 5.3 Hypothesis testing
Email: nhnghia@hcmiu.edu,vn
nghianew@yahoo.com

1 2

4.1 Probability 4.1 Probability


 4.1.1 Introduction 4.1.1 Introduction
 4.1.2 Probability calculation  The probability of an event refers to the likelihood that the
 4.1.3 Probability rules event will occur.
 Mathematically, the probability that an event will occur is
expressed as a number between 0 and 1.

3 4

3 4
6/1/2020

4.1 Probability 4.1 Probability


4.1.1 Introduction 4.1.2 Probability calculation
The probability of event A is represented by P(A).  The probability that the experiment results in a successful
 If P(A) equals zero, event A will almost definitely not occur. outcome (S) is:
 If P(A) is close to zero, there is only a small chance that
event A will occur. Number of successful outcomes
P(S) =
 If P(A) equals 0.5, there is a 50-50 chance that event A will Total number of equally likely outcomes
occur.  The probability of an event in terms of its long-run relative
 If P(A) is close to one, there is a strong chance that event A frequency
will occur.
 If P(A) equals one, event A will almost definitely occur. Frequency of Event A
P(S) =
Number of Trials

5 6

5 6

4.1 Probability 4.1 Probability


4.1.2 Probability calculation 4.1.3 Probability rules
 The law of large numbers (LLN) is a theorem that describes Rule of Subtraction.
the result of performing the same experiment a large number  The probability that event A will occur is equal to 1 minus the
of times. probability that event A will not occur.
 According to the law, the average of the results obtained from
a large number of trials should be close to the expected value P(A) = 1 - P(𝐴̅)
and will tend to become closer to the expected value as more
trials are performed

7 8

7 8
6/1/2020

4.1 Probability 4.1 Probability


4.1.3 Probability rules 4.1.3 Probability rules
Rule of Multiplication Rule of Addition
 The probability that Events A and B both occur is equal to the  The probability that Event A or Event B occurs is equal to the
probability that Event A occurs times the probability that probability that Event A occurs plus the probability that Event
Event B occurs, given that A has occurred. B occurs minus the probability that both Events A and B
occur.
P(A ∩ B) = P(A) P(B|A) P(A ∪ B) = P(A) + P(B) - P(A ∩ B)

P(A ∪ B) = P(A) + P(B) - P(A)P( B | A )

9 10

9 10

4.2 Variables 4.2 Variables


4.2.1 Random variables 4.2.1 Random variables
4.2.2 Discrete variables  When the value of a variable is determined by a chance
4.2.3 Continuous variables event, that variable is called a random variable.
4.2.4 Chebyshev’s Theorem  Random variables can be discrete or continuous.
 A probability distribution is a table or an equation that links
each possible value that a random variable can assume with
its probability of occurrence.

11 12

11 12
6/1/2020

4.2 Variables 4.2 Variables


4.2.1 Random variables (cont.) 4.2.1 Random variables (cont.)
Discrete Probability Distributions Discrete Probability Distributions
 The probability distribution of a discrete random variable can  The table is an example of a probability distribution for a
always be represented by a table. discrete random variable.
 Given a probability distribution, you can find cumulative
Number of heads, x Probability, P(x)
probabilities
0 0.25
 For example, suppose you flip a coin two times. This simple
1 0.50
exercise can have four possible outcomes: HH, HT, TH, and
2 0.25
TT. Now, let the variable X represent the number of heads
that result from the coin flips. The variable X can take on the
values 0, 1, or 2; and X is a discrete random variable.

13 14

13 14

4.2 Variables 4.2 Variables


4.2.1 Random variables (cont.) 4.2.1 Random variables (cont.)
Continuous Probability Distributions Continuous Probability Distributions
 The probability distribution of a continuous random variable is  The probability that a continuous random variable falls in the
represented by an equation, called the probability density interval between a and b is equal to the area under the pdf
function (pdf). curve between a and b.
 All probability density functions satisfy the following  There are an infinite number of values between any two data
conditions: points. As a result, the probability that a continuous random
 The random variable Y is a function of X; that is, y = f(x). variable will assume a particular value is always zero
 The value of y is greater than or equal to zero for all
values of x.
 The total area under the curve of the function is equal to
one.
15 16

15 16
6/1/2020

4.2 Variables 4.2 Variables


4.2.1 Random variables (cont.) 4.2.1 Random variables (cont.)
Mean of a Discrete Random Variable Median of a Discrete Random Variable
 The mean of the discrete random variable X is also called the  The median of a discrete random variable is the "middle"
expected value of X, denoted by E(X). value. It is the value of X for which P(X < x) is greater than or
equal to 0.5 and P(X > x) is greater than or equal to 0.5.
E(X) = μx = Σ [xi*P(xi)]
where
 xi is the value of the random variable for outcome i,
 μx is the mean of random variable X,
 and P(xi) is the probability that the random variable will be
outcome i.

17 18

17 18

4.2 Variables 4.2 Variables


4.2.1 Random variables (cont.) 4.2.1 Random variables (cont.)
Problem Variability of a Discrete Random Variable
 The number of hits made by each player is described by the  The equation for computing the variance of a discrete
following probability distribution random variable is shown below.
Number of hits, x Probability, P(x)
0 0.10 σ2 = Σ{[xi - E(x)]2*P(xi)}
1 0.20
2 0.30 where
3 0.25  xi is the value of the random variable for outcome i,

4 0.15  P(xi) is the probability that the random variable will be


outcome i,
 What is the mean? What is the median?  E(x) is the expected value of the discrete random variable
19
x. 20

19 20
6/1/2020

4.2 Variables 4.2 Variables


4.2.1 Random variables (cont.) 4.2.1 Random variables (cont.)
Independence of Random Variables Sums and Differences of Random Variables: Effect on the
 When a study involves pairs of random variables, it is often Mean
useful to know whether or not the random variables are  Suppose you have two variables: X with a mean of μx and Y
independent. with a mean of μy. Then, the mean of the sum of these
 If two random variables, X and Y, are independent, they variables μx+y and the mean of the difference between these
satisfy the following conditions. variables μx-y are given by the following equations.
 P(x|y) = P(x), for all values of X and Y. μx+y = μx + μy and μx-y = μx - μy
 P(x ∩ y) = P(x) * P(y), for all values of X and Y.
 The above conditions are equivalent. If either one is met, the
other condition is also met  X and Y are independent.
If X and Y are independent  the correlation between X and Y
is equal to zero. 21 22

21 22

4.2 Variables 4.2 Variables


4.2.1 Random variables (cont.) 4.2.1 Random variables (cont.)
Sums and Differences of Random Variables: Effect on the Sums and Differences of Independent Random Variables:
Mean Effect on Variance
 The above equations for general variables also apply to  Suppose X and Y are independent random variables. Then,
random variables. If X and Y are random variables, then Var(X + Y) = Var(X - Y) = Var(X) + Var(Y)
E(X + Y) = E(X) + E(Y) and E(X - Y) = E(X) - E(Y) where
where Var(X + Y) is the variance of the sum of X and Y,
 E(X) is the expected value (mean) of X, Var(X - Y) is the variance of the difference between X and Y,
 E(Y) is the expected value of Y, Var(X) is the variance of X,
 E(X + Y) is the expected value of X plus Y, and Var(Y) is the variance of Y.
 and E(X - Y) is the expected value of X minus Y. Note: SD(X + Y) = sqrt[Var(X + Y)]
and SD(X - Y) = sqrt[Var(X - Y)]
23 24

23 24
6/1/2020

4.2 Variables 4.2 Variables


4.2.2 Discrete variables 4.2.2 Discrete variables
 Within a range of numbers, discrete variables can take on Binomial Distribution
only certain values.  Binomial Experiment
 Ex: Flip a coin and count the number of heads. The number  A binomial experiment is a statistical experiment that has
of heads will be a value between zero and plus infinity. Within the following properties:
that range, though, the number of heads can be only certain  The experiment consists of n repeated trials.
values  the number of heads is a discrete variable. And
because the number of heads results from a random process  Each trial can result in just two possible outcomes. We call
- flipping a coin - it is a discrete random variable. one of these outcomes a success and the other, a failure.
 The probability of success, denoted by P, is the same on
every trial.
 The trials are independent; that is, the outcome on one
trial does not affect the outcome on other trials.
25 26

25 26

4.2 Variables 4.2 Variables


4.2.2 Discrete variables 4.2.2 Discrete variables
Binomial Distribution (cont.) Negative Binomial Distribution
 A binomial random variable is the number of  Negative Binomial Experiment
successes x in n repeated trials of a binomial experiment.  The experiment consists of x repeated trials.
 The probability distribution of a binomial random variable is
 Each trial can result in just two possible outcomes. We call
called a binomial distribution. one of these outcomes a success and the other, a failure.
 The binomial probability refers to the probability that a
 The probability of success, denoted by P, is the same on
binomial experiment results in exactly x successes. It is also every trial.
known as the Bernoulli distribution.
 The trials are independent; that is, the outcome on one
 Ex: we see that the binomial probability of getting exactly one
trial does not affect the outcome on other trials.
head in two coin flips is 0.50.
 The experiment continues until r successes are observed,
where r is specified in advance.
27 28

27 28
6/1/2020

4.2 Variables 4.2 Variables


4.2.2 Discrete variables 4.2.2 Discrete variables
Negative Binomial Distribution Negative Binomial Distribution
 A negative binomial random variable is the number X of  A negative binomial random variable is the number X of
repeated trials to produce r successes in a negative binomial repeated trials to produce r successes in a negative binomial
experiment. experiment.
 The probability distribution of a negative binomial random  The probability distribution of a negative binomial random
variable is called a negative binomial distribution. The variable is called a negative binomial distribution. The
negative binomial distribution is also known as the Pascal negative binomial distribution is also known as the Pascal
distribution. distribution.

29 30

29 30

4.2 Variables 4.2 Variables


4.2.3 Continuous variables 4.2.3 Continuous variables
 Continuous variables can take on any value within a range of Normal distribution
values.  The value of the random variable Y is:
 Ex: We randomly select an individual from a population.
Then, we measure the age of that person. In theory, his/her 𝑒
𝑌 𝑓 𝑥
age can take on any value between zero and plus infinity, so 𝜎 2𝜋
age is a continuous variable. In this example, the age of the
person selected is determined by a chance event; so, in this  where
example, age is a continuous random variable.  X is a normal random variable,
 μ is the mean,
 σ is the standard deviation,
 π is approximately 3.14159, and

31
 e is approximately 2.71828. 32

31 32
6/1/2020

4.2 Variables 4.2 Variables


4.2.3 Continuous variables 4.2.3 Continuous variables
Normal distribution Normal distribution
 The graph of the normal distribution depends on two factors -
the mean and the standard deviation.
 The mean of the distribution determines the location of the
center of the graph.
 the standard deviation determines the height and width of the
graph.
 All normal distributions look like a symmetric, bell-shaped
curve.

33 34

33 34

4.2 Variables 4.2 Variables


4.2.3 Continuous variables 4.2.3 Continuous variables
Normal distribution Normal distribution
 The total area under the normal curve is equal to 1.
 The probability that a normal random variable X equals any
particular value is 0.
 The probability that X is greater than a equals the area under
the normal curve bounded by a and plus infinity (as indicated
by the non-shaded area in the figure below).
 The probability that X is less than a equals the area under the
normal curve bounded by a and minus infinity (as indicated
by the shaded area in the figure below).

35 36

35 36
6/1/2020

4.2 Variables 4.2 Variables


4.2.3 Continuous variables 4.2.3 Continuous variables
Normal distribution: every normal curve (regardless of its Standard Normal distribution: a special case of the normal
mean or standard deviation) conforms to the following "rule". distribution when µ =0 and σ2 =1.
 About 68% of the area under the curve falls within 1 standard  The standard normal probability density unction is shown in
deviation of the mean. the graph.
 About 95% of the area …. within 2 standard deviations …
 About 99.7% of the area … within 3 standard deviations …

37 38

37 38

4.2 Variables 4.2 Variables


4.2.3 Continuous variables 4.2.3 Continuous variables
Standard Normal distribution: Standard Normal distribution: finding probabilities by
 The normal random variable of a standard normal distribution applying the Z transformation
is called a standard score or a z-score.  It can be proven that:
 Every normal random variable X can be transformed into (a − μ) (b − μ)
𝑃 𝑎 𝑋 𝑏 𝑃 Z =𝑃 𝑧 𝑍 𝑧
a z score via the following equation: σ σ
(X − μ)
𝑧
σ
where
 X is a normal random variable,
 μ is the mean of X,
 and σ is the standard deviation of X.
39 40

39 40
6/1/2020

4.2 Variables 4.2 Variables


4.2.3 Continuous variables 4.2.3 Continuous variables
Standard Normal distribution: one-tailed probabilities Standard Normal distribution: two-tailed probabilities
 Only the area in the upper tail or the lower tail of a probability  The probability of interest is divided equally between the two
distribution is of interest: tails of the probability distribution
( − μ) ( / − μ)
𝑃 𝑋 𝑥 𝑃 Z =𝑃 𝑍 𝑧 𝑃 𝑋 𝑥 / 𝑃 Z =𝑃 𝑍 𝑧 /
σ σ
( − μ) ( − μ)
𝑃 𝑋 𝑥 𝑃 Z =𝑃 𝑍 𝑧 𝑃 𝑋 𝑥 𝑃 Z
/
=𝑃 𝑍 𝑧
σ / σ /

41 42

41 42

4.2 Variables 4.2 Variables


4.2.3 Continuous variables 4.2.3 Continuous variables
Student's t Distribution Student's t Distribution
 The t distribution (Student’s t-distribution) is a probability  However, sample sizes are usually small, and we do not
distribution that is used to estimate population parameters know the standard deviation of the population.
when the sample size is small and/or when the population  When either of these problems occur, statisticians rely on the
variance is unknown. distribution of the t statistic (the t score),given by:
 According to the central limit theorem, the sampling (𝑥̅ − μ)
𝑧 𝑠
distribution of a statistic will follow a normal distribution, as
long as the sample size is sufficiently large. 𝑛
 Therefore, when we know the standard deviation of the where
population  a z-score can be computed  using the normal x is the sample mean, μ is the population mean,
distribution to evaluate probabilities with the sample mean. s is the standard deviation of the sample,
43
and n is the sample size. 44

43 44
6/1/2020

4.2 Variables 4.2 Variables


4.2.3 Continuous variables 4.2.3 Continuous variables
Student's t Distribution  Degrees of Freedom Student's t Distribution  Properties:
 There are actually many different t distributions.  The mean of the distribution is equal to 0 .
 The particular form of the t distribution is determined by  The variance is equal to v / ( v - 2 ), where v is the degrees of
its degrees of freedom. freedom (see last section) and v ≥ 2.
 The degrees of freedom refers to the number of independent  The variance is always greater than 1.
observations in a set of data.  With infinite degrees of freedom, the t distribution is the same
 When estimating a mean score or a proportion from a single as the standard normal distribution.
sample, the number of independent observations is equal to
the sample size minus one.

45 46

45 46

4.2 Variables 4.2 Variables


4.2.3 Continuous variables 4.2.3 Continuous variables
Student's t Distribution  When to Use the t Distribution Student's t Distribution  When to Use the t Distribution
 The t distribution can be used with any statistic having a bell-  The sampling distribution of a statistic should be bell-shaped
shaped distribution (i.e., approximately normal). if any of the following conditions apply.
 The t distribution should not be used with small samples from  The population distribution is normal.
populations that are not approximately normal.  The population distribution is symmetric, unimodal,
without outliers, and the sample size is at least 30.
 The population distribution is moderately skewed,
unimodal, without outliers, and the sample size is at least
40.
 The sample size is greater than 40, without outliers.

47 48

47 48
6/1/2020

4.2 Variables 4.2 Variables


4.2.3 Continuous variables 4.2.3 Continuous variables
Student's t Distribution  probability Chi-Square Distribution  Chi-Square statistic
function  We select a random sample of size n from a normal
 The probability function for the t population, having a standard deviation equal to σ. We find
distribution is: that the standard deviation in our sample is equal to s. Given
these data, we can define a statistic, called chi-square
𝑡 𝑛 1 𝑠
𝑓 𝑡 𝑐 1 𝜒
𝑣 𝜎
Where
 c is a function of v which is used to
make the total area in the t distribution
equal to one.
49 50

49 50

4.2 Variables 4.2 Variables


4.2.3 Continuous variables 4.2.3 Continuous variables
Chi-Square Distribution Chi-Square Distribution
 If we repeated this experiment an infinite number of times, we
could obtain a sampling distribution for the chi-square
statistic  the distribution of the chi-square statistic is called
the chi-square distribution  probability density function:
𝑓 𝜒 𝑓 𝜒 𝑒
where
 f0 is a constant that depends on the number of degrees of
freedom, f0 is defined  the area under the chi-square curve
is equal to one.
 𝜒 is the chi-square statistic,
 v = n - 1 is the number of degrees of freedom, 51 52

51 52
6/1/2020

4.2 Variables 4.2 Variables


4.2.3 Continuous variables 4.2.3 Continuous variables
Chi-Square Distribution  Chi-Square properties Chi-Square Distribution  Cumulative Probability
 The mean of the distribution is equal to the number of  The total area under the curve is equal to 1. The area under
degrees of freedom: μ = v. the curve between 0 and a particular chi-square value is
 The variance is equal to two times the number of degrees of a cumulative probability associated with that chi-square
freedom: σ2 = 2*v value.
 When the degrees of freedom are greater than or equal to 2,  Ex: the shaded area represents
the maximum value for Y occurs when 𝜒 = v - 2. a cumulative probability
 As the degrees of freedom increase, the chi-square curve associated with a chi-square
approaches a normal distribution. statistic equal to A; that is, it is
the probability that the value of a
chi-square statistic will fall
53
between 0 and A. 54

53 54

4.2 Variables 4.2 Variables


4.2.4 Chebyshev’s Theorem 4.2.4 Chebyshev’s Theorem
For any numerical data set, (any k ≥ 1)
 at least 3/4 of the data lie within two standard deviations
of the mean, that is, in the interval with endpoints x±2s for
samples and with endpoints μ±2σ for populations;

 at least 1−1⁄k2 of the data lie within k standard deviations


of the mean, that is, in the interval with endpoints x±ks for
samples and with endpoints μ±kσ for populations.

55 56

55 56
6/1/2020

4.3 Sampling distributions 4.3 Sampling distributions


4.3.1 Sampling Distribution of the Mean (SDOTM) 4.3.1 Sampling Distribution of the Mean (SDOTM)
4.3.2 Sampling Distribution of the Sum (SDOTS)  A sampling distribution of the mean is a probability
4.3.3 Sampling Distribution of the Proportion (SDOTP) distribution consisting of the probabilities values assigned
to all the values that the mean of X can assume.
 The mean of the SDOTM is always equal to the mean of
the population from which the samples were taken:
𝐸 𝑋 𝜇 ̅ 𝜇

57 58

57 58

4.3 Sampling distributions 4.3 Sampling distributions


4.3.1 Sampling Distribution of the Mean (SDOTM) 4.3.1 Sampling Distribution of the Mean (SDOTM)
 When sampling is from an infinite population or from a finite  The cumulative distribution function is defined
population with replacement, the variance of the SDOTM
is: 𝐹 𝑥̅ 𝑃 𝑋 𝑥̅
𝜎
𝜎̅
𝑛  For any real number a, we have

 If sampling (n) is done without replacement from a finite 𝐹 𝑎 𝑓 𝑥̅


population (N) (n > 0.05N), then the variance of the SDOTM ̅
is:

𝜎 𝑁 𝑛
𝜎 ̅
𝑛 𝑁 1
59 60

59 60
6/1/2020

4.3 Sampling distributions 4.3 Sampling distributions


4.3.1 Sampling Distribution of the Mean (SDOTM) 4.3.1 Sampling Distribution of the Mean (SDOTM)
The central limit theorem: How to be sure about ‘normal The central limit theorem: sampling from a finite population
distribution’? with replacement
 In the real world of applied statistics, the shape of the  If all possible random samples of size n are drawn with
population distribution is unknown replacement from a finite population of size N that has
 Such population can be considered to be approximately finite parameters (µ, σ) and if 𝑋 = 𝑥̅ is calculated for each
normally distributed if the sample size are ‘sufficiently sample, then if n is sufficiently large, the resulting
large’!!! theoretical sampling distribution of the mean will be
approximately normally distributed with:
𝜇 ̅ 𝜇

𝜎
𝜎 ̅
𝑛
61 62

61 62

4.3 Sampling distributions 4.3 Sampling distributions


4.3.1 Sampling Distribution of the Mean (SDOTM) 4.3.1 Sampling Distribution of the Mean (SDOTM)
The central limit theorem: sampling from an infinite The central limit theorem: sampling from a finite population
population without replacement
 If all possible random samples of size n are drawn from an  If all possible random samples of size n are drawn without
infinite population that has finite parameters (µ, σ) and if replacement from a finite population of size N that has
𝑋 = 𝑥̅ is calculated for each sample, then if n is sufficiently finite parameters (µ, σ) and if 𝑋 = 𝑥̅ is calculated for each
large, the resulting theoretical sampling distribution of the sample, and if N is at least twice as large as n (N≥2n), then
mean will be approximately normally distributed with: if n is sufficiently large, the resulting theoretical sampling
𝜇 ̅ 𝜇 distribution of the mean will be approximately normally
distributed with:
𝜎 𝜇 ̅ 𝜇
𝜎 ̅
𝑛
𝜎 𝑁 𝑛
𝜎 ̅
63
𝑛 𝑁 1 64

63 64
6/1/2020

4.3 Sampling distributions 4.3 Sampling distributions


4.3.1 Sampling Distribution of the Mean (SDOTM) 4.3.2 Sampling Distribution of the Sum (SDOTS)
How large is ‘sufficiently large’???  All possible random samples of size n (X1,…,Xn) are drawn

 No absolute rule from an infinitely large, normally distributed population (µ,


σ), and the sum of values (Y) is calculated with the formula:
 The closer the population distribution is to normal, the
smaller the sample size needed 𝑌 𝑋
 A generally accepted rule of thumb: n ≥ 30

65 66

65 66

4.3 Sampling distributions 4.3 Sampling distributions


4.3.2 Sampling Distribution of the Sum (SDOTS) 4.3.2 Sampling Distribution of the Sum (SDOTS)
 The sampling distribution of the sample sum is exactly Applying the central limit theorem
normally distributed with:  If all possible random samples of size n are drawn from
either a finite population with replacement or an infinite
𝜇 𝑛𝜇 population, where the population has finite parameters (µ,
σ), and if the sample sum Y = y, is calculated for each
𝜎 𝑛𝜎 sample, then if n is sufficiently large, the resulting sampling
distribution of the sample sum Y will be approximately
normally distributed with parameters:
 The probabilities can be determined within SDOTS: 𝜇 𝑛𝜇

(a − μ ) (b −μ ) 𝜎 𝑛𝜎
𝑃 𝑎 𝑌 𝑏 𝑃 Z
σ σ
67 68

67 68
6/1/2020

4.3 Sampling distributions 4.3 Sampling distributions


4.3.3 Sampling Distribution of the Proportion (SDOTP) 4.3.3 Sampling Distribution of the Proportion (SDOTP)
 If all possible random samples of size n are drawn from If Applying the central limit theorem
all possible samples of size n are drawn from an infinite  The SDOTP is approximately normally distributed if n is
binomial population and the proportion of successes 𝑃 = 𝑝̅ “sufficiently large” (np ≥ 5 and nq ≥ 5) with:
is determined for each sample, then the resulting 𝜇 𝑝
theoretical SDOTP is a binomial probability distribution with:
𝑝𝑞
𝜎
𝐸 𝑃 𝜇 𝑝 𝑛
𝑝𝑞 And we have:
𝜎 
𝑛 𝑃 𝜇 ̅
Where: 𝑍
𝜎 ̅
 n: the number of trials in the binomial experiment
will have a distribution that approximates a standard normal
 p: the probability of success on an individual trial. distribution
69 70
 q: the probability of failure on an individual trial.
69 70

4.3 Sampling distributions


4.3.3 Sampling Distribution of the Proportion (SDOTP)
 If the distribution is approximately normally distributed, we
could determine probabilities with the relationship:

1 1
1 1 (a −μ ) (b − μ )
𝑃 𝑎 𝑍 𝑏 𝑃 2𝑛 Z 2𝑛
2𝑛 2𝑛 σ ̅ σ ̅

Where
 1/(2n) is a continuity correction

71

71

You might also like