SlideShare a Scribd company logo
1 of 201
Download to read offline
BUSINESS STATISTICS I
Lectures Part 2 — Weeks 43 – 50
Antonio Rivero Ostoic
School of Business and Social Sciences
 October −  December 
AARHUS
UNIVERSITYAU
BUSINESS STATISTICS I
Lecture – Week 41 (43)
Antonio Rivero Ostoic
School of Business and Social Sciences
 October 
AARHUS
UNIVERSITYAU
Today’s Agenda
1. Introduction to Estimation
– Properties of estimators
– Estimating µ when σ is known
– Sample size selection
2 / 24
Review of sampling distribution
Sampling distributions allow us to make inferences about population
parameters by means of sample statistics
Using sampling distributions the variability of the sample data was
given by the standard error of the mean (continuous), of the
proportion (discrete), or of the difference between two means, which
in all cases takes into account the sample size of the distribution
ª thus if the problem implies random samples we need to compute the standard
error first
Because of the central limit theorem we benefit from the standard
normal distribution when the sample size is sufficiently large
ª and employ z scores
3 / 24
Concept of Estimation
When we do not know something for certain, then we try to make
an educated guess about its value
In general in statistics we do not know the values of the
population parameters, but we typically have information about
individuals or cases from a conducted research on these
When we apply sampling, then we refer to the sample statistic as
the estimator of the population parameter, and the value of the
sample statistic is called the estimate
As a result, a significant part of statistical inference refers to the
process of estimation where we are able to generalize our results
beyond individual observations
4 / 24
Concept of Estimation II
Through sampling distributions we draw a relationship between
the characteristics of a sample and the estimated characteristics
of the population based on the sample
In such case the objective of estimation was to determinate the
approximate value of a population parameter in the basis of the
sample statistics
ª e.g. x that is the sample mean was used to estimate µ or the population mean
However beware that the process of estimating a parameter may
involve other types of calculation like with regression analysis...
5 / 24
Types of Estimators
There are two types of estimators:
Point estimator
Draws inferences about a population by estimating the value of an
unknown parameter using a single value or point
6 / 24
Types of Estimators II
Interval estimator
The inferences about a population are drawn by estimating the value
of an unknown parameter using an interval
 thus a point estimator is a value from x, whereas an interval estimator
is µ to be between a pair of values (with a given percentage of certainty)
7 / 24
Unbiased Estimator
Bias occurs when a statistic based on a sample systematically
misestimates the corresponding characteristic of the population
parameter
Our goal is to obtain an unbiased estimator of the population
parameter, which is an estimator where the expected value is
equal to the parameter
With a sampling distribution scheme this implies that the sample
statistic value we get on average equals to the value of the
parameter
Thus we consider the sample mean X is an unbiased estimator
of µ, and the sample proportion ˆP as an unbiased estimator of p
8 / 24
Consistency
Although unbiasedness is a quality that we want to have in our
estimation, by knowing that an estimator is unbiased we only know
that the value is close to the parameter value, but not how close
Another desirable quality of the estimator is its consistency that
occurs when the difference between the estimator and the
parameter grows smaller as the sample size grows larger
Thus X is a consistent estimator of µ because V(X) equals σ2/n,
which means that the variance of X grows smaller with larger
values of n
Likewise, ˆP as an consistent estimator of p since V(ˆP) equals
p(1 − p)/n, which means that the variance of ˆP grows smaller with
larger values of n
9 / 24
Sampling distribution of X
different sample sizes
µ
x
n = 25
n = 100
10 / 24
Relative Efficiency
We have seen that there are different measures for central
location like the mean and the median, and both the sample
mean and the sample median are unbiased estimators of the
mean population
However, the sample mean has smaller variance than the
sample median, which means that x is relative efficient when
compared to the sample median
Hence, an unbiased estimator is said to have relative efficiency
whenever it has smaller variance than another unbiased
estimator
11 / 24
Estimating the Population Mean
When Knowing σ
A sampling distribution serves to produce interval estimators for
the mean parameter
Recall the probability statement associated to the sampling
distribution (cf. last lecture)
P µ − Zα/2
σ√
n
 X  Zα/2
σ√
n
+ µ = 1 − α
Which has been used to perform inferences about the sample
mean for a given confidence level that is represented by 1 − α
By applying the central limit theorem, where Z = X−µ
σ/
√
n
, the
statement can be transformed into the confidence interval
estimator of µ:
P X − Zα/2
σ√
n
 µ  Zα/2
σ√
n
+ X = 1 − α
12 / 24
Confidence interval estimator of the population mean
The interval refers now to the population mean, and the
boundaries of the interval are calculated using z-scores:
Lower Confidence Limit (LCL):
x − zα/2
σ
√
n
Upper Confidence Limit (UCL):
x + zα/2
σ
√
n
 the limits for the confidence interval of the mean parameter are found by
subtracting and adding from and to the sample mean the maximum error estimate
13 / 24
Steps in statistical inference
 when you already have the data
1) Identify the appropriate statistical technique to use
ª in this case estimate µ with confidence limits x ± zα/2
σ√
n
2) Compute the statistics
ª the values needed for the calculation are x, zα/2, σ, n
3) Interpret the results
ª which need to be in accordance with the problem
14 / 24
Interpreting Confidential Interval Estimates
Remember that confidence intervals are derived for a sample
statistic and not for a parameter
ª and the interpretation should refer to this fact
Since the outcomes of the confidence intervals are coming
from a sampling distribution, they constitute a probability
statement for a given percent confidence level
This means that if we draw samples of size n from a
population, in the long run 1 − α% of the values of the statistic
will be such that the parameter would be located between ±
the resulted value
ª α% of the values for the statistic produces intervals not including the
parameter
15 / 24
Common Confidence Levels
1 − α α α/2 Zα/2
.90 .10 .05 z.05 = 1.645
.95 .05 .025 z.025 = 1.96
.98 .02 .01 z.01 = 2.33
.99 .01 .005 z.01 = 2.575
 estimations in social sciences are typically made for a 95%
confidence level
16 / 24
Example finding µ with known σ
Our vending machines delivers a soft drink can after few seconds
the costumer press the bottom, but the competition is about to
launch a new vending machine model that we suspect that is faster
than our product
• We need to estimate a 95% confidence interval estimate of the mean
from a sample of 15 machines, and we know from technical
specifications that the standard deviation from the mean in our
machines is .38 seconds.
Response time in seconds to deliver the product:
2.37 1.95 1.49 2.05 2.27 2.53 1.87 2.42 1.43 2.24 2.69 2.16 1.88 1.71 2.82
 CI estimator for µ with known σ:
x = 2.13. 95% confidence level means α = .05; zα/2 = z.025 = 1.96
x ± zα/2
σ√
n
 2.13 ± 1.96 .38√
15
 ‘error’: ± 0.19
Thus LCL = 1.93 and UCL = 2.32 or else 1.93; 2.32
17 / 24
Z Intervals for the Mean
We computed in the example both the sample mean and the maximum
error estimate, which is the product of the standard error of the mean
and zα/2 that acts as a multiplier
ª thus there was 1.96 standard errors above and below µ cut off the middle 95% of the
distribution
.95
−1.96 1.96
z
.025.025
18 / 24
Width of the Interval
Narrow intervals provide more precise information than wide
ones, and the width of the confidence interval has a direct link to
the values involved in the error estimate
These elements are:
• Standard deviation parameter, larger value of σ then wider intervals
• Chosen confidence level, larger 1 − α means also wider intervals
• Sample size, larger value of n then narrower intervals
19 / 24
Estimation of µ using the sample median
when knowning σ
It is also possible to compute confidence intervals for the
population mean using the sample median
Since we are dealing with a sampling distribution for a normal
population we need to compute the mean and the standard
error of the median (where m represents the sample median):
µm = µ
σm = 1.2533σ√
n
ª and 1.2533 is a factor that the average absolute deviation needs to be multiplied to
be a consistent estimator for the standard deviation
The confidence intervals are given by:
m ± zα/2
1.2533σ
√
n
20 / 24
Example
Estimation of CI using µ and m
We have the following random sample for a normal population
with σ = 2
1 1 1 3 4 5 6 7 8
Here x = m = 4
• A 95% confidence interval estimates using the sample mean is:
x ± zα/2
σ√
n
 4 ± 1.96 2√
9
 4 ± 1.307
• And using the sample median:
m ± zα/2
1.2533σ√
n
 4 ± 1.961.2533×2√
9
 4 ± 1.638
 As a result, the sample median is not as efficient an
estimator as the sample mean
21 / 24
Sample Size Selection
We have seen that the election of sample size has consequences
in the estimation of the mean parameter
On the other hand the sampling error was defined as the variability
of the sample mean from the population mean, which in this case
constitutes to the error of estimation
Since confidence intervals are expressed in terms of a probability
statement, the difference between the sample mean and the
population means is represented as:
P −Zα/2
σ
√
n
 X − µ  +Zα/2
σ
√
n
= 1 − α
Which means that
X − µ  Zα/2
σ
√
n
22 / 24
Sample Size Selection II
Hence we have a probability 1 − α that the error of the estimation
is less than the maximum error estimate we are disposed to
tolerate, and it is called the bound on the error of estimation or B:
X − µ  B
The sample size to estimate a mean is:
n =
zα/2 σ
B
2
• In our example the error in the estimate was .19, and in case we
want to decrease the bound on the error of estimation to .16 then
we need to calculate a new sample size
n =
zα/2σ
B
2
= 1.96×.38
.16
2
= 21.67
 Thus our sample size must be 22 to have a 95% confidence that the
error of the estimation in seconds will be no larger than 0.16
23 / 24
Summary
Parameter estimation is one of the main goals in statistical inference,
and this is done either by a point or by an interval estimator measure
ª we look for an estimator that is unbiased, consistent, and relative efficient to
other estimators
Confidence intervals for the population mean are probability
statements are based on sampling distributions where we compute
the limits of this parameter by adding and subtracting the maximum
error estimate from/to the sample mean
ª and within a determinate percent confidence level
We can define the width of the interval by adjusting the sample size,
the confidence level, or with a different standard deviation parameter
ª to reduce the value of the bound of the error of estimation it is needed to
calculate the selection of the sample size
24 / 24
BUSINESS STATISTICS I
Lecture – Week 42 (44)
Antonio Rivero Ostoic
School of Business and Social Sciences
 October 
AARHUS
UNIVERSITYAU
Today’s Agenda
1. Introduction to Hypothesis Testing
2. Testing µ when σ is known
3. Type II Error
2 / 31
Introduction to Hypothesis Testing
Besides estimation, another significant task in statistical
inference is the testing of different kinds of propositions or
hypotheses
Hypotheses are predictions on variables measured in the
study made through statements about their characteristics
However a hypothesis can relate also to the characteristic of a
population parameter and we can assess the validity of the
parameter with sample data by means of hypothesis testing
ª another name for hypothesis testing is significance test
3 / 31
Null and Alternative Hypotheses
A hypothesis may arise from a theory that drives the research,
and it is expressed with a statement such as: “human activities
affect climate change”
However another theory may have a different statement saying
that: “human activities do not affect climate change”
Hence there are two hypotheses that contradict to each other:
1) the null hypothesis, represented by H0, which is the
hypothesis that we are going to test
2) the alternative (or research) hypothesis, represented
by H1, which will be adopted in case that H0 is rejected
4 / 31
Relations between H0 and Outcomes
in hypothesis testing
STATISTICAL DECISION
Do not reject H0 Reject H0
REALITY
H0 is true Correct Type I error
H0 is false Type II error Correct
 Thus there are two options for correct decisions, and two
options that are errors in the judgment
5 / 31
Two Types of Error
It is important to notice that we do not accept H0, but we just
fail to reject the null hypothesis with the test
From such process two types of error can arise:
Type I error
that occurs when we reject a true null hypothesis
Type II error
that occurs when we do not reject a false null hypothesis
6 / 31
Types of Error and Probabilities
The probability of committing any of these error types is
denoted as:
• P(Type I error) = α = P(rejecting H0 | H0 is true)
• P(Type II error) = β = P(not rejecting H0 | H0 is false)
Where α-level is known as the significance level because it
constitutes the level at which the null hypothesis is rejected
α and β are inversely related, and this means that a large
value of α implies a small value of β and vice versa
7 / 31
Hypothesis Testing about Parameters
In statistics we typically test hypotheses about parameters, and
the null hypothesis constitutes a statement about the parameter
The statement about a population parameter is given by means
of a test statistic in which a randomly sample is taken from the
population, and it typically involves a point estimate of the
parameter to which the hypothesis refers
When the estimate of the test statistic is not consistent with the
null hypothesis, we conclude that there is not enough evidence
to support the statement about H0
ª and hence we adopt the alternative hypothesis
 in a decision making problem the null hypothesis will represent the
status quo for the decision maker and no action will be taken
8 / 31
Hypothesis Testing about Parameters
Examples
We have seen in the examples that: the mean of our company’s
vending machines electricity consumption is 460 kwh, or
H0 : µ = 460
• Is there enough evidence that the mean parameter is not
equal to this value?
H1 : µ = 460
• What if we want to test whether there is evidence of an
increase or decrease in the average electricity
consumption of the machines:
H1 : µ  460
H1 : µ  460
 Similar statements are made for µ less/more than or equal to a certain value
9 / 31
Hypothesis Testing about Parameters III
In practice the null hypothesis defines a distinctive of the population
and we test whether or not the plausible distribution of the
characteristics of all samples resembles to the population
ª where sample values within the confidence level support the null hypothesis
If the sample is very different from the population as defined by H0
then it is unlikely to come from this population, and hence the sample
must come from a population in which H0 is false
On the other hand, if the sample is typical of the majority of the
samples we would have obtained if H0 is true, then it leads us to
conclude in favor of the null hypothesis
In other words, we reject the null hypothesis in favor of the alternative
if the value of the sample statistic is much different relative to the
population parameter
ª conversely if the sample statistic is close to the parameter value we don’t reject H0
10 / 31
Rejection Region
To reject a null hypothesis in favor of an alternative we define a
rejection region as the set of test statistic values for which the
test rejects the null hypothesis at a particular α-level
A rejection region implies that the value of the sample mean x
is greater than if it would be been large enough to reject H0 and
this is represented by xL:
x  xL
Hence the probability of rejecting a true H0 – or of committing a
Type I error – is:
α = P(x  xL | H0 is true)
11 / 31
Sampling distribution with rejection region
for X
µ xL
x
α
Rejection region
12 / 31
Hypothesis testing
graphically speaking
µ0 µ1
H0 H1
x
13 / 31
Hypothesis testing II
graphically speaking
µ0 µ1xL
H0 is not rejected H0 is rejected
H0 H1
α
β
x
14 / 31
Testing µ when σ is known
For a sampling distribution of x that is approx. normal with mean µ
and σ/
√
n as its standard deviation, we can standardize the
probability statement with the z scores of the Z distribution
P x−µ
σ/
√
n
 xL−µ
σ/
√
n
= P Z  xL−µ
σ/
√
n
= α
Since both α and the probability statement involve Z, its critical
value is
xL − µ
σ/
√
n
= zα
 and from this expression then we can obtain the rejection region xL
However, rather than the rejection region is set in terms of x, we
apply a standardized test statistic z = x−µ
σ/
√
n
in which all scores
greater than the critical value zα correspond to the rejection region
z  zα
15 / 31
Sampling distribution with rejection region
for Z
0 zα
z
α
Rejection region
16 / 31
Example
Testing µ when σ is known
We have µ = 460 as the average electricity consumption in kwh
for our machines with σ = 5
• Compute the rejection region for a sample mean of 465 with
random sample size 3 and a 5% significance level
xL−µ
σ/
√
n
= zα  xL−460
5/
√
3
= 1.645  xL = 464.7
Which means that the rejection region is:
x  464.7
Since the sample mean of 465 is in the rejection region we
reject the null hypothesis
 We conclude that there is sufficient evidence that the average
electricity consumption for our machines exceeds 460 khw
17 / 31
Example
Standardized test
With a standardized test statistic we check that
z  zα
z = x−µ
σ/
√
n
= 465−460
5/
√
3
= 1.73
Because the value of z (= 1.73) is greater than the z-score of
the chosen significance level (z.05 = 1.65), then we reject the
null hypothesis
 ...and conclude once more that there is sufficient evidence
that the average electricity consumption for our machines
exceeds 460 khw
ª The results of both the test statistic x and the standardized test statistic z
are identical, and hence the standardized test statistic is typically used and
it is just called as the test statistic
18 / 31
p-Value
Any test is said to be statistically significant whenever a null
hypothesis is rejected no matter what significance level is
chosen
However the testing method used with the rejection region
produces a yes/no response
ª which is in the form of rejecting or not the null hypothesis in favor of H1
The p-value is the probability of a test statistic at least as
extreme as the one from the sample if the null hypothesis is true
ª this is actually the calculation of the observed significance level
Using the test statistics this probability is:
p-value = 1 − P(Z  z)
19 / 31
Computing the p-value
In order to compute the p-value the example we calculate the
probability of observing a sample mean at least as large as
465 given that µ = 470
That is,
p-value = P(X  465) = x−µ
σ/
√
n
 465−460
5/
√
3
= P(Z  1.73)
= 1 − P(Z  1.73) = 1 − .9582 = 0.0418
As a result, the probability of observing a sample mean at
least as large as 465 given that µ = 470 is 4%
ª which is relative small and we reject H0 in favor of the
alternative hypothesis
20 / 31
Test statistics  p-values
example: µ = 460, σ = 5, n = 3
We obtain different p-values for different scores of the sample mean:
x z p-value
460 0 .500
462 0.69 .244
465 1.73 .042
467 2.42 .008
470 3.46 .000
21 / 31
Test statistics  p-values II
We observe from the example table that the closer the sample
mean to µ, the larger the p-value
This implies that the smaller the p-value, the more strongly the
data contradict the null hypothesis
ª and there is more statistical evidence to support the alternative hypothesis
And the more evidence, the more statistical significant the test is
p-values are thus described as:
• p-value  .01 Highly significant
• p-value  .05 Significant
• p-value  .10 Not significant
22 / 31
Interpreting the p-value
Recall that both the p-value and the significance level are
expressed in terms of probabilities
On the other hand the rejection region is the collection of points
where the null hypothesis would be rejected, and part of this area
is delimited by a given critical value
If the test statistic is in the rejection region, the p-value is smaller
than the significance level, which means that we reject H0
However in such statistical inference we do not prove anything:
– when we reject the null hypothesis we just conclude that there is
enough statistical evidence that H1 is true and H0 is false
– when we fail to reject the null hypothesis, we only conclude that
there is not enough statistical evidence that H1 is true
ª we never have enough statistical evidence to conclude that H0 is true
23 / 31
One- and Two-Tail Tests
The value stated in H0 of the example was µ0 = 465 and we wanted to
test whether or not µ equals to this value of the sample mean
A two-tail test is: H0 : µ = µ0
H1 : µ = µ0
whereas there are two one-tail tests, one for the right:
H0 : µ = µ0
H1 : µ  µ0
and another for the left part of the distribution:
H0 : µ = µ0
H1 : µ  µ0
ª the H0 in a one-tail test is also expressed as H0 : µ or µ0
24 / 31
Computing β
Recall that β represents the probability of committing a Type II error,
and it occurs when we fail to reject a null hypothesis that is false
The calculation of β implies an alternative value of the population
mean in terms of an unstandardized test statistic X
For instance we can compute the probability of fail when we take no
action when the energy consumption of the machines in our example
is e.g. 470 kwh
Thus the probability of a Type II error with such condition is:
β = P(X  xL | µ = 470)
25 / 31
Example
computing β
In case that the hypothesized population mean is 470 kwh with
σ = 5, and a sample size of 3, the value of β for a 5% confidence
level is:
β = P X−µ
σ/
√
n
 464.7−470
5/
√
3
= P(Z  −1.84) = 0.03
Thus when the mean is 470, the probability of incorrectly not
rejecting a false H0 is 3%
26 / 31
β with a different α
The common significance level for social sciences is 5%; however if we
change the α level, then we count with a different value of β as well
For example, for a 1% significance level then z  z.01 = 2.33
and the critical region becomes
x  466.72
For µ = 470 the probability of a Type II error is:
β = P X−µ
σ/
√
n
 466.72−470
5/
√
3
= P(Z  −1.34) = 0.09 or 9%
 hence there is the inverse relationship between α and β
27 / 31
β and sample size
By increasing the sample size to n = 5 we count with another
critical region
x  463.68
And for µ = 470 and a 5% significance level the probability
of a Type II error becomes:
β = P X−µ
σ/
√
n
 463.68−470
5/
√
5
= P(Z  −2.83) = 0.0023 ≈ 0
 thus the better information is, the smaller probability of a Type II error
28 / 31
Power of a test
The power of a test is the probability of rejecting a null
hypothesis that is false:
power = 1 − β
µ0 µ1zα
H0 is rejected
H0 H1
α
1 − β
z
29 / 31
Operating Characteristic Curve
The power of a test is an indicator of its performance, and –
having two tests with different power indices – we prefer the test
with the higher power value
Since power is related to Type II error, then by increasing the
sample size, we increase also the power of the test
Such relationship is represented by an operating characteristic
curve or OC curve where power for different means is a function
of the sample size
The plotting of OC curves with different sample sizes is very
useful e.g. for choosing a sampling plan
ª in such plot values for β and for µ are in the y and x axes respectively
30 / 31
H1 and Types I and II Errors
Recall that the alternative hypothesis represents the condition
we are investigating
ª that is why it is also called the research hypothesis
The question is whether or not taking an action is the
appropriate decision
ª in the example redesigning the machines for lower energy consumption
We have to try to avoid concluding that there is enough evidence
that maintaining the status quo:
1) is not cost-effective when in reality it is (Type I error)
2) is cost-effective when in reality it is not (Type II error)
 Thus by taking or not taking an action there is a potential of making an
error, and we have to choose by calculating the greater cost
31 / 31
BUSINESS STATISTICS I
Lecture – Week 43 (45) · Summary
Antonio Rivero Ostoic
School of Business and Social Sciences
 October 
AARHUS
UNIVERSITYAU
Today’s Agenda
Assignment 1:
Probabilities, distributions, expected value and variance, ...
Assignment 2:
Hypothesis testing, confidence intervals, sampling, ...
Assignment 3:
Expected variance, SD, covariance, ...
2 / 18
Assignment 1
Question 1a
In a university there are three study programmes, A1, A2, and A3,
with an enrolment of respectively 50%, 30%, and 20% of
undergraduate students.
There are 60% of the students that are graduated, B, and from them:
• 25% choose programme A3
• twice as many that follow programme A2 choose programme A1
Q 1a. State the information (and comment)
- P(A1) = .50 P(A2) = .30 P(A3) = .20
- P(B) = .60 ⇒ P(B ) = .40
- P(A3 | B) = .25
-
P(A1 | B)
P(A2 | B)
= 2
3 / 18
Question 1b
Assignment 1
Q 1b. From those following A3, how large is the proportion that
graduates?
• We want to find P(B | A3), which is the conditional probability
of two dependent events, and we can use the Bayes theorem:
P(B | A3) =
P(B ∩ A3)
P(A3)
=
P(B) · P(A3 | B)
P(A3)
=
.60 × .25
.20
= .75
 There is a 75% probability that a student that follows
programme A3 graduates from this education
ª Note that P(B ∩ A3) = P(B and A3), and P(B ∪ A3) = P(B or A3)
4 / 18
Question 1c
Assignment 1
Q 1c. From those following A1, how large is the proportion that does
not graduate?
• Now we want to find P(B | A1):
P(B | A1) =
P(B ∩ A1)
P(A1)
=
P(B ) · P(A1 | B )
P(A1)
=
.40 × P(A1 | B )
.50
ª In this case we have to find first the conditional
probability P(A1 | B )
5 / 18
Question 1c cont. – Assignment 1
• Remember that we want to find P(A1 | B ).
- From 1 − P(A3 | B) we have that P(A1 | B) + P(A2 | B) = 1 − .25 = .75
also from
P(A1 | B)
P(A2 | B)
= 2 we deduce that P(A2 | B) = .75
3
= .25
which means that P(A1 | B) = .50 then P(B ∩ A1) = .60 × .50 = .30
- For P(B ∩ A1) the following expression applies:
P(B ∩A1)
P(B ∩ A1)
=
P(B )
P(B)
 P(B ∩ A1) = .30×.40
.60
= .20
- From P(B ) · P(A1 | B ) = P(B ∩ A1) we deduce that P(A1 | B ) = .20
.40
= .50
as a result, P(B | A1) = .40×.50
.50
= .40
 There is a 40% probability that a student that follows
programme A1 does not graduate from this education
6 / 18
Question 1 – Assignment 1
Probability tree
•
P(B )
P(A3 | B )
P(A2 | B )
P(A1 | B )
.50.40
P(B)
P(A3 | B)
.25
P(A2 | B)
P(A1 | B)
.50
.60
P(B ∩ A1) = .30
P(B ∩ A1) = .20
7 / 18
Question 2
Assignment 1
Assume that the number of graduates from programme A3 follows the
Poisson distribution with µ = 15.
Q 2a. What is the expected number of graduates from this study
programme, and what is the standard deviation?
X: number of graduates from A3
X ∼ P(µ = 15)
ª Always check and comment first the assumptions of the distribution
• E(X) = V(X) = µ = 15
• SD(X) = V(X) =
√
15 = 3.873
 The expected number of students who graduate from A3 is 15 with
a standard deviation of 3.873
8 / 18
Question 2b
Assignment 1
Q 2b. What is the probability that more than 20 students graduate
from study programme A3?
• This is P(X  20 | µ = 15) = 1 − P(X 20 | µ = 15)
and from the Poisson probabilities table we obtain the last
value
which is = 1−.917 = .083
 There is 8.3% probability that more than 20 students
graduate from programme A3
9 / 18
Question 3
Assignment 1
Q 3. What is the probability that more than 20 out of 25 of those
following study program A3 graduate?
ª Hint: use your answer from question 1b
X: number of graduates from A3
X ∼ B(n = 25, p = .75)
ª first check and comment the assumptions of the distribution
• Here we want P(X  20 | n = 25, p = .75) = 1 − P(X 20 | n = 25, p = .75)
and from the Binomial table for n = 25, p = .75, and x 20 we obtain
= 1− .7863 = .2137
 There is 21.37% probability that more than 20 out of 25 of those
following program A3 graduate from this study
10 / 18
Assignment 2
Question 1
The height of 20 randomly chosen people enrolled at a university has
been measured with an average of 182cm, and young people in general
have an average height of 180cm with a standard deviation of 12cm.
Q 1. Are the people just enrolled at a university taller than young
people in general?
• First, our parameter of interest is young people’s height, µ
Population: µ = 180, σ = 12
• Then we formulate the null and alternative hypothesis
H0 : µ = 180
H1 : µ = 180
ª although from the question one may say that H1 : µ  180, the research hypothesis is
formulated before the sampling takes part and it just suggests that the average height
among young people is just different
 Sample. X: height of people just enrolled at the university
x = 182, n = 20
11 / 18
Question 1 cont. – Assignment 2
• The next step is to state the significance level, and in this case
we assume a standard significance level of 5% or α = .05
• The rejection region corresponds here to a two-tail test with the
rejection region in both extremes of the sampling distribution
zα/2 = z.05/2 = z.025 = −1.96 and z1−α/2 = z1−.05/2 = z.975 = 1.96
ª if z  −1.96 or z  1.96 we reject H0; otherwise H0 is not rejected
• We select and compute the test statistics for µ, σ known (z-test)
z = zobs = x−µ
σ/
√
n
= 182−180
12/
√
20
= .75
 since zobs is not in the rejection region we have not sufficient
statistical evidence to reject H0
12 / 18
Question 1 cont. (2) – Assignment 2
• The p-value should be computed as well
p-value = 2 · P(Z  .75)
= 2 · P(Z  −.75) = 2 × .2266 = .4532
 having a large p-value, we are unable to reject the null
hypothesis in favour of the alternative
• We conclude that the average height of people just enrolled at
the university is not different than young people in general
13 / 18
Question 2
Assignment 2
Q 2. Construct a 95% confidence interval for the height of people
enrolled.
• This is a confidence interval estimator of the population mean, µ
for σ = 12; x = 182, n = 20; 1 − α = .95 (i.e. the confidence level)
• Confidence limits for µ are x ± z1−α/2 · σ√
n
where z1−α/2 = z.975 = 1.96
µ = 182 ± 1.96 × 12√
20
= 182 ± 1.96 × 2.68  µ = 182 ± 5.26
 µ ∈ [176.74; 187.26]
14 / 18
Question 3
Assignment 2
Q 3. What is the probability that a randomly chosen enrolled
person is taller than 192cm?
• Since the standard deviation parameter is 12cm and
assuming that the population is approximately normally
distributed, we can then apply the empirical rule where
≈ 68% of all observations fall within one standard
deviation.
 As a result, approximately 16% of a randomly chosen
enrolled person is taller than 192cm
15 / 18
Assignment 3
Question 1
You own properties X and Y that are to be sold by auction with
estimate values of 10 and 20 million respectively. The bids for
both properties are assumed to be approx. normal distributed
with standard deviations of 1 and 2 million respectively.
Q 1. What is the standard deviation that the auction brings for the
two properties? (where S = X + Y)
• Here we apply the law of variance for two random variables
V(X + Y) = V(S) = V(X) + V(Y) + 2 · Cov(X, Y)
assuming that X and Y are independent to each other, Cov(X, Y) = 0
V(S) = 12 + 22 + 0 = 5
SD(S) = V(S) =
√
5 = 2.24
 If X and Y are uncorrelated, then the standard deviation for
the two properties is 2.24 and the variance is 5
16 / 18
Question 3
Assignment 3
Q 3. What is standard deviation of what the auction will produce for
two properties assuming that the correlation coefficient is .4?
• When the correlation (i.e. the proportion of the covariance of
X, Y and their SDs) differs from 0 then there is a linear
relationship among the involved variables
ρ =
σxy
σxσy
=
Cov(X,Y)
σxσy
 Cov(X, Y) = ρ · V(X) · V(Y)
Cov(X, Y) = .4 × 12 × 22 = .8
- Hence V(S) = 5 + 2 × .8 = 6.6  SD(S) = V(S) =
√
6.6 = 2.57
 For dependent variables X and Y the standard deviation for
the two properties is 2.57 and the variance is 6.6
17 / 18
Question 4
Assignment 3
Q 4. What is the probability that the auction will produce more
than 31 million for the two properties?
• Assuming independence among X and Y:
P(S  31 | µ = 30; σ = 2.24) = P(S−µ
σ  31−30
2.24
) = P(Z  31−30
2.24
)
= P(Z  .45)  1 − P(Z  −.45) = .3264
• Assuming dependence:
P(S  31 | µ = 30; σ = 2.57) = P(S−µ
σ  31−30
2.57
) = P(Z  31−30
2.57
)
= P(Z  .39)  1 − P(Z  −.39) = .3483
18 / 18
BUSINESS STATISTICS I
Lecture – Week 46
Antonio Rivero Ostoic
School of Business and Social Sciences
 November 
AARHUS
UNIVERSITYAU
Today’s Agenda
1. Brief Review on Hypothesis Testing
2. Inference about µ when σ is unknown
– test statistic
– p-value
– required conditions
– estimation for finite populations
2 / 22
Review of Hypothesis Testing
Hypothesis testing is actually null hypothesis testing and it
concerns a population parameter
The research hypothesis must contradict the proposition of
the null hypothesis, and it constitutes the investigator’s belief
on such parameter
The decision rule to reject or not the null hypothesis
depends on:
• the formulation of H1
• the test statistic (and related p-value)
• the level of significance α
3 / 22
Review of Hypothesis Testing
Test statistic
Loosely speaking, a test statistic is a measure of how extreme a
statistical estimate is
A test statistic (like the z-statistic) is the proportion of:
• the departure of an estimated parameter from its theoretical value
• to its standard error
The use of the standard error implies that the test statistic links
the null hypothesis to sample data
 If the sample data are not very unlikely if the null hypothesis is
true then we fail to reject the null hypothesis
 If the sample data are very unlikely if the null hypothesis is true
then we reject the null hypothesis
ª in this case we should report the p-value as well
4 / 22
The z-statistic
To make inferences about the population mean we applied a test
statistic based on the standardized normal distribution
z =
x − µ
σ/
√
n
That is the proportion of the difference of the mean statistic and
parameter to the standard deviation of the sampling distribution
 But the standard error of the mean requires knowing the
standard deviation of the population, which typically is unknown
5 / 22
The t-statistic
A more realistic scenario is to make estimations and testing
of the population mean when the standard deviation
parameter is not known
When σ is unknown then the standardized normal distribution
becomes insufficient
However we can make the calculations of the standard error
with the sample standard deviation s rather than σ, and this
type of assessment correspond to the t-statistic
6 / 22
Inference about µ when σ is unknown
Test statistic
When the standard deviation parameter is unknown the test
statistic for the population mean is defined as
Test statistic for µ, σ unknown
t =
x − µ
s/
√
n
that is Student t distributed with ν = n − 1 degrees of freedom
• This is called a one sample t-test, and assumes a normal population
7 / 22
Inference about µ when σ is unknown
Confidence estimator
The confidence limits for the t statistic is defined as well
Confidence interval estimator for µ, σ unknown
x ± tα/2
s
√
n
(ν = n − 1)
that is for the same number of degrees of freedom and a
pre-established significance level
8 / 22
t and Z distributions
0
Z
t
ª Recall that both distributions are symmetric about 0, and that as n → ∞, t → z
9 / 22
Example t-statistic
Vending machines
A random sample of 15 of our vending machines shows that the
response time in seconds to deliver a soft drink is 2.125
seconds on average. Data cf. lecture week 41(43)
But the competition is about to launch a new vending machine
model that might deliver the product faster than ours and
according to their specifications it is going take about 2
seconds.
 Do we have enough evidence to conclude that our vending
machines are still competitive?
• In this case the research hypothesis is in relation to the
competition
H1 : µ  2
whereas the null hypothesis is
H0 : µ = 2
10 / 22
Example t-statistic II
Since we do not count with the population standard deviation, we
apply the t test statistic with the usual 5% α level and check that
t  tα,ν
ª In this case we need the value of s, which is .411
• The test statistic is computed next
t = 2.125−2
.411/
√
15
= 1.18
and we calculate the rejection region for n − 1 df as
t.05,14 = 1.761
ª Because the score of the test statistic is smaller than the
critical value we do not reject the null hypothesis in favor to H1
 There is not sufficient statistical evidence that the response time
for our machines exceeds the 2 seconds
11 / 22
The p-value
Recall that the p-value is the probability of a test statistic at
least as extreme as the one from the sample given that the
null hypothesis is true
That is the probability of getting the observed value of the
test statistic, or a value with even greater evidence against
H0, if the null hypothesis is true
Thus the p-value is the measure of the strength of the
evidence against the null hypothesis
 If p-value α, the null hypothesis is rejected and the evidence
against H0 is significant at the α level of significance
12 / 22
p-value
z test
For the z statistics, we can get exact p-values from the cumulative
standardized normal probabilities table
Lower-tail
p-value = P(Z  zobs)
Upper-tail
p-value = P(Z  zobs)
= 1 − P(Z  zobs)
Two-tail
p-value = P(Z  zobs) or P(Z  −zobs)
= 2 · P(Z  |zobs|)
= 2 · 1 − P(Z  |zobs|)
13 / 22
p-value
t test
In the case of the t-statistic the critical values of the Student t
distribution provides a range for the p-value
For the example, we find from the t table for a sample size of
15 that the closest critical value to the t score is
t(.100,14) = 1.345
and
1.345  1.18
which means that
.10  P(t  1.18)
and hence we can reasonably say that p-value  10%
14 / 22
Example t-statistic revisited
Vending machines
In order to be ‘competitive’ our machines should be faster
than the machines of the competition, and the research
hypothesis can be formulated as
H1 : µ  1.9
In this case the outcome of the test statistic becomes
t = 2.125−1.9
.411/
√
15
= 2.12
ª Now the test statistic score is greater than the critical
value at .05 α level, which means that we reject the null
hypothesis in favor of the alternative
 As a result there is enough statistical evidence that the
response time for our machines exceeds the 1.9 seconds
15 / 22
Example t-statistic revisited II
Vending machines
For a t score of 2.12 the p-value is calculated as follows
1.761  2.12  2.145
which means that
.05  P(t  2.12)  .025
 Thus the p-value lies between 2.5% and 5% and it is under
the significance level, which means that H0 is rejected in
favor of the alternative
16 / 22
Required conditions
t-statistic
The t-statistic assumes that the population from which the
sample comes from is normal distributed
In fact the t-test has been shown to be robust, which means
that the estimations are still valid for nonnormal porpulations
ª this statistic may not work for extremely nonnormal populations
Consequently it is important to check this required condition
by plotting the histogram of the sample data
17 / 22
Histogram for the Example
Vending machines
1.5 2 2.5 3
0
1
2
3
4
Time (seconds)
Frequency
18 / 22
Finite populations
t-statistic
The test statistics used assume populations with infinite size,
but in practice most of the populations are finite
For populations with small size we need to correct the
confidence estimators and test statistics with a factor, which is
close to 1 with relative large populations
ª and thus we ignore the population correction factor
A ‘small’ size population is less than 20 times the sample size
19 / 22
Finite populations
Confidence estimators
One advantage of having finite populations is that we can
produce confidence interval estimators of the total population
This is done by multiplying the confidence limits of the mean
estimate by the population size
x ± tα/2
s
√
n
· N
20 / 22
Example Confidence Interval Estimator
Vending machines
For an upper tail test statistic, a 95% confidence interval
for the mean is calculated as
x − t1−α,ν · s√
n
 2.125 − t.95,14 × .411√
15
 2.125 − 1.761 × 0.11
ª LCL = 1.93
And a 99% confidence interval is
2.125 − t.99,14 × .411√
15
 2.125 − 2.624 × 0.11
ª LCL = 1.84
21 / 22
Summary
Both the z-test and the t-test is to make inferences about the
population mean
The difference between these two statistics is that the
standard error of the mean of the t statistic is based on the
sample standard deviation, whereas the z-statistics requires σ
This means that the t-test is more realistic since we typically
do not know the value of the standard deviation parameter
22 / 22
BUSINESS STATISTICS I
Lecture – Week 47
Antonio Rivero Ostoic
School of Business and Social Sciences
 November 
AARHUS
UNIVERSITYAU
Today’s Agenda
1. Confidence interval estimators for statistical inference
2. Inference about a population variance
– test statistic
– confidence estimator
– p-value
2 / 21
Intro
Most of the statistical inference we have seen so far has been
made through a hypothesis testing
We used a test statistic for a single population mean and we
compared a group of data to a theoretical value
Hypothesis testing results in either rejecting or not rejecting H0
However another way to draw conclusions about a parameter
like the population mean can also be made by constructing a
confidence interval about the mean
 As a result the inference process about a parameter implies both
estimating a value and testing a hypothesis
3 / 21
Confidence interval approach
µ
In the formulation of the null hypothesis the question is many
times whether or not the true e.g. mean of the population agrees
with an assumed mean
Such type of question gives rise to a two-tailed test, and the
interval estimator for the population mean corresponds to a
two-sided confidence interval
So the boundaries of the interval for µ when σ is unknown for
ν = n − 1 is
x ± tα/2, ν · s√
n
That leads to lower and upper confidence limits depending on the
direction of the maximum error estimate
4 / 21
Confidence interval approach II
µ
However, H0 can be formulated with other types of questions
such as the true mean is less or greater than the assumed mean
In such cases we perform a one-tailed test, and for these two
other cases we compute a one-sided confidential interval for the
population mean
 Lower and Upper one-sided confidence interval for µ when σ is
unknown for ν = N − 1 are
µ  X + tα, ν · s√
N
and
µ  X + t1−α, ν · s√
N
5 / 21
Confidence Interval One-sided Upper Tail
Example w 47 revisited
In the vending machines example (cf. lecture week 47), the 95%
one-sided CI for the mean for an upper tail t test statistic was
defined as
x − t1−α, ν ·
s
√
n
In this case the multiplier for the one-sided upper tail
represents a probability less than the critical value t1−α, ν
And this means we consider the left part of the critical values
of the Student t distribution
 Thus the CI estimation for t.95, ν and t.99, ν correspond to α = .05 and
α = .01 respectively in the right tailed t table
6 / 21
Inference about variability
Besides the population mean, another parameter of interest in statistical
inference is the variability in the population
ª Inferences about the population variability allow us e.g. to measure the risk or
the consistence of a product or process according to a determinate standard
Typically we want to see and test whether or not the sample data is
consistent with the nominal standard deviation parameter
However since there is no statistical technique to test directly σ, we can
indirectly perform such type of assessment by testing the variance of
the population, σ2
Hence, as with the population mean, the research questions regarding
the true variance is whether or not agree with an assumed value, or if is
greater or less than the nominal value
H1 : σ2
= σ2
0
H1 : σ2
 σ2
0
H1 : σ2
 σ2
0
7 / 21
The chi-squared statistic
Testing and estimating a population variance
To test hypotheses about the population variance corresponds
to the chi-squared statistic or χ2-statistic
χ2 =
(n−1)s2
σ2
0
that is chi-squared distributed with ν = n − 1 degrees of freedom
 This test statistic employs the sample standard deviation s and
it assumes a normal population with variance σ2
8 / 21
Chi-squared distribution
plot
0
χ2
f(χ2
)
9 / 21
Critical values of the χ2
distribution
Unlike the standard normal and t distributions, the χ2 distribution
is non-negative and asymmetrical
This means that while for a two-tailed t test we applied the rule
t1−α, ν = −tα, ν, for the chi-square statistic we require distinct
critical values for both tails of the distribution
 Sometimes the upper- and lower-tail critical values of the χ2
distribution are given in separate tables or else in a single table
The critical values of the chi-square distribution allows to
demarcate the rejection region of the χ2 statistics, and they
depend on the chosen α level and the value of ν
10 / 21
Critical values of the χ2
distribution II
To reject H0 we check for a two-tailed test that
χ2  χ2
α/2, ν or χ2  χ2
1−α/2, ν
Whereas for an upper and lower tailed test the null
hypothesis is rejected if
χ2  χ2
α, ν
χ2  χ2
1−α, ν
11 / 21
Example χ2
statistic
Vending machines
We have seen previously from a random sample n = 15 that the response
time of our vending machines to deliver the product is on average
2.125 seconds.
From technical specifications the standard deviation parameter is .38
seconds. cf. lecture week 41(43)
• Thus x = 2.125, whereas σ2 = (σ)2 = .382 = .1444
 Is there sufficient statistical evidence from the sample data to
claim that the variability in time response is not larger such
theoretical value?
• Now the research hypothesis is related to the population variance
H1 : σ2
 .1444
and the null hypothesis is (or should be)
H0 : σ2 = .1444 (H0 : σ2 .1444)
12 / 21
Example χ2
statistic II
test statistic
For the variance parameter we apply the χ2 statistic with the
standard significance level of 5%
χ2 =
(n−1)s2
σ2
0
ª And the computation requires the sample variance
s2 = (s)2 = .4112 = .169
So the test statistic is
χ2 = 14×.169
.1444
= 16.39
With the lower-tail critical value of χ2
.95,14 = 6.57
• Because the test statistic (16.39) is larger than the critical value
(6.57) we are unable to reject the null hypothesis
 There is insufficient evidence to claim that to the variability in
time response is not greater than the value given in the technical
specifications
13 / 21
Example χ2
statistic III
upper test
However, most of the times we want to test whether or not the lack
of precision in a certain process or product exceeds a particular
value specified in the standards.
In such case the claim we want to test is whether or not the
standard deviation of the vending machines do not exceed .38 seconds,
which means that the research hypothesis becomes
H1 : σ2  .1444
• Here the comparison of the test statistic with the critical value is
χ2  χ2
α,ν
• And since the test statistic value 16.39 is smaller than χ2
.05, 14 = 23.7,
then we are unable to reject the null hypothesis
 We do not have sufficient evidence either to claim that the time
response is greater than the value given in the specifications
14 / 21
Sampling distribution for the example
lower and upper tails
0
|
16.39
|
6.57
χ2
f(χ2
)
ν = 14
0
|
16.39
|
23.27
χ2
f(χ2
)
ν = 14
15 / 21
Interval estimation
Another way to make inferences about the population variance is through
interval estimation
In this case the confidence interval is delimited by lower and upper critical
values, which depend on the sample size and the level of significance
Confidence Interval
0
|
UCL
|
LCL
χ2
f(χ2
)
16 / 21
Confidence Interval Estimator
The confidence interval estimator of σ2 comes from the probability
statement that leads to the boundaries of the interval
P χ2
1−α/2  χ2  χ2
α/2 = 1 − α
Lower Confidence Limit (LCL):
(n − 1)s2
χ2
α/2
Upper Confidence Limit (UCL):
(n − 1)s2
χ2
1−α/2
17 / 21
Example Confidence Interval of σ2
vending machines
For a 95% confidence level we obtain the limits of the
confidence interval are
LCL =
(15−1).4112
χ2
.05/2
= 14×.169
26.1
= .01
UCL =
(15−1).4112
χ2
1−.05/2
= 14×.169
5.63
= .42
 σ2 ∈ [.01; .42]
ª Thus the variance of response time lies between .01 and
.42 seconds
18 / 21
One-sided Confidence Intervals for σ2
For one-tailed χ2 tests of σ2 with ν = N − 1 the lower and
upper one-sided confidence interval are
σ2  (N−1)s2
χ2
1−α, ν
0  σ2  (N−1)s2
χ2
α, ν
ª keeping in mind that we are computing confidence intervals when looking
at the critical values of the χ2
distribution table
19 / 21
p-value
χ2
statistic
In case that the null hypothesis is rejected, we should compute the
p-value as well, and we can approximate the range of this probability
with the critical values table of the χ2
distribution
In the example the value of the test statistic 16.39 for n = 15
is calculated with the lower tail critical values of the
chi-square distribution
16.39  χ2
1−.90,14 = 7.79
for the upper tail critical values
16.39  χ2
.10,14 = 21.1
thus
.10  P(χ2
 7.79) or P(χ2
 21.1)
 We can reasonably say that the p-value is larger than 10%
20 / 21
Summary
Alongside with making inferences about a central location
parameter like the mean, we make conclusions about the
variability of the population
In such case we performed a hypothesis test and estimation
for the population variance through the chi-square test
statistic, which is an indirect method to infer about the
standard deviation parameter
However, since the chi-square distribution is nonnegative and
positive skewed, we require specific critical values for both
sides of the distribution in two-sided tests
21 / 21
BUSINESS STATISTICS I
Lecture – Week 48
Antonio Rivero Ostoic
School of Business and Social Sciences
 November 
AARHUS
UNIVERSITYAU
Today’s Agenda
1. Inference about a Population Proportion
– hypothesis testing
– confidence interval
2. Selecting the Sample Size
3. Exact probabilities
– Binomial and hypergeometric
2 / 26
Intro
The tests we have seen until now both for the population mean
and variance are designed for interval data
However many times we confront with nominal data containing
different categories
With nominal data parameters like the mean and variance are
no longer valid, but rather proportions
Thus the parameter of interest for describing the population is
p that represents the population proportion
3 / 26
Test of hypotheses about proportions
To make inferences about the population proportion we test
research questions regarding the proportion of successes in a
sample distribution
The sample follows the binomial distribution since there are
two possible outcomes, namely a success or a failure
In hypothesis testing the research questions deal on whether
the recommended proportion of successes p0 is within a
recommended limit, or else if it is less or greater than the
prescribed boundary
p = p0
p  p0
p  p0
4 / 26
Test statistic for p
The inferences about the population proportion are made by
means of the sample proportion, which is the ratio of the number
of success x to the sample size n
ˆp =
x
n
 The sampling distribution of ˆP is approximately normal
distributed with mean p and standard deviation
p(1−p)
n
5 / 26
Test statistic for p
z score
The test statistic depends on a normal approximation, and it
is based on a z score
z =
ˆP − p0
p0(1−p0)
n
provided that the sample size is sufficient large
6 / 26
One and two-sided tests for proportion
cumulative Z table
The two-sided test with a significance level α is based on z
scores where the null hypothesis is rejected whenever
z  zα/2 or z  z1−α/2
For the upper and lower tailed test to reject H0 there is a
single comparison to be made
z  z1−α
z  zα
7 / 26
Example testing proportions
Vending machines
• The proportion of defective vending machines in our sample are the
units having a response time greater than the upper 95% confidence
level
ª The value of the UCL was calculated to 2.32 seconds -cf. lecture week
41 (43)- and the defective units in the sampling are then emphasized
2.37 1.95 1.49 2.05 2.27 2.53 1.87 2.42 1.43 2.24 2.69 2.16 1.88 1.71 2.82
 This means that, out of 15 machines, 5 have shown to be defective.
Hence ˆp = 5
15
= 1
3
or equally 0.333
8 / 26
Example testing proportions
p0
• The specifications for the vending machines however establish
that a defective machine is a unit having a response time
greater than 2.50
 The defective machines in the sample according to the prescribed
limits are emphasized in bold
2.37 1.95 1.49 2.05 2.27 2.53 1.87 2.42 1.43 2.24 2.69 2.16 1.88 1.71 2.82
And the proportion in this case is 3
15
= 0.2, which will
represent the parameter
ª but be aware that the proportion parameter can come from
another source
9 / 26
Example testing proportions
hypothesis formulation
The hypotheses are formulated in order to answer a question
like:
• Should we invest in a new product delivery system in the vending
machines to fulfill the technical specifications?
Hence we want to see whether there is enough statistical
evidence to claim that the proportion of defects units found in
the sample data is larger than the population proportion.
 And in this case we perform a one-sided test where the null
hypothesis is that p = p0, whereas the alternative hypothesis is
that p  p0
10 / 26
Example testing proportions
test statistic
The test statistic takes the sample proportion as the
departure from the prescribed limit and the standard error of
the proportion (e.g.)
z =
ˆP−p0
p0(1−p0)
n
= 0.333−0.2
0.2(0.8)
15
= 1.41
ª This outcome has to be confronted to the critical value
z.95 = 1.645 from the cumulative Z probabilities table
• Since the value of this test statistic 1.41 is less than the
critical value (1.645) we are not able to reject H0
 There is not sufficient evidence at the 5% significance level
to claim that the sample proportion of defect machines exceeds
the population proportion and hence no new product delivery
system is indeed needed.
11 / 26
Confidence interval estimator of p
The confidential interval estimator of the population proportion
comes from the sampling distribution
ˆp ± zα/2 ·
p(1−p)
n
However the problem lies on the standard error of the proportion
since this estimate requires the value of the parameter we wish
to draw conclusions about
We can solve this issue by invoking the central limit theorem in
which any population is considered approx. normal with a
sufficiently large sample size, and use the sample proportion ˆp
as the best estimator of p
ª this is possible because ˆp equals x
n
, and this is the sample average
12 / 26
Confidence interval estimator of p
with sampling proportions
By modifying the standard error of the proportion, the
confidential interval estimator of p becomes
ˆp ± zα/2 ·
ˆp(1−ˆp)
n
for a sufficient large sample size at 100(1 − α)% confidence level
13 / 26
Example CI for Proportions
Vending machines
• We wish to find the proportion of defective vending machines in our
sample that are the units having a response time greater than the
upper 95% confidence level.
ª Since the UCL equals to 2.32 seconds -cf. lecture week 41 (43)- the
defective units in the sampling are emphasized
2.37 1.95 1.49 2.05 2.27 2.53 1.87 2.42 1.43 2.24 2.69 2.16 1.88 1.71 2.82
 This means that, out of 15 machines, 5 have shown to be defective.
• As a result, ˆp = 5/15 = 0.333, and the maximum error of the estimate is
1.96 × 0.333(1 − 0.333)/15 = 0.239
 0.333 ± 0.239  LCL: 0.094; UCL: 0.572
14 / 26
Selecting the Sample Size
Since the test statistic for a proportion is approximate, the size
of the sample should be large enough to be valid
However, even for a quite large sample the actual distribution of
the parameter representing ˆp is considerably nonnormal
Another problem is that if there is any success in the trial it
implies that there is any success in the population either and
that may in reality not be the case
 There are different criteria to choose the appropriate value for n, and
an important condition both for hypothesis testing and confidence
estimation is that n p0, n(1 − p0)  5
ª thus if the value of p0 is 0.1 then n should be at least 51, for p0 = 0.01
then n 501...
15 / 26
Selecting the Sample Size
estimation error
We can also calculate the probability of error in the estimation of the
proportion related to the maximum error estimate at certain confidence level
In this case the bound on the error of estimation is
B = zα/2
ˆp(1 − ˆp)
n
And the sample size to estimate a proportion is
n =
zα/2 ˆp(1 − ˆp)
B
2
The problem is that this formula requires the value of ˆp, which usually is
unknown before the sample takes place
 A possibility is to give to the sample proportion of successes a 50% chance of
occurring, or else to assign ˆp a known value of the proportion parameter
16 / 26
Selecting the Sample Size
Wilson estimate
For small samples with no successes the Wilson estimate
adds 2 to the number of successes and 4 to the sample size,
i.e. ˜p = x+2
n+4
 In this case the standard error of ˜p is
σ˜p =
˜p(1−˜p)
n+4
And the confidence interval estimator of the population
proportion becomes
˜p = zα/2 ·
˜p(1 − ˜p)
n + 4
17 / 26
Estimating the Total Number of Successes
finite population
It is possible for large finite populations to calculate
confidence estimators of the total population
This is done by multiplying the confidence limits of the
proportion estimate by the population size
ˆp ± zα/2
ˆp(1−ˆp)
n · N
18 / 26
Example Sample size
method 2
• The sample size for proportions within 3% error margin with
95% confidence level is
n =
1.96·
√
ˆp(1−ˆp)
.03
ª In the case of the vending machines the interval estimation
for such confidential level is ˆp = 0.333, which means that
n =
1.96×
√
0.333(0.666)
.03
2
= (30.79)2  948
 Thus we need a sample size of at least 948 units to get a 3%
error estimate with the desired confidence level
19 / 26
Binomial distribution
exact probabilities
The proportion or successes in a sample follows the binomial
distribution in which p is the probability of a particular item
being found as a success
Hence when dealing with proportions it is also possible to
obtain exact probabilities through an exact binomial test
ª recall that with samples following continuous distributions the point
probability is 0
Typically the test of a hypothesis involving the probability of
success in a binomial experiment is like that H1 : p = .05, but
one-sided tests are also possible
In case we want to obtain exact probabilities we can use the
tables for the Binomial probabilities
20 / 26
Binomial distribution
mass function
For samples with a different size than the available tables
(typically large samples) we can approximate the p-value
through the probability mass function of the binomial
distribution
P(x) = n
x px(1 − p)n−x
ª for x = 0, 1, 2, . . . , n successes
 and the probability of observing successes is conditional on
the value assigned to p
21 / 26
Example Binomial
test  p-value
• In a lot where the rate of defectives is 5% or more, we can
look at a random sample of 50 pieces and compute the probability
of finding one (or less) defective item
H0 : p .05, n = 50, x = 1
ª Thus we state the null hypothesis for a one-sided test in which
the alternative hypothesis where true probability of success is
less than 5%
 We then perform an exact binomial test and the p-value for this
hypothesis is calculated as follows
p-value = P(X 1 | n = 50, p = .05)
= 50
0
× .050 × (1 − .05)50 + 50
1
× .051 × (1 − .05)49
= .077 + .202 = .279
22 / 26
Hypergeometric distribution
exact probabilities
Another approach in getting exact probabilities is through a
hypergeometric experiment
 this distribution is for the probability of x successes in a trial without replacement
For example, to compute the possibility in hand of 5 cards of
getting 3 or more out of, say the 4 A’s, over repeated draws from
a pack of 52 cards we use the probability mass function of the
hypergeometric distribution
P(x) =
(k
x)(N−k
n−x)
(N
n)
where N = 52, n = 5, k = 4, x = 3
23 / 26
Hypergeometric distribution
test  p-value
• In a test statistic the function of the problem just posed is
represented with p denoting a true probability
H0 : p = 4
52
; N = 52, k = 4, n = 5, x = 3
ª Hence the null hypothesis for a two-sided test where H1 : p = 4
52
 Again, we perform an exact test and the p-value for this
hypothesis is represented as follows
p-value = 2 · P(X 3 | N = 52, k = 4, n = 5)
= 2 ×
4
3
· 52−4
5−3
52
5
+
4
4
· 52−4
5−4
52
5
= 2 ×
4
3
· 48
2
52
5
+
4
4
· 48
1
52
5
= 2 × (.0017361 + .0000185) = .0035091
24 / 26
Probabilities in the example
Hypergeometric distribution
1 2 3 4
0.0
0.1
0.2
0.3
N = 52, n = 5, k = 4
25 / 26
Summary
In Chap. 12 we compare a single sample with a target
represented by a theoretical value
Thus – besides a one-sample statistic for the mean and a
one-sample statistic for the variance – we have seen a
one-sample percentage success that serves to represent
categorical variables
In is possible to compute interval estimators via normal
approximation, and exact probabilities with the binomial or
the hypergeometric distribution
26 / 26
BUSINESS STATISTICS I
Lecture – Week 49
Antonio Rivero Ostoic
School of Business and Social Sciences
 December 
AARHUS
UNIVERSITYAU
Today’s Agenda
Inferences about Comparing Two Populations:
1. Difference between Two Means
2. Ratio of Two Variances
3. Test of σ2
1/σ2
2
4. Test and Estimation of µ1 − µ2
2 / 30
Intro
Comparing the characteristics of two populations or two groups is
essential for social sciences, business, and also for medical studies
We can compare for instance the mean income of males and
females with similar education and job experience
Or if we wish to compare data based on two different processes
generating the same product and assess which process performs
better
ª or else whether the two processes produce the same proportion of defective
items
Another possible comparison is between an experimental group
and a control group of patients and we look at a specific parameter
3 / 30
Comparing two groups
Statistical inferences about comparing two populations are
based on sample data corresponding to each population
However sometimes just a single population may be involved
with samples at two different points of time in a type of study
known as longitudinal
Another possibility is to have a large sample of cross-sectional
data that is from at a single point of time, which is divided into
two subsamples corresponding to a variable such gender with
a pair of categories
4 / 30
Comparing two groups
inference
Inferences are based either on two independent random samples or
else on two dependent samples with a natural matching between
each individual in one sample and an individual in the other sample
ª each case requires a specific statistical method for the analysis
We rely on hypothesis testing and confidence estimation to make
inferences about comparing two populations where the objective is
typically to determine whether or not the populations are similar
For the comparison we can look at the central location in the two
sample distributions where the variability parameter in the
populations is known
Or we may not know the variability in the populations and hence we
can make inferences about the population variance or standard
deviation as well
5 / 30
Comparing independent samples
from two populations
Population 1
Parameters: µ1, σ2
1
ª
Statistics: x1, s2
1
Population 2
Parameters: µ2, σ2
2
ª
Statistics: x2, s2
2
ª with sample sizes n1 and n2 respectively
 we assume that x1 − x2 is the best estimator of µ1 − µ2
6 / 30
Sampling distribution of X1 − X2
Expectations of x1 − x2
E(x1 − x2) = µ1 − µ2 (value)
V(x1 − x2) =
σ2
1
n1
+
σ2
2
n2
(variance)
SE(x1 − x2) =
σ2
1
n1
+
σ2
2
n2
(standard error)
 x1 − x2 is normally distributed if the populations are normal and approx.
normal if the populations are nonnormal and with large sample sizes
7 / 30
Difference between Two Means
hypothesis tests
For two random samples X1 and X2 that are independent to each
other we look at the two mean populations and try to infer
whether or not the means are the same
Hence the null premise takes the true mean of the first population
µ1 against the true mean of the second population µ2, and the
research hypotheses are:
µ1 = µ2 or (µ1 − µ2) = 0
µ1  µ2 or (µ1 − µ2)  0
µ1  µ2 or (µ1 − µ2)  0
 thus we do not compare the parameter to a nominal value as when we considered a
single group
8 / 30
Test Statistic and Interval Estimation
z, µ1 − µ2, independent samples
Because of the normal approximation of the populations we benefit from
the z statistics to make inferences about µ1 − µ2
In such case the statistic is the proportion of the difference between the
estimate of the parameter and the null hypothesis value of parameter to
the standard error of estimator
z =
(x1−x2) − (µ1−µ2)
σ2
1
n1
+
σ2
2
n2
Whereas the confidence interval estimator is
(x1 − x2) ± zα/2·
σ2
1
n1
+
σ2
2
n2
9 / 30
Variance parameters in µ1 − µ2
However the problem of using the z test statistics is that it
requires knowing the variance parameters
And since the variance parameters are typically not known when
comparing two populations, we need to address this problem and
modify the standard error in the test statistics
A less stringent test statistic than the z score was found in the t
statistic, which is used when the variability parameter is unknown
In the case of the difference between two means we are still going
to benefit from the t scores both for testing and for the estimation
ª and it corresponds in this case to a 2-sample t statistic
10 / 30
Test Statistic for µ1 − µ2
For the difference between two means the t test statistic with small
sample sizes comes in two flavors:
Equal variances
– i.e. statistically equal even if the values may be numerically different
– here we try to find the weighted mean of the variance where the degrees
of freedom are the weighting factors
Unequal variances
– in this case there is no attempt made to average the variances together,
and the number of degrees of freedom is adjusted
ª Thus to apply the appropriate t test statistic for the difference between two
means we need to determine whether or not the two population variances differ
11 / 30
Inferences about σ2
When the population variances are not known we can make
inferences about the parameters based on sampling
distributions corresponding to each population
And we perform a test in order to gather sufficient statistical
evidence to infer that the variability in both populations is
equal or not equal
Such type of problem corresponds to a test of the ratio of two
variances, and the hypothesis testing tries to find out whether
these parameters are equal or not
12 / 30
Testing Population Variances
To test if two population variances are equal we look at the
ratio of these parameters, and the null hypothesis implies that
this product is one
Hence a two-sided hypothesis testing corresponds to
H0 :
σ2
1
σ2
2
= 1
H1 :
σ2
1
σ2
2
= 1 or σ2
1 = σ2
2
But it is also possible to perform one-tailed tests with
alternative hypotheses
σ2
1
σ2
2
 1 or σ2
1  σ2
2
σ2
1
σ2
2
 1 or σ2
1  σ2
2
13 / 30
F-Test of Equality of Variances
independent samples
Provided that the two populations are normally distributed, the test
to be used to compare two variances in independent samples is:
Ftest =
larger variance
smaller variance
and hence we work with the right critical values
Under the assumption the null hypothesis is true; the test statistic
corresponds to the ratio of the two sample variances:
F =
s2
1
s2
2
that is F-distributed with degrees of freedom ν1 = n1 − 1 and ν2 = n2 − 1,
which are called numerator and denominator respectively
14 / 30
The F-distribution
e.g. ν1, ν2 = 6
0
F
f(F )
 recall that the F-distribution is formed by the ratio of two independent χ2 variables
15 / 30
Rejection Regions
F-test
The test strategies for the ratio of two variances works in the
same fashion than for the mean parameters
That is, we define a significance level α and the rejection of
the null hypothesis is based on the F statistic whenever
F  Fα/2, ν1,ν2
or F  F1−α/2, ν1,ν2
And for the upper and lower tailed test the rejection regions are
F  Fα, ν1,ν2
F  F1−α, ν1,ν2
16 / 30
Critical values, F-distribution
As the χ2 distribution, the F-distribution is asymmetric having only
positive scores
ª and we require distinct critical values for the tails of the distribution
However, the F-distribution depends upon two degrees of
freedoms depending on different sample sizes
A property for the critical values in both tails of the distribution is
Fα/2, ν1,ν2
= 1
F1−α/2, ν2,ν1
 and this means that a two-sided test requires just the upper critical values
17 / 30
Example F-Test
 The response time in seconds for the vending machines has been
measured in a random sample of size 15 with the following
statistics: mean = 2.125, SD = 0.411.
While a random sample of 20 machines from the competition presumably
gives a mean of 2.089 and SD of .5 in the sample distribution
• The question is whether or not our machines are more accurate than
the machines from the competition, i.e. have smaller variability?
ª The parameter of interest is the ratio of two variances and we
perform a F-test of equality of variances.
Since the SD (and hence the variance) is smaller in our machines
than the competition, then σ2
2 corresponds to our machines and σ2
1 to
the competition
18 / 30
Stem-and-Leaf display and Box Plot of the data
OWN COMPETITION
0 | 9
1 | 4 1 | 4
1 | 5799 1 | 56899
2 | 0122344 2 | 00112244
2 | 578 2 | 55889
1 1.5 2 2.5 3
comp
own
Response time (seconds)
Gropus
19 / 30
Example F-Test
test statistic
• The research hypothesis is H1 : σ2
1/σ2
2  1 or whether the true ratio
of the variances is greater than one
• The test statistic is computed next
F = s2
1/s2
2 = 0.5
0.411
2
= 1.48
• And for an upper one-sided test with a standard significance
level the critical value is F.05, 19,14 = 2.4
ª Because the test statistic (1.48) is not greater than 2.4 then we
fail to reject the null hypothesis
 There is not enough statistical evidence at a 5% significance
level to claim that our machines are more accurate than the
machines from the competition
20 / 30
Test statistic for µ1 − µ2 when σ2
1 = σ2
2
pooled
In case that we fail to reject the null hypothesis in the test of the
ratio of two variances, we perform a t test statistic for µ1 − µ2
with a pooled variance estimator represented by
s2
p =
(n1−1)s2
1 + (n2−1)s2
2
n1+n2−2
And the test statistic for equal variances is
t =
(x1−x2)−(µ1−µ2)
s2
p· 1
n1
+ 1
n2
ν = n1 + n2 − 2
21 / 30
Test statistic for µ1 − µ2 when σ2
1 = σ2
2
unpooled
On the other hand in case that H0 is rejected and there is
enough statistical evidence that the two variances differ, we
cannot use the pooled variance estimate
In this case we estimate each variance parameter by its sample
statistic from the sampling distribution
(x1−x2) − (µ1−µ2)
s2
1
n1
+
s2
2
n2
but unfortunately this is not Student t distributed (nor normal neither)
22 / 30
Test statistic for µ1 − µ2 when σ2
1 = σ2
2
Welch test with Student t approximation
An approximation to the Student t distribution is possible by
adjusting the number of degrees of freedom to
ν =
(s2
1/n1 + s2
2/n2)2
(s2
1
/n1)2
n1−1
+
(s2
2
/n2)2
n2−1
(Welch-Satterthwaite)
And the test statistic used by applying the approximate value
of ν is
t =
(x1−x2) − (µ1−µ2)
s2
1
n1
+
s2
2
n2
23 / 30
Rejection Regions
t-test
To reject the null hypothesis we compare the t scores against
the critical values at a chosen significance level α
For a two-tailed test we check that
|t|  tα/2, ν
And for the upper and lower tailed test the rejection regions are
t  tα, ν
t  t1−α, ν
24 / 30
Confidence Intervals for µ1 − µ2
independent samples
Two-sided confidence intervals for 100(1 − α)% level for the
difference between two means are
For σ2
1 = σ2
1
(x1 − x2) ± tα/2, ν · s2
p
1
n1
+
1
n2
For σ2
1 = σ2
1
(x1 − x2) ± tα/2, ν ·
s2
1
n1
+
s2
2
n2
25 / 30
Example µ1 − µ2
vending machines
 In the F-test performed before we were unable to reject the
null hypothesis that the ratio of the two variances equals 1.
• This implies that to test the difference between two means in
our machines and in the competition we assume equal variances
in the populations
ª Recall that the sample statistics are s1 = .5, x1 = 2.089, n1 = 20;
s2 = .411, x2 = 2.125, n2 = 15
• Now the question is whether the mean µ2 for our machines is
greater than the mean µ1 from the competition?
 This is a one-sided (lower-tail) test for the difference
between two means where H1 : (µ1 − µ2)  0.
26 / 30
Example test µ1 − µ2
ª For equal variances we compute first the pooled variance estimator
s2
p =
(20−1)(.52
) + (15−1)(.4112
)
20 + 15 − 2
= 7.13
33
= .216
• And the test statistic is calculated using such estimate
t =
(2.089−2.125) − 0
.216× 1
20
+ 1
15
= −.227
ª To determine the critical value we compute the number of degrees
of freedom ν = n1 + n2 − 2 = 33
• The rejection region at the standard alpha value is
t  t1−α,ν = t1−.05,33 = −t.05,33 ≈ −t.05,35 = −1.69
• Because the t score is greater than the critical value we are
unable to reject H0.
 There is not sufficient evidence at 5% α level to claim that the
average response time in our machines differ from the competition.
27 / 30
Example estimation µ1 − µ2
The estimation of the difference between two means with
equal variance parameters is based on the two-sided 95%
confidence intervals
(x1 − x2) ± tα/2, ν · s2
p
1
n1
+ 1
n2
(2.089 − 2.125) ± 2.03 · .216 × 1
20
+ 1
15
−.036 ± .322
 (µ1 − µ2) ∈ [−0.36; 0.29]
 As the 0 is within the interval, we cannot conclude that
there is a significant difference between the mean response
time in our machines and the competition.
28 / 30
p-value
Despite we did not rejected the null hypotheses in the example;
we compute a range of the p-values from the test statistics.
• For µ1 − µ2, we find from the t table for ν ≈ 35 that the
closest critical value to the t score is
1.306  −.227
which means that
.10  P(t  −.227)
 and hence we can reasonably say that p-value  10%
• For σ2
1/σ2
2 the F score is 1.48 that is smaller than (≈) F.100,20,15
1.92  1.48
 So the p-value in this case is more than 10% as well because
.100  P(F  1.48)  (or  5% with F.050,20,15 = 2.33  1.48).
29 / 30
Summary
Drawing conclusions in comparing two populations imply a
two-sample test statistic and estimation
For large and independent samples with known σ the test and
estimation is based on the standard normal distribution
But for small and independent samples we apply the t statistics
where is possible to average the variances in the samples
whenever these are statistically equal
Thus we need to make inferences about the ratio of two
variances in case we want to perform a test or estimation of the
difference between two means with independent samples.
30 / 30
BUSINESS STATISTICS I
Lecture – Week 50
Antonio Rivero Ostoic
School of Business and Social Sciences
 December 
AARHUS
UNIVERSITYAU
Today’s Agenda
Inferences about Comparing Two Populations:
1. Difference between Two Means in Matched Pairs Experiment
ª test and estimation of µD
2. Difference between Two Population Proportions
ª test and estimation of p1 − p2
2 / 27
Introduction
In the last lecture we made inferences about comparing two
populations from sample data with the condition that the
samples are independent to each other
In many situations the independence condition applies,
especially when the samples belong to different populations
However when the two samples have the same subject there
is typically a dependence relation among the observations
and the samples are said to be paired or matching
ª in Keller these pairs are matched in a ‘group’
3 / 27
Experimental designs
Whether the observations in one population are independent
or are rather dependent to the observations in the other
population determine the type of experimental design
Besides independent samples, another type of experimental
design is matched pairs since each observation in one
sample matches with an observation from another sample
ª in this case the data are called paired data
 examples of paired data are found in repeated measurements on the same
subjects, or measurements on subjects that are very closely related because they
match in terms of certain characteristics like age, sex, etc.
4 / 27
Statistics for Comparing Matched Pairs
Given two dependent samples of observed data the paired
difference between the values is obtained where
Di = observation in sample 1 − observation in sample 2
The sample mean paired difference xD is defined for a number
of difference scores nD
xD =
nD
i=1 Di
nD
And the sample standard deviation for paired differences sD is
sD =
nD
i=1(Di − xD)2
nD − 1
5 / 27
Inferences about the Difference between Two Means
matched pairs experiment
Inferences about the difference between two means in matched
pairs experiment are based on the mean of the population
differences that is represented by µD, and where xD estimates µD
In fact, the parameter µD is identical to the difference between
the mean parameters of two populations, µ1 − µ2
ª thus the mean of the difference scores corresponds to the difference
between the means of the sample populations
This implies that we try to infer whether or not there is a
difference between the mean of two depending populations
In other words, we test if the true mean of the population
difference parameter equals 0
6 / 27
Hypothesis test for the difference between two means
matched pairs
In a two-sided hypothesis testing we have the following null and
alternative hypotheses
H0 : µD = 0 or µ1 = µ2
H1 : µD = 0 or µ1 = µ2
And by performing a one-sided test the research hypotheses are
µD  0 or µ1  µ2
µD  0 or µ1  µ2
7 / 27
Test Statistic of µD
In the case of matched pairs data we perform a paired t-test
for the mean of population differences
t =
xD − µD
sD/
√
nD
that is Student t distributed with degrees of freedom ν = nD − 1
 the assumption here is that the difference scores are normally distributed
8 / 27
Rejection Regions
paired t-test
The rejection regions for a paired t-test for the mean of
population differences are
|t|  tα/2, ν
t  tα, ν
t  t1−α, ν
 that correspond to a right tailed table of critical values with a
significance level α with ν degrees of freedom
9 / 27
Interval Estimation of µD
Inferences about the population mean of paired differences
are also made through confidence interval estimator of µD
A two-sided confidence intervals for 100(1 − α)% level is
based on the t statistic as well
xD ± tα/2
sD
√
nD
 and it takes the standard error of the sample mean paired difference
10 / 27
Example Test of µD
• Recall that the response time in our vending machines was measured
in a random sample with n = 15, and we obtained the response time
from the competition from a random sample with n = 20.
Suppose that the first 15 measurements from the competitors sample
match the observations in our sample, and this is because e.g. the
machines use the same version of the main control board.
ª The paired data with CPU v., and the difference between samples are
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
2.37 1.95 1.49 2.05 2.27 2.53 1.87 2.42 1.43 2.24 2.69 2.16 1.88 1.71 2.82
1.55 2.09 2.79 1.43 1.96 2.07 2.35 1.88 2.75 1.93 2.21 2.49 1.80 1.48 2.89
0.82 -0.14 -1.30 0.62 0.31 0.46 -0.48 0.54 -1.32 0.31 0.48 -0.33 0.08 0.23 -0.07
ª The sample statistics for our machines are x2 = 2.125, s2 = .411; and
for the paired competitors are x1 = 2.111, s1 = .468
• Due the experiment design the parameter of interest in this case is
µD or the mean of the population differences for dependent samples.
11 / 27
Example Test of µD II
• The question is whether there is a difference between the true mean
for our machines and the mean from the competition?
 Because the sample mean in our machines is still higher than the
competition the alternative hypothesis is formulated as H1 : µD  0
• Next we compute the statistics of the paired differences xD = .014,
and sD = .646, and these outcomes are used in the t test statistic
t = 0.014 − 0
0.646/
√
15
= .084
• The rejection region at the standard α value is calculated
t  t1−α, ν = t1−.05,14 = −t.05,14 = −1.76
• Because the t score (.084) is greater than the critical value we are
unable to reject the null hypothesis.
 There is not sufficient evidence at 5% α level to infer that there
is a difference between the response time in our machines and from
the competition using the same version of the control board.
12 / 27
Example Estimation of µD
• The estimation of the mean difference for paired data is based on
a two-sided standard confidence level
xD ± tα/2, ν
sD
√
nD
0.014 ± 2.145 ×
0.646
√
15
ª Hence the maximum error estimate is .358
 LCL = −.34 and UCL = .37
 We cannot conclude either that there is a significant difference
between the mean response time in our machines and the competition
using the same version of the control board.
13 / 27
Difference between Two Population Proportions
For nominal data that corresponds to a categorical variable
(like gender) we perform inferences about the difference
between two population proportions rather than means
The parameter of interest in this case is p1 − p2 that represents
the difference between two population proportions
Recall that samples for proportion follow the Binomial
distribution, and it is possible to get a Normal approximation to
the Binomial with sufficiently large sample sizes
For small samples there are tests to obtain exact probabilities
when comparing two group proportions
14 / 27
Comparing Proportions from Two Populations
Population 1
Parameter: p1
ª
Statistic: ˆp1
Population 2
Parameter: p2
ª
Statistic: ˆp2
ª with number of successes x1 and x2 out of n1 and n2 respectively
 Here ˆp1 =
x1
n1
, ˆp2 =
x2
n2
, and ˆp1 − ˆp2 is the best estimator of p1 − p2
15 / 27
Expectations of ˆp1 − ˆp2
E(ˆp1 − ˆp2) = p1 − p2 (value)
V(ˆp1 − ˆp2) =
p1(1 − p1)
n1
+
p2(1 − p2)
n2
(variance)
SE(ˆp1 − ˆp2) =
p1(1 − p1)
n1
+
p2(1 − p2)
n2
(standard error)
 ˆp1 − ˆp2 is approx. normally distributed with large samples where n1 ˆp1,
n1(1 − ˆp1) and n2 ˆp2, n2(1 − ˆp2)  5
16 / 27
Testing the Difference between Two Proportions
z statistic
Because of the Normal approximation to Binomial we benefit from the Z
distribution for testing the difference between two group proportions
z =
(ˆp1−ˆp2) − (p1−p2)
p1(1−p1)
n1
+
p2(1−p2)
n2
But the z test statistics requires for the SE of the difference between
proportions both parameters p1 and p2, which are typically unknown
There are two different estimators of ˆp1 − ˆp2 (i.e. the best estimator of
p1 − p2), one when the parameters differ, and other is when p1 and p2 equal
 Hence the null hypothesis determine which of the two cases is going to be
applied to the test statistic
17 / 27
p1 − p2 with Equal Parameters
If the null hypothesis postulates that the two population proportions
are equal, then there is no difference between these parameters
H0 : (p1 − p2) = 0
In such case it is possible to use a pooled proportion estimate
ˆp =
x1 + x2
n1 + n2
And this weighted average of the proportions is applied to the
standard error of ˆp1 − ˆp2
p1(1−p1)
n1
+
p2(1−p2)
n2
=
ˆp1(1−ˆp1)
n1
+
ˆp2(1−ˆp2)
n2
= ˆp(1 − ˆp)
1
n1
+
1
n2
18 / 27
Hypothesis Testing for p1 − p2
In case that H0 assumes that the two population proportions are
equal, then the research hypotheses for a two and one-sided tests are
(p1 − p2) = 0 or p1 = p2
(p1 − p2)  0 or p1  p2
(p1 − p2)  0 or p1  p2
But in case that p1 and p2 are assumed not to be equal then there is a
value D different than zero that is considered each hypothesis
In this latter case the research hypotheses are either
(p1 − p2) = D,  D, or  D
 and hence one proportion exceeds the other parameter by a nonzero quantity, D
19 / 27
Test Statistic of p1 − p2
equal and unequal parameters
When the proportion parameters in both populations are equal then
the test statistics assumes H0 : (p1 − p2) = 0, and it is represented by
z =
(ˆp1 − ˆp2) − (p1 − p2)
ˆp(1 − ˆp)
1
n1
+
1
n2
=
(ˆp1 − ˆp2)
ˆp(1 − ˆp)
1
n1
+
1
n2
However, if H0 : (p1 − p2) = D then the test statistics is defined as
z =
(ˆp1 − ˆp2) − (p1 − p2)
ˆp1(1 − ˆp1)
n1
+
ˆp2(1 − ˆp2)
n2
=
(ˆp1 − ˆp2) − D
ˆp1(1 − ˆp1)
n1
+
ˆp2(1 − ˆp2)
n2
20 / 27
Rejection Regions
z-test of p1 − p2
The rejection regions are based on the scores of the standard
normal distribution that are compared with the critical values of
the cumulative table of Z probabilities for a significance level α
The null hypothesis is rejected for a two-tailed test whenever
|z|  z1−α/2
Whereas for p1  p2 and p1  p2 the rejection regions are
z  z1−α
z  zα
21 / 27
Interval Estimation of p1 − p2
Confidence interval estimations are also used to make inferences
about the differences between two population proportions
For a two-sample test of proportions the confidence intervals for
100(1 − α)% level assumes unequal parameters
(ˆp1 − ˆp2) ± zα/2
ˆp1(1 − ˆp1)
n1
+
ˆp2(1 − ˆp2)
n2
 which is effective whenever n1 ˆp1, n1(1 − ˆp1) and n2 ˆp2, n2(1 − ˆp2) 5
22 / 27
Example test of p1 − p2
vending machines
By testing the difference between two population proportions
we can compare e.g. the introduction years’ market for
vending machines in a given town belonging to either our
company or to the competition.
 Assuming that 12 machines in the samples are placed in this
market; the question is whether or not there enough evidence
to conclude that our machines are more popular than the
competition in this town?
• To be consistent with the coding of the populations the
research hypothesis is that (p1 − p2)  0, and hence the null
hypothesis adopts equal proportions in the testing.
• For the test statistics we require both sample proportions
and also the pooled estimate
ª ˆp1 =
12
20
= .6 ˆp2 =
12
15
= .8 and ˆp =
12 + 12
20 + 15
= .686
23 / 27
Example test of p1 − p2
test statistic
• The test statistic is computed next
z =
(.6 − .8)
(.686)(1−.686)× 1
20
+ 1
15
= −1.26
ª And the standard rejection region for a cumulated Z statistic is
z  zα = z.05 = −1.645
• Since the outcome of the z test statistic is greater than the
critical value we do not reject H0
 At 5% significance level there is not sufficient evidence to
conclude that our vending machines were more popular than the
competition in town during the introductory year.
 Here P(Z  z) = .1038 constitutes the associated p-value.
24 / 27
Example test of p1 − p2 Revisited
• However if we consider only the paired sample data and only 7 machines
from the competition were placed on town during the introductory year,
then for the same hypothesis testing design the test statistics become
z =
(.533 − .8)
(.667)(1−.667)× 1
15
+ 1
15
= −1.89
• Which means that zobs  zα and hence we reject the null hypothesis in
favor to the alternative.
 There is enough statistical evidence at the standard significance
level to conclude that our machines were more popular in town during
the introductory year than the competition if we consider that they
were using the same main control board (cf. test of µD)
 The p-value then must be computed P(Z  z) = .0294, and since it is
less than α, it means that the result is statistical significant.
 It is also possible to test proportion parameters with an hypothesized
difference value different than zero, so e.g. H0 : (p1 − p2) = .05
25 / 27
Example estimation of p1 − p2
 To estimate the difference between the two proportions we
use the standard confidence intervals with a 95% level.
(ˆp1 − ˆp2) ± zα/2
ˆp1(1−ˆp1)
n1
+
ˆp2(1−ˆp2)
n2
• For the example with all observations:
(.6 − .8) ± 1.96 ×
.6(1−.6)
20
+
.8(1−.8)
15
−.2 ± .3  [−.5; .1]
• And for the revisited version with paired data:
(.533 − .8) ± 1.96 ×
.533(1−.533)
15
+
.8(1−.8)
15
−.333 ± .32  [−.66; −.01]
26 / 27
Summary
We continue drawing inferences about comparing two populations,
and we have looked at parameters of central location with hypothesis
testing and interval estimation
Besides the difference between two means in independent samples,
we made inferences about the difference between two means in a
matched pair experiment
In this case the samples are dependent, and we applied the t statistic
and used statistics of the paired difference between the samples
For nominal data we made inferences about comparing two
population proportions and applied the z test where we hypothesize
both that there is and there is not a true difference between
parameters
27 / 27
Summary
Descriptive Statistics
Probability
Distributions
Statistical Inference
One-sample estimation and testing of µ, σ2
, p
Two-sample estimation and testing of µ1 − µ2, µD,
σ2
1 /σ2
2 , p1 − p2

More Related Content

What's hot

Measures of Relative Standing and Boxplots
Measures of Relative Standing and BoxplotsMeasures of Relative Standing and Boxplots
Measures of Relative Standing and BoxplotsLong Beach City College
 
Descriptive statistics
Descriptive statisticsDescriptive statistics
Descriptive statisticsMmedsc Hahm
 
Descriptive Statistics and Data Visualization
Descriptive Statistics and Data VisualizationDescriptive Statistics and Data Visualization
Descriptive Statistics and Data VisualizationDouglas Joubert
 
Mba i qt unit-2.1_measures of variations
Mba i qt unit-2.1_measures of variationsMba i qt unit-2.1_measures of variations
Mba i qt unit-2.1_measures of variationsRai University
 
3.3 Measures of relative standing and boxplots
3.3 Measures of relative standing and boxplots3.3 Measures of relative standing and boxplots
3.3 Measures of relative standing and boxplotsLong Beach City College
 
Lesson 7 measures of dispersion part 1
Lesson 7 measures of dispersion part 1Lesson 7 measures of dispersion part 1
Lesson 7 measures of dispersion part 1nurun2010
 
Measures of central tendency
Measures of central tendencyMeasures of central tendency
Measures of central tendencyChie Pegollo
 
Descriptive statistics
Descriptive statisticsDescriptive statistics
Descriptive statisticsAbhinav yadav
 
Introduction to statistics
Introduction to statisticsIntroduction to statistics
Introduction to statisticsScholarsPoint1
 
Statistics Math project class 10th
Statistics Math project class 10thStatistics Math project class 10th
Statistics Math project class 10thRiya Singh
 
Statistics is the science of collection
Statistics is the science of collectionStatistics is the science of collection
Statistics is the science of collectionWaleed Liaqat
 
Theory of estimation
Theory of estimationTheory of estimation
Theory of estimationTech_MX
 

What's hot (19)

Measures of Variation
Measures of Variation Measures of Variation
Measures of Variation
 
Statistical ppt
Statistical pptStatistical ppt
Statistical ppt
 
Measures of Relative Standing and Boxplots
Measures of Relative Standing and BoxplotsMeasures of Relative Standing and Boxplots
Measures of Relative Standing and Boxplots
 
Descriptive statistics and graphs
Descriptive statistics and graphsDescriptive statistics and graphs
Descriptive statistics and graphs
 
STATISTICS
STATISTICSSTATISTICS
STATISTICS
 
Descriptive statistics
Descriptive statisticsDescriptive statistics
Descriptive statistics
 
Sampling theory
Sampling theorySampling theory
Sampling theory
 
Descriptive Statistics and Data Visualization
Descriptive Statistics and Data VisualizationDescriptive Statistics and Data Visualization
Descriptive Statistics and Data Visualization
 
Mba i qt unit-2.1_measures of variations
Mba i qt unit-2.1_measures of variationsMba i qt unit-2.1_measures of variations
Mba i qt unit-2.1_measures of variations
 
3.3 Measures of relative standing and boxplots
3.3 Measures of relative standing and boxplots3.3 Measures of relative standing and boxplots
3.3 Measures of relative standing and boxplots
 
Basic statistics
Basic statisticsBasic statistics
Basic statistics
 
Lesson 7 measures of dispersion part 1
Lesson 7 measures of dispersion part 1Lesson 7 measures of dispersion part 1
Lesson 7 measures of dispersion part 1
 
Measures of central tendency
Measures of central tendencyMeasures of central tendency
Measures of central tendency
 
STATISTIC ESTIMATION
STATISTIC ESTIMATIONSTATISTIC ESTIMATION
STATISTIC ESTIMATION
 
Descriptive statistics
Descriptive statisticsDescriptive statistics
Descriptive statistics
 
Introduction to statistics
Introduction to statisticsIntroduction to statistics
Introduction to statistics
 
Statistics Math project class 10th
Statistics Math project class 10thStatistics Math project class 10th
Statistics Math project class 10th
 
Statistics is the science of collection
Statistics is the science of collectionStatistics is the science of collection
Statistics is the science of collection
 
Theory of estimation
Theory of estimationTheory of estimation
Theory of estimation
 

Similar to Business statistics-i-part2-aarhus-bss

3. Statistical inference_anesthesia.pptx
3.  Statistical inference_anesthesia.pptx3.  Statistical inference_anesthesia.pptx
3. Statistical inference_anesthesia.pptxAbebe334138
 
Business statistic ii
Business statistic iiBusiness statistic ii
Business statistic iiLenin Chakma
 
Estimating population mean
Estimating population meanEstimating population mean
Estimating population meanRonaldo Cabardo
 
Lecture-3 inferential stastistics.ppt
Lecture-3 inferential stastistics.pptLecture-3 inferential stastistics.ppt
Lecture-3 inferential stastistics.pptfantahungedamu
 
Statistical Analysis-Confidence Interval_Session 5.pptx
Statistical Analysis-Confidence Interval_Session 5.pptxStatistical Analysis-Confidence Interval_Session 5.pptx
Statistical Analysis-Confidence Interval_Session 5.pptxmaruco1
 
Statistik 1 7 estimasi & ci
Statistik 1 7 estimasi & ciStatistik 1 7 estimasi & ci
Statistik 1 7 estimasi & ciSelvin Hadi
 
Lec 5 statistical intervals
Lec 5 statistical intervalsLec 5 statistical intervals
Lec 5 statistical intervalscairo university
 
Estimation in statistics
Estimation in statisticsEstimation in statistics
Estimation in statisticsRabea Jamal
 
Basics of biostatistic
Basics of biostatisticBasics of biostatistic
Basics of biostatisticNeurologyKota
 
estimation.pptx
estimation.pptxestimation.pptx
estimation.pptxNaolAbebe8
 
Sampling distribution.pptx
Sampling distribution.pptxSampling distribution.pptx
Sampling distribution.pptxssusera0e0e9
 
Overview of Advance Marketing Research
Overview of Advance Marketing ResearchOverview of Advance Marketing Research
Overview of Advance Marketing ResearchEnamul Islam
 
Estimation&ci (assignebt )
Estimation&ci (assignebt )Estimation&ci (assignebt )
Estimation&ci (assignebt )Mmedsc Hahm
 

Similar to Business statistics-i-part2-aarhus-bss (20)

lecture-2.ppt
lecture-2.pptlecture-2.ppt
lecture-2.ppt
 
Estimating a Population Mean
Estimating a Population Mean  Estimating a Population Mean
Estimating a Population Mean
 
3. Statistical inference_anesthesia.pptx
3.  Statistical inference_anesthesia.pptx3.  Statistical inference_anesthesia.pptx
3. Statistical inference_anesthesia.pptx
 
Inorganic CHEMISTRY
Inorganic CHEMISTRYInorganic CHEMISTRY
Inorganic CHEMISTRY
 
Inferential statistics-estimation
Inferential statistics-estimationInferential statistics-estimation
Inferential statistics-estimation
 
Business statistic ii
Business statistic iiBusiness statistic ii
Business statistic ii
 
Estimating population mean
Estimating population meanEstimating population mean
Estimating population mean
 
Lecture-3 inferential stastistics.ppt
Lecture-3 inferential stastistics.pptLecture-3 inferential stastistics.ppt
Lecture-3 inferential stastistics.ppt
 
Statistical Analysis-Confidence Interval_Session 5.pptx
Statistical Analysis-Confidence Interval_Session 5.pptxStatistical Analysis-Confidence Interval_Session 5.pptx
Statistical Analysis-Confidence Interval_Session 5.pptx
 
6. point and interval estimation
6. point and interval estimation6. point and interval estimation
6. point and interval estimation
 
Estimating a Population Proportion
Estimating a Population Proportion  Estimating a Population Proportion
Estimating a Population Proportion
 
Statistik 1 7 estimasi & ci
Statistik 1 7 estimasi & ciStatistik 1 7 estimasi & ci
Statistik 1 7 estimasi & ci
 
Lec 5 statistical intervals
Lec 5 statistical intervalsLec 5 statistical intervals
Lec 5 statistical intervals
 
Estimation in statistics
Estimation in statisticsEstimation in statistics
Estimation in statistics
 
POINT_INTERVAL_estimates.ppt
POINT_INTERVAL_estimates.pptPOINT_INTERVAL_estimates.ppt
POINT_INTERVAL_estimates.ppt
 
Basics of biostatistic
Basics of biostatisticBasics of biostatistic
Basics of biostatistic
 
estimation.pptx
estimation.pptxestimation.pptx
estimation.pptx
 
Sampling distribution.pptx
Sampling distribution.pptxSampling distribution.pptx
Sampling distribution.pptx
 
Overview of Advance Marketing Research
Overview of Advance Marketing ResearchOverview of Advance Marketing Research
Overview of Advance Marketing Research
 
Estimation&ci (assignebt )
Estimation&ci (assignebt )Estimation&ci (assignebt )
Estimation&ci (assignebt )
 

Recently uploaded

Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 

Recently uploaded (20)

Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 

Business statistics-i-part2-aarhus-bss

  • 1. BUSINESS STATISTICS I Lectures Part 2 — Weeks 43 – 50 Antonio Rivero Ostoic School of Business and Social Sciences  October −  December  AARHUS UNIVERSITYAU
  • 2. BUSINESS STATISTICS I Lecture – Week 41 (43) Antonio Rivero Ostoic School of Business and Social Sciences  October  AARHUS UNIVERSITYAU
  • 3. Today’s Agenda 1. Introduction to Estimation – Properties of estimators – Estimating µ when σ is known – Sample size selection 2 / 24
  • 4. Review of sampling distribution Sampling distributions allow us to make inferences about population parameters by means of sample statistics Using sampling distributions the variability of the sample data was given by the standard error of the mean (continuous), of the proportion (discrete), or of the difference between two means, which in all cases takes into account the sample size of the distribution ª thus if the problem implies random samples we need to compute the standard error first Because of the central limit theorem we benefit from the standard normal distribution when the sample size is sufficiently large ª and employ z scores 3 / 24
  • 5. Concept of Estimation When we do not know something for certain, then we try to make an educated guess about its value In general in statistics we do not know the values of the population parameters, but we typically have information about individuals or cases from a conducted research on these When we apply sampling, then we refer to the sample statistic as the estimator of the population parameter, and the value of the sample statistic is called the estimate As a result, a significant part of statistical inference refers to the process of estimation where we are able to generalize our results beyond individual observations 4 / 24
  • 6. Concept of Estimation II Through sampling distributions we draw a relationship between the characteristics of a sample and the estimated characteristics of the population based on the sample In such case the objective of estimation was to determinate the approximate value of a population parameter in the basis of the sample statistics ª e.g. x that is the sample mean was used to estimate µ or the population mean However beware that the process of estimating a parameter may involve other types of calculation like with regression analysis... 5 / 24
  • 7. Types of Estimators There are two types of estimators: Point estimator Draws inferences about a population by estimating the value of an unknown parameter using a single value or point 6 / 24
  • 8. Types of Estimators II Interval estimator The inferences about a population are drawn by estimating the value of an unknown parameter using an interval thus a point estimator is a value from x, whereas an interval estimator is µ to be between a pair of values (with a given percentage of certainty) 7 / 24
  • 9. Unbiased Estimator Bias occurs when a statistic based on a sample systematically misestimates the corresponding characteristic of the population parameter Our goal is to obtain an unbiased estimator of the population parameter, which is an estimator where the expected value is equal to the parameter With a sampling distribution scheme this implies that the sample statistic value we get on average equals to the value of the parameter Thus we consider the sample mean X is an unbiased estimator of µ, and the sample proportion ˆP as an unbiased estimator of p 8 / 24
  • 10. Consistency Although unbiasedness is a quality that we want to have in our estimation, by knowing that an estimator is unbiased we only know that the value is close to the parameter value, but not how close Another desirable quality of the estimator is its consistency that occurs when the difference between the estimator and the parameter grows smaller as the sample size grows larger Thus X is a consistent estimator of µ because V(X) equals σ2/n, which means that the variance of X grows smaller with larger values of n Likewise, ˆP as an consistent estimator of p since V(ˆP) equals p(1 − p)/n, which means that the variance of ˆP grows smaller with larger values of n 9 / 24
  • 11. Sampling distribution of X different sample sizes µ x n = 25 n = 100 10 / 24
  • 12. Relative Efficiency We have seen that there are different measures for central location like the mean and the median, and both the sample mean and the sample median are unbiased estimators of the mean population However, the sample mean has smaller variance than the sample median, which means that x is relative efficient when compared to the sample median Hence, an unbiased estimator is said to have relative efficiency whenever it has smaller variance than another unbiased estimator 11 / 24
  • 13. Estimating the Population Mean When Knowing σ A sampling distribution serves to produce interval estimators for the mean parameter Recall the probability statement associated to the sampling distribution (cf. last lecture) P µ − Zα/2 σ√ n X Zα/2 σ√ n + µ = 1 − α Which has been used to perform inferences about the sample mean for a given confidence level that is represented by 1 − α By applying the central limit theorem, where Z = X−µ σ/ √ n , the statement can be transformed into the confidence interval estimator of µ: P X − Zα/2 σ√ n µ Zα/2 σ√ n + X = 1 − α 12 / 24
  • 14. Confidence interval estimator of the population mean The interval refers now to the population mean, and the boundaries of the interval are calculated using z-scores: Lower Confidence Limit (LCL): x − zα/2 σ √ n Upper Confidence Limit (UCL): x + zα/2 σ √ n the limits for the confidence interval of the mean parameter are found by subtracting and adding from and to the sample mean the maximum error estimate 13 / 24
  • 15. Steps in statistical inference when you already have the data 1) Identify the appropriate statistical technique to use ª in this case estimate µ with confidence limits x ± zα/2 σ√ n 2) Compute the statistics ª the values needed for the calculation are x, zα/2, σ, n 3) Interpret the results ª which need to be in accordance with the problem 14 / 24
  • 16. Interpreting Confidential Interval Estimates Remember that confidence intervals are derived for a sample statistic and not for a parameter ª and the interpretation should refer to this fact Since the outcomes of the confidence intervals are coming from a sampling distribution, they constitute a probability statement for a given percent confidence level This means that if we draw samples of size n from a population, in the long run 1 − α% of the values of the statistic will be such that the parameter would be located between ± the resulted value ª α% of the values for the statistic produces intervals not including the parameter 15 / 24
  • 17. Common Confidence Levels 1 − α α α/2 Zα/2 .90 .10 .05 z.05 = 1.645 .95 .05 .025 z.025 = 1.96 .98 .02 .01 z.01 = 2.33 .99 .01 .005 z.01 = 2.575 estimations in social sciences are typically made for a 95% confidence level 16 / 24
  • 18. Example finding µ with known σ Our vending machines delivers a soft drink can after few seconds the costumer press the bottom, but the competition is about to launch a new vending machine model that we suspect that is faster than our product • We need to estimate a 95% confidence interval estimate of the mean from a sample of 15 machines, and we know from technical specifications that the standard deviation from the mean in our machines is .38 seconds. Response time in seconds to deliver the product: 2.37 1.95 1.49 2.05 2.27 2.53 1.87 2.42 1.43 2.24 2.69 2.16 1.88 1.71 2.82 CI estimator for µ with known σ: x = 2.13. 95% confidence level means α = .05; zα/2 = z.025 = 1.96 x ± zα/2 σ√ n 2.13 ± 1.96 .38√ 15 ‘error’: ± 0.19 Thus LCL = 1.93 and UCL = 2.32 or else 1.93; 2.32 17 / 24
  • 19. Z Intervals for the Mean We computed in the example both the sample mean and the maximum error estimate, which is the product of the standard error of the mean and zα/2 that acts as a multiplier ª thus there was 1.96 standard errors above and below µ cut off the middle 95% of the distribution .95 −1.96 1.96 z .025.025 18 / 24
  • 20. Width of the Interval Narrow intervals provide more precise information than wide ones, and the width of the confidence interval has a direct link to the values involved in the error estimate These elements are: • Standard deviation parameter, larger value of σ then wider intervals • Chosen confidence level, larger 1 − α means also wider intervals • Sample size, larger value of n then narrower intervals 19 / 24
  • 21. Estimation of µ using the sample median when knowning σ It is also possible to compute confidence intervals for the population mean using the sample median Since we are dealing with a sampling distribution for a normal population we need to compute the mean and the standard error of the median (where m represents the sample median): µm = µ σm = 1.2533σ√ n ª and 1.2533 is a factor that the average absolute deviation needs to be multiplied to be a consistent estimator for the standard deviation The confidence intervals are given by: m ± zα/2 1.2533σ √ n 20 / 24
  • 22. Example Estimation of CI using µ and m We have the following random sample for a normal population with σ = 2 1 1 1 3 4 5 6 7 8 Here x = m = 4 • A 95% confidence interval estimates using the sample mean is: x ± zα/2 σ√ n 4 ± 1.96 2√ 9 4 ± 1.307 • And using the sample median: m ± zα/2 1.2533σ√ n 4 ± 1.961.2533×2√ 9 4 ± 1.638 As a result, the sample median is not as efficient an estimator as the sample mean 21 / 24
  • 23. Sample Size Selection We have seen that the election of sample size has consequences in the estimation of the mean parameter On the other hand the sampling error was defined as the variability of the sample mean from the population mean, which in this case constitutes to the error of estimation Since confidence intervals are expressed in terms of a probability statement, the difference between the sample mean and the population means is represented as: P −Zα/2 σ √ n X − µ +Zα/2 σ √ n = 1 − α Which means that X − µ Zα/2 σ √ n 22 / 24
  • 24. Sample Size Selection II Hence we have a probability 1 − α that the error of the estimation is less than the maximum error estimate we are disposed to tolerate, and it is called the bound on the error of estimation or B: X − µ B The sample size to estimate a mean is: n = zα/2 σ B 2 • In our example the error in the estimate was .19, and in case we want to decrease the bound on the error of estimation to .16 then we need to calculate a new sample size n = zα/2σ B 2 = 1.96×.38 .16 2 = 21.67 Thus our sample size must be 22 to have a 95% confidence that the error of the estimation in seconds will be no larger than 0.16 23 / 24
  • 25. Summary Parameter estimation is one of the main goals in statistical inference, and this is done either by a point or by an interval estimator measure ª we look for an estimator that is unbiased, consistent, and relative efficient to other estimators Confidence intervals for the population mean are probability statements are based on sampling distributions where we compute the limits of this parameter by adding and subtracting the maximum error estimate from/to the sample mean ª and within a determinate percent confidence level We can define the width of the interval by adjusting the sample size, the confidence level, or with a different standard deviation parameter ª to reduce the value of the bound of the error of estimation it is needed to calculate the selection of the sample size 24 / 24
  • 26. BUSINESS STATISTICS I Lecture – Week 42 (44) Antonio Rivero Ostoic School of Business and Social Sciences  October  AARHUS UNIVERSITYAU
  • 27. Today’s Agenda 1. Introduction to Hypothesis Testing 2. Testing µ when σ is known 3. Type II Error 2 / 31
  • 28. Introduction to Hypothesis Testing Besides estimation, another significant task in statistical inference is the testing of different kinds of propositions or hypotheses Hypotheses are predictions on variables measured in the study made through statements about their characteristics However a hypothesis can relate also to the characteristic of a population parameter and we can assess the validity of the parameter with sample data by means of hypothesis testing ª another name for hypothesis testing is significance test 3 / 31
  • 29. Null and Alternative Hypotheses A hypothesis may arise from a theory that drives the research, and it is expressed with a statement such as: “human activities affect climate change” However another theory may have a different statement saying that: “human activities do not affect climate change” Hence there are two hypotheses that contradict to each other: 1) the null hypothesis, represented by H0, which is the hypothesis that we are going to test 2) the alternative (or research) hypothesis, represented by H1, which will be adopted in case that H0 is rejected 4 / 31
  • 30. Relations between H0 and Outcomes in hypothesis testing STATISTICAL DECISION Do not reject H0 Reject H0 REALITY H0 is true Correct Type I error H0 is false Type II error Correct Thus there are two options for correct decisions, and two options that are errors in the judgment 5 / 31
  • 31. Two Types of Error It is important to notice that we do not accept H0, but we just fail to reject the null hypothesis with the test From such process two types of error can arise: Type I error that occurs when we reject a true null hypothesis Type II error that occurs when we do not reject a false null hypothesis 6 / 31
  • 32. Types of Error and Probabilities The probability of committing any of these error types is denoted as: • P(Type I error) = α = P(rejecting H0 | H0 is true) • P(Type II error) = β = P(not rejecting H0 | H0 is false) Where α-level is known as the significance level because it constitutes the level at which the null hypothesis is rejected α and β are inversely related, and this means that a large value of α implies a small value of β and vice versa 7 / 31
  • 33. Hypothesis Testing about Parameters In statistics we typically test hypotheses about parameters, and the null hypothesis constitutes a statement about the parameter The statement about a population parameter is given by means of a test statistic in which a randomly sample is taken from the population, and it typically involves a point estimate of the parameter to which the hypothesis refers When the estimate of the test statistic is not consistent with the null hypothesis, we conclude that there is not enough evidence to support the statement about H0 ª and hence we adopt the alternative hypothesis in a decision making problem the null hypothesis will represent the status quo for the decision maker and no action will be taken 8 / 31
  • 34. Hypothesis Testing about Parameters Examples We have seen in the examples that: the mean of our company’s vending machines electricity consumption is 460 kwh, or H0 : µ = 460 • Is there enough evidence that the mean parameter is not equal to this value? H1 : µ = 460 • What if we want to test whether there is evidence of an increase or decrease in the average electricity consumption of the machines: H1 : µ 460 H1 : µ 460 Similar statements are made for µ less/more than or equal to a certain value 9 / 31
  • 35. Hypothesis Testing about Parameters III In practice the null hypothesis defines a distinctive of the population and we test whether or not the plausible distribution of the characteristics of all samples resembles to the population ª where sample values within the confidence level support the null hypothesis If the sample is very different from the population as defined by H0 then it is unlikely to come from this population, and hence the sample must come from a population in which H0 is false On the other hand, if the sample is typical of the majority of the samples we would have obtained if H0 is true, then it leads us to conclude in favor of the null hypothesis In other words, we reject the null hypothesis in favor of the alternative if the value of the sample statistic is much different relative to the population parameter ª conversely if the sample statistic is close to the parameter value we don’t reject H0 10 / 31
  • 36. Rejection Region To reject a null hypothesis in favor of an alternative we define a rejection region as the set of test statistic values for which the test rejects the null hypothesis at a particular α-level A rejection region implies that the value of the sample mean x is greater than if it would be been large enough to reject H0 and this is represented by xL: x xL Hence the probability of rejecting a true H0 – or of committing a Type I error – is: α = P(x xL | H0 is true) 11 / 31
  • 37. Sampling distribution with rejection region for X µ xL x α Rejection region 12 / 31
  • 39. Hypothesis testing II graphically speaking µ0 µ1xL H0 is not rejected H0 is rejected H0 H1 α β x 14 / 31
  • 40. Testing µ when σ is known For a sampling distribution of x that is approx. normal with mean µ and σ/ √ n as its standard deviation, we can standardize the probability statement with the z scores of the Z distribution P x−µ σ/ √ n xL−µ σ/ √ n = P Z xL−µ σ/ √ n = α Since both α and the probability statement involve Z, its critical value is xL − µ σ/ √ n = zα and from this expression then we can obtain the rejection region xL However, rather than the rejection region is set in terms of x, we apply a standardized test statistic z = x−µ σ/ √ n in which all scores greater than the critical value zα correspond to the rejection region z zα 15 / 31
  • 41. Sampling distribution with rejection region for Z 0 zα z α Rejection region 16 / 31
  • 42. Example Testing µ when σ is known We have µ = 460 as the average electricity consumption in kwh for our machines with σ = 5 • Compute the rejection region for a sample mean of 465 with random sample size 3 and a 5% significance level xL−µ σ/ √ n = zα xL−460 5/ √ 3 = 1.645 xL = 464.7 Which means that the rejection region is: x 464.7 Since the sample mean of 465 is in the rejection region we reject the null hypothesis We conclude that there is sufficient evidence that the average electricity consumption for our machines exceeds 460 khw 17 / 31
  • 43. Example Standardized test With a standardized test statistic we check that z zα z = x−µ σ/ √ n = 465−460 5/ √ 3 = 1.73 Because the value of z (= 1.73) is greater than the z-score of the chosen significance level (z.05 = 1.65), then we reject the null hypothesis ...and conclude once more that there is sufficient evidence that the average electricity consumption for our machines exceeds 460 khw ª The results of both the test statistic x and the standardized test statistic z are identical, and hence the standardized test statistic is typically used and it is just called as the test statistic 18 / 31
  • 44. p-Value Any test is said to be statistically significant whenever a null hypothesis is rejected no matter what significance level is chosen However the testing method used with the rejection region produces a yes/no response ª which is in the form of rejecting or not the null hypothesis in favor of H1 The p-value is the probability of a test statistic at least as extreme as the one from the sample if the null hypothesis is true ª this is actually the calculation of the observed significance level Using the test statistics this probability is: p-value = 1 − P(Z z) 19 / 31
  • 45. Computing the p-value In order to compute the p-value the example we calculate the probability of observing a sample mean at least as large as 465 given that µ = 470 That is, p-value = P(X 465) = x−µ σ/ √ n 465−460 5/ √ 3 = P(Z 1.73) = 1 − P(Z 1.73) = 1 − .9582 = 0.0418 As a result, the probability of observing a sample mean at least as large as 465 given that µ = 470 is 4% ª which is relative small and we reject H0 in favor of the alternative hypothesis 20 / 31
  • 46. Test statistics p-values example: µ = 460, σ = 5, n = 3 We obtain different p-values for different scores of the sample mean: x z p-value 460 0 .500 462 0.69 .244 465 1.73 .042 467 2.42 .008 470 3.46 .000 21 / 31
  • 47. Test statistics p-values II We observe from the example table that the closer the sample mean to µ, the larger the p-value This implies that the smaller the p-value, the more strongly the data contradict the null hypothesis ª and there is more statistical evidence to support the alternative hypothesis And the more evidence, the more statistical significant the test is p-values are thus described as: • p-value .01 Highly significant • p-value .05 Significant • p-value .10 Not significant 22 / 31
  • 48. Interpreting the p-value Recall that both the p-value and the significance level are expressed in terms of probabilities On the other hand the rejection region is the collection of points where the null hypothesis would be rejected, and part of this area is delimited by a given critical value If the test statistic is in the rejection region, the p-value is smaller than the significance level, which means that we reject H0 However in such statistical inference we do not prove anything: – when we reject the null hypothesis we just conclude that there is enough statistical evidence that H1 is true and H0 is false – when we fail to reject the null hypothesis, we only conclude that there is not enough statistical evidence that H1 is true ª we never have enough statistical evidence to conclude that H0 is true 23 / 31
  • 49. One- and Two-Tail Tests The value stated in H0 of the example was µ0 = 465 and we wanted to test whether or not µ equals to this value of the sample mean A two-tail test is: H0 : µ = µ0 H1 : µ = µ0 whereas there are two one-tail tests, one for the right: H0 : µ = µ0 H1 : µ µ0 and another for the left part of the distribution: H0 : µ = µ0 H1 : µ µ0 ª the H0 in a one-tail test is also expressed as H0 : µ or µ0 24 / 31
  • 50. Computing β Recall that β represents the probability of committing a Type II error, and it occurs when we fail to reject a null hypothesis that is false The calculation of β implies an alternative value of the population mean in terms of an unstandardized test statistic X For instance we can compute the probability of fail when we take no action when the energy consumption of the machines in our example is e.g. 470 kwh Thus the probability of a Type II error with such condition is: β = P(X xL | µ = 470) 25 / 31
  • 51. Example computing β In case that the hypothesized population mean is 470 kwh with σ = 5, and a sample size of 3, the value of β for a 5% confidence level is: β = P X−µ σ/ √ n 464.7−470 5/ √ 3 = P(Z −1.84) = 0.03 Thus when the mean is 470, the probability of incorrectly not rejecting a false H0 is 3% 26 / 31
  • 52. β with a different α The common significance level for social sciences is 5%; however if we change the α level, then we count with a different value of β as well For example, for a 1% significance level then z z.01 = 2.33 and the critical region becomes x 466.72 For µ = 470 the probability of a Type II error is: β = P X−µ σ/ √ n 466.72−470 5/ √ 3 = P(Z −1.34) = 0.09 or 9% hence there is the inverse relationship between α and β 27 / 31
  • 53. β and sample size By increasing the sample size to n = 5 we count with another critical region x 463.68 And for µ = 470 and a 5% significance level the probability of a Type II error becomes: β = P X−µ σ/ √ n 463.68−470 5/ √ 5 = P(Z −2.83) = 0.0023 ≈ 0 thus the better information is, the smaller probability of a Type II error 28 / 31
  • 54. Power of a test The power of a test is the probability of rejecting a null hypothesis that is false: power = 1 − β µ0 µ1zα H0 is rejected H0 H1 α 1 − β z 29 / 31
  • 55. Operating Characteristic Curve The power of a test is an indicator of its performance, and – having two tests with different power indices – we prefer the test with the higher power value Since power is related to Type II error, then by increasing the sample size, we increase also the power of the test Such relationship is represented by an operating characteristic curve or OC curve where power for different means is a function of the sample size The plotting of OC curves with different sample sizes is very useful e.g. for choosing a sampling plan ª in such plot values for β and for µ are in the y and x axes respectively 30 / 31
  • 56. H1 and Types I and II Errors Recall that the alternative hypothesis represents the condition we are investigating ª that is why it is also called the research hypothesis The question is whether or not taking an action is the appropriate decision ª in the example redesigning the machines for lower energy consumption We have to try to avoid concluding that there is enough evidence that maintaining the status quo: 1) is not cost-effective when in reality it is (Type I error) 2) is cost-effective when in reality it is not (Type II error) Thus by taking or not taking an action there is a potential of making an error, and we have to choose by calculating the greater cost 31 / 31
  • 57. BUSINESS STATISTICS I Lecture – Week 43 (45) · Summary Antonio Rivero Ostoic School of Business and Social Sciences  October  AARHUS UNIVERSITYAU
  • 58. Today’s Agenda Assignment 1: Probabilities, distributions, expected value and variance, ... Assignment 2: Hypothesis testing, confidence intervals, sampling, ... Assignment 3: Expected variance, SD, covariance, ... 2 / 18
  • 59. Assignment 1 Question 1a In a university there are three study programmes, A1, A2, and A3, with an enrolment of respectively 50%, 30%, and 20% of undergraduate students. There are 60% of the students that are graduated, B, and from them: • 25% choose programme A3 • twice as many that follow programme A2 choose programme A1 Q 1a. State the information (and comment) - P(A1) = .50 P(A2) = .30 P(A3) = .20 - P(B) = .60 ⇒ P(B ) = .40 - P(A3 | B) = .25 - P(A1 | B) P(A2 | B) = 2 3 / 18
  • 60. Question 1b Assignment 1 Q 1b. From those following A3, how large is the proportion that graduates? • We want to find P(B | A3), which is the conditional probability of two dependent events, and we can use the Bayes theorem: P(B | A3) = P(B ∩ A3) P(A3) = P(B) · P(A3 | B) P(A3) = .60 × .25 .20 = .75 There is a 75% probability that a student that follows programme A3 graduates from this education ª Note that P(B ∩ A3) = P(B and A3), and P(B ∪ A3) = P(B or A3) 4 / 18
  • 61. Question 1c Assignment 1 Q 1c. From those following A1, how large is the proportion that does not graduate? • Now we want to find P(B | A1): P(B | A1) = P(B ∩ A1) P(A1) = P(B ) · P(A1 | B ) P(A1) = .40 × P(A1 | B ) .50 ª In this case we have to find first the conditional probability P(A1 | B ) 5 / 18
  • 62. Question 1c cont. – Assignment 1 • Remember that we want to find P(A1 | B ). - From 1 − P(A3 | B) we have that P(A1 | B) + P(A2 | B) = 1 − .25 = .75 also from P(A1 | B) P(A2 | B) = 2 we deduce that P(A2 | B) = .75 3 = .25 which means that P(A1 | B) = .50 then P(B ∩ A1) = .60 × .50 = .30 - For P(B ∩ A1) the following expression applies: P(B ∩A1) P(B ∩ A1) = P(B ) P(B) P(B ∩ A1) = .30×.40 .60 = .20 - From P(B ) · P(A1 | B ) = P(B ∩ A1) we deduce that P(A1 | B ) = .20 .40 = .50 as a result, P(B | A1) = .40×.50 .50 = .40 There is a 40% probability that a student that follows programme A1 does not graduate from this education 6 / 18
  • 63. Question 1 – Assignment 1 Probability tree • P(B ) P(A3 | B ) P(A2 | B ) P(A1 | B ) .50.40 P(B) P(A3 | B) .25 P(A2 | B) P(A1 | B) .50 .60 P(B ∩ A1) = .30 P(B ∩ A1) = .20 7 / 18
  • 64. Question 2 Assignment 1 Assume that the number of graduates from programme A3 follows the Poisson distribution with µ = 15. Q 2a. What is the expected number of graduates from this study programme, and what is the standard deviation? X: number of graduates from A3 X ∼ P(µ = 15) ª Always check and comment first the assumptions of the distribution • E(X) = V(X) = µ = 15 • SD(X) = V(X) = √ 15 = 3.873 The expected number of students who graduate from A3 is 15 with a standard deviation of 3.873 8 / 18
  • 65. Question 2b Assignment 1 Q 2b. What is the probability that more than 20 students graduate from study programme A3? • This is P(X 20 | µ = 15) = 1 − P(X 20 | µ = 15) and from the Poisson probabilities table we obtain the last value which is = 1−.917 = .083 There is 8.3% probability that more than 20 students graduate from programme A3 9 / 18
  • 66. Question 3 Assignment 1 Q 3. What is the probability that more than 20 out of 25 of those following study program A3 graduate? ª Hint: use your answer from question 1b X: number of graduates from A3 X ∼ B(n = 25, p = .75) ª first check and comment the assumptions of the distribution • Here we want P(X 20 | n = 25, p = .75) = 1 − P(X 20 | n = 25, p = .75) and from the Binomial table for n = 25, p = .75, and x 20 we obtain = 1− .7863 = .2137 There is 21.37% probability that more than 20 out of 25 of those following program A3 graduate from this study 10 / 18
  • 67. Assignment 2 Question 1 The height of 20 randomly chosen people enrolled at a university has been measured with an average of 182cm, and young people in general have an average height of 180cm with a standard deviation of 12cm. Q 1. Are the people just enrolled at a university taller than young people in general? • First, our parameter of interest is young people’s height, µ Population: µ = 180, σ = 12 • Then we formulate the null and alternative hypothesis H0 : µ = 180 H1 : µ = 180 ª although from the question one may say that H1 : µ 180, the research hypothesis is formulated before the sampling takes part and it just suggests that the average height among young people is just different Sample. X: height of people just enrolled at the university x = 182, n = 20 11 / 18
  • 68. Question 1 cont. – Assignment 2 • The next step is to state the significance level, and in this case we assume a standard significance level of 5% or α = .05 • The rejection region corresponds here to a two-tail test with the rejection region in both extremes of the sampling distribution zα/2 = z.05/2 = z.025 = −1.96 and z1−α/2 = z1−.05/2 = z.975 = 1.96 ª if z −1.96 or z 1.96 we reject H0; otherwise H0 is not rejected • We select and compute the test statistics for µ, σ known (z-test) z = zobs = x−µ σ/ √ n = 182−180 12/ √ 20 = .75 since zobs is not in the rejection region we have not sufficient statistical evidence to reject H0 12 / 18
  • 69. Question 1 cont. (2) – Assignment 2 • The p-value should be computed as well p-value = 2 · P(Z .75) = 2 · P(Z −.75) = 2 × .2266 = .4532 having a large p-value, we are unable to reject the null hypothesis in favour of the alternative • We conclude that the average height of people just enrolled at the university is not different than young people in general 13 / 18
  • 70. Question 2 Assignment 2 Q 2. Construct a 95% confidence interval for the height of people enrolled. • This is a confidence interval estimator of the population mean, µ for σ = 12; x = 182, n = 20; 1 − α = .95 (i.e. the confidence level) • Confidence limits for µ are x ± z1−α/2 · σ√ n where z1−α/2 = z.975 = 1.96 µ = 182 ± 1.96 × 12√ 20 = 182 ± 1.96 × 2.68 µ = 182 ± 5.26 µ ∈ [176.74; 187.26] 14 / 18
  • 71. Question 3 Assignment 2 Q 3. What is the probability that a randomly chosen enrolled person is taller than 192cm? • Since the standard deviation parameter is 12cm and assuming that the population is approximately normally distributed, we can then apply the empirical rule where ≈ 68% of all observations fall within one standard deviation. As a result, approximately 16% of a randomly chosen enrolled person is taller than 192cm 15 / 18
  • 72. Assignment 3 Question 1 You own properties X and Y that are to be sold by auction with estimate values of 10 and 20 million respectively. The bids for both properties are assumed to be approx. normal distributed with standard deviations of 1 and 2 million respectively. Q 1. What is the standard deviation that the auction brings for the two properties? (where S = X + Y) • Here we apply the law of variance for two random variables V(X + Y) = V(S) = V(X) + V(Y) + 2 · Cov(X, Y) assuming that X and Y are independent to each other, Cov(X, Y) = 0 V(S) = 12 + 22 + 0 = 5 SD(S) = V(S) = √ 5 = 2.24 If X and Y are uncorrelated, then the standard deviation for the two properties is 2.24 and the variance is 5 16 / 18
  • 73. Question 3 Assignment 3 Q 3. What is standard deviation of what the auction will produce for two properties assuming that the correlation coefficient is .4? • When the correlation (i.e. the proportion of the covariance of X, Y and their SDs) differs from 0 then there is a linear relationship among the involved variables ρ = σxy σxσy = Cov(X,Y) σxσy Cov(X, Y) = ρ · V(X) · V(Y) Cov(X, Y) = .4 × 12 × 22 = .8 - Hence V(S) = 5 + 2 × .8 = 6.6 SD(S) = V(S) = √ 6.6 = 2.57 For dependent variables X and Y the standard deviation for the two properties is 2.57 and the variance is 6.6 17 / 18
  • 74. Question 4 Assignment 3 Q 4. What is the probability that the auction will produce more than 31 million for the two properties? • Assuming independence among X and Y: P(S 31 | µ = 30; σ = 2.24) = P(S−µ σ 31−30 2.24 ) = P(Z 31−30 2.24 ) = P(Z .45) 1 − P(Z −.45) = .3264 • Assuming dependence: P(S 31 | µ = 30; σ = 2.57) = P(S−µ σ 31−30 2.57 ) = P(Z 31−30 2.57 ) = P(Z .39) 1 − P(Z −.39) = .3483 18 / 18
  • 75. BUSINESS STATISTICS I Lecture – Week 46 Antonio Rivero Ostoic School of Business and Social Sciences  November  AARHUS UNIVERSITYAU
  • 76. Today’s Agenda 1. Brief Review on Hypothesis Testing 2. Inference about µ when σ is unknown – test statistic – p-value – required conditions – estimation for finite populations 2 / 22
  • 77. Review of Hypothesis Testing Hypothesis testing is actually null hypothesis testing and it concerns a population parameter The research hypothesis must contradict the proposition of the null hypothesis, and it constitutes the investigator’s belief on such parameter The decision rule to reject or not the null hypothesis depends on: • the formulation of H1 • the test statistic (and related p-value) • the level of significance α 3 / 22
  • 78. Review of Hypothesis Testing Test statistic Loosely speaking, a test statistic is a measure of how extreme a statistical estimate is A test statistic (like the z-statistic) is the proportion of: • the departure of an estimated parameter from its theoretical value • to its standard error The use of the standard error implies that the test statistic links the null hypothesis to sample data If the sample data are not very unlikely if the null hypothesis is true then we fail to reject the null hypothesis If the sample data are very unlikely if the null hypothesis is true then we reject the null hypothesis ª in this case we should report the p-value as well 4 / 22
  • 79. The z-statistic To make inferences about the population mean we applied a test statistic based on the standardized normal distribution z = x − µ σ/ √ n That is the proportion of the difference of the mean statistic and parameter to the standard deviation of the sampling distribution But the standard error of the mean requires knowing the standard deviation of the population, which typically is unknown 5 / 22
  • 80. The t-statistic A more realistic scenario is to make estimations and testing of the population mean when the standard deviation parameter is not known When σ is unknown then the standardized normal distribution becomes insufficient However we can make the calculations of the standard error with the sample standard deviation s rather than σ, and this type of assessment correspond to the t-statistic 6 / 22
  • 81. Inference about µ when σ is unknown Test statistic When the standard deviation parameter is unknown the test statistic for the population mean is defined as Test statistic for µ, σ unknown t = x − µ s/ √ n that is Student t distributed with ν = n − 1 degrees of freedom • This is called a one sample t-test, and assumes a normal population 7 / 22
  • 82. Inference about µ when σ is unknown Confidence estimator The confidence limits for the t statistic is defined as well Confidence interval estimator for µ, σ unknown x ± tα/2 s √ n (ν = n − 1) that is for the same number of degrees of freedom and a pre-established significance level 8 / 22
  • 83. t and Z distributions 0 Z t ª Recall that both distributions are symmetric about 0, and that as n → ∞, t → z 9 / 22
  • 84. Example t-statistic Vending machines A random sample of 15 of our vending machines shows that the response time in seconds to deliver a soft drink is 2.125 seconds on average. Data cf. lecture week 41(43) But the competition is about to launch a new vending machine model that might deliver the product faster than ours and according to their specifications it is going take about 2 seconds. Do we have enough evidence to conclude that our vending machines are still competitive? • In this case the research hypothesis is in relation to the competition H1 : µ 2 whereas the null hypothesis is H0 : µ = 2 10 / 22
  • 85. Example t-statistic II Since we do not count with the population standard deviation, we apply the t test statistic with the usual 5% α level and check that t tα,ν ª In this case we need the value of s, which is .411 • The test statistic is computed next t = 2.125−2 .411/ √ 15 = 1.18 and we calculate the rejection region for n − 1 df as t.05,14 = 1.761 ª Because the score of the test statistic is smaller than the critical value we do not reject the null hypothesis in favor to H1 There is not sufficient statistical evidence that the response time for our machines exceeds the 2 seconds 11 / 22
  • 86. The p-value Recall that the p-value is the probability of a test statistic at least as extreme as the one from the sample given that the null hypothesis is true That is the probability of getting the observed value of the test statistic, or a value with even greater evidence against H0, if the null hypothesis is true Thus the p-value is the measure of the strength of the evidence against the null hypothesis If p-value α, the null hypothesis is rejected and the evidence against H0 is significant at the α level of significance 12 / 22
  • 87. p-value z test For the z statistics, we can get exact p-values from the cumulative standardized normal probabilities table Lower-tail p-value = P(Z zobs) Upper-tail p-value = P(Z zobs) = 1 − P(Z zobs) Two-tail p-value = P(Z zobs) or P(Z −zobs) = 2 · P(Z |zobs|) = 2 · 1 − P(Z |zobs|) 13 / 22
  • 88. p-value t test In the case of the t-statistic the critical values of the Student t distribution provides a range for the p-value For the example, we find from the t table for a sample size of 15 that the closest critical value to the t score is t(.100,14) = 1.345 and 1.345 1.18 which means that .10 P(t 1.18) and hence we can reasonably say that p-value 10% 14 / 22
  • 89. Example t-statistic revisited Vending machines In order to be ‘competitive’ our machines should be faster than the machines of the competition, and the research hypothesis can be formulated as H1 : µ 1.9 In this case the outcome of the test statistic becomes t = 2.125−1.9 .411/ √ 15 = 2.12 ª Now the test statistic score is greater than the critical value at .05 α level, which means that we reject the null hypothesis in favor of the alternative As a result there is enough statistical evidence that the response time for our machines exceeds the 1.9 seconds 15 / 22
  • 90. Example t-statistic revisited II Vending machines For a t score of 2.12 the p-value is calculated as follows 1.761 2.12 2.145 which means that .05 P(t 2.12) .025 Thus the p-value lies between 2.5% and 5% and it is under the significance level, which means that H0 is rejected in favor of the alternative 16 / 22
  • 91. Required conditions t-statistic The t-statistic assumes that the population from which the sample comes from is normal distributed In fact the t-test has been shown to be robust, which means that the estimations are still valid for nonnormal porpulations ª this statistic may not work for extremely nonnormal populations Consequently it is important to check this required condition by plotting the histogram of the sample data 17 / 22
  • 92. Histogram for the Example Vending machines 1.5 2 2.5 3 0 1 2 3 4 Time (seconds) Frequency 18 / 22
  • 93. Finite populations t-statistic The test statistics used assume populations with infinite size, but in practice most of the populations are finite For populations with small size we need to correct the confidence estimators and test statistics with a factor, which is close to 1 with relative large populations ª and thus we ignore the population correction factor A ‘small’ size population is less than 20 times the sample size 19 / 22
  • 94. Finite populations Confidence estimators One advantage of having finite populations is that we can produce confidence interval estimators of the total population This is done by multiplying the confidence limits of the mean estimate by the population size x ± tα/2 s √ n · N 20 / 22
  • 95. Example Confidence Interval Estimator Vending machines For an upper tail test statistic, a 95% confidence interval for the mean is calculated as x − t1−α,ν · s√ n 2.125 − t.95,14 × .411√ 15 2.125 − 1.761 × 0.11 ª LCL = 1.93 And a 99% confidence interval is 2.125 − t.99,14 × .411√ 15 2.125 − 2.624 × 0.11 ª LCL = 1.84 21 / 22
  • 96. Summary Both the z-test and the t-test is to make inferences about the population mean The difference between these two statistics is that the standard error of the mean of the t statistic is based on the sample standard deviation, whereas the z-statistics requires σ This means that the t-test is more realistic since we typically do not know the value of the standard deviation parameter 22 / 22
  • 97. BUSINESS STATISTICS I Lecture – Week 47 Antonio Rivero Ostoic School of Business and Social Sciences  November  AARHUS UNIVERSITYAU
  • 98. Today’s Agenda 1. Confidence interval estimators for statistical inference 2. Inference about a population variance – test statistic – confidence estimator – p-value 2 / 21
  • 99. Intro Most of the statistical inference we have seen so far has been made through a hypothesis testing We used a test statistic for a single population mean and we compared a group of data to a theoretical value Hypothesis testing results in either rejecting or not rejecting H0 However another way to draw conclusions about a parameter like the population mean can also be made by constructing a confidence interval about the mean As a result the inference process about a parameter implies both estimating a value and testing a hypothesis 3 / 21
  • 100. Confidence interval approach µ In the formulation of the null hypothesis the question is many times whether or not the true e.g. mean of the population agrees with an assumed mean Such type of question gives rise to a two-tailed test, and the interval estimator for the population mean corresponds to a two-sided confidence interval So the boundaries of the interval for µ when σ is unknown for ν = n − 1 is x ± tα/2, ν · s√ n That leads to lower and upper confidence limits depending on the direction of the maximum error estimate 4 / 21
  • 101. Confidence interval approach II µ However, H0 can be formulated with other types of questions such as the true mean is less or greater than the assumed mean In such cases we perform a one-tailed test, and for these two other cases we compute a one-sided confidential interval for the population mean Lower and Upper one-sided confidence interval for µ when σ is unknown for ν = N − 1 are µ X + tα, ν · s√ N and µ X + t1−α, ν · s√ N 5 / 21
  • 102. Confidence Interval One-sided Upper Tail Example w 47 revisited In the vending machines example (cf. lecture week 47), the 95% one-sided CI for the mean for an upper tail t test statistic was defined as x − t1−α, ν · s √ n In this case the multiplier for the one-sided upper tail represents a probability less than the critical value t1−α, ν And this means we consider the left part of the critical values of the Student t distribution Thus the CI estimation for t.95, ν and t.99, ν correspond to α = .05 and α = .01 respectively in the right tailed t table 6 / 21
  • 103. Inference about variability Besides the population mean, another parameter of interest in statistical inference is the variability in the population ª Inferences about the population variability allow us e.g. to measure the risk or the consistence of a product or process according to a determinate standard Typically we want to see and test whether or not the sample data is consistent with the nominal standard deviation parameter However since there is no statistical technique to test directly σ, we can indirectly perform such type of assessment by testing the variance of the population, σ2 Hence, as with the population mean, the research questions regarding the true variance is whether or not agree with an assumed value, or if is greater or less than the nominal value H1 : σ2 = σ2 0 H1 : σ2 σ2 0 H1 : σ2 σ2 0 7 / 21
  • 104. The chi-squared statistic Testing and estimating a population variance To test hypotheses about the population variance corresponds to the chi-squared statistic or χ2-statistic χ2 = (n−1)s2 σ2 0 that is chi-squared distributed with ν = n − 1 degrees of freedom This test statistic employs the sample standard deviation s and it assumes a normal population with variance σ2 8 / 21
  • 106. Critical values of the χ2 distribution Unlike the standard normal and t distributions, the χ2 distribution is non-negative and asymmetrical This means that while for a two-tailed t test we applied the rule t1−α, ν = −tα, ν, for the chi-square statistic we require distinct critical values for both tails of the distribution Sometimes the upper- and lower-tail critical values of the χ2 distribution are given in separate tables or else in a single table The critical values of the chi-square distribution allows to demarcate the rejection region of the χ2 statistics, and they depend on the chosen α level and the value of ν 10 / 21
  • 107. Critical values of the χ2 distribution II To reject H0 we check for a two-tailed test that χ2 χ2 α/2, ν or χ2 χ2 1−α/2, ν Whereas for an upper and lower tailed test the null hypothesis is rejected if χ2 χ2 α, ν χ2 χ2 1−α, ν 11 / 21
  • 108. Example χ2 statistic Vending machines We have seen previously from a random sample n = 15 that the response time of our vending machines to deliver the product is on average 2.125 seconds. From technical specifications the standard deviation parameter is .38 seconds. cf. lecture week 41(43) • Thus x = 2.125, whereas σ2 = (σ)2 = .382 = .1444 Is there sufficient statistical evidence from the sample data to claim that the variability in time response is not larger such theoretical value? • Now the research hypothesis is related to the population variance H1 : σ2 .1444 and the null hypothesis is (or should be) H0 : σ2 = .1444 (H0 : σ2 .1444) 12 / 21
  • 109. Example χ2 statistic II test statistic For the variance parameter we apply the χ2 statistic with the standard significance level of 5% χ2 = (n−1)s2 σ2 0 ª And the computation requires the sample variance s2 = (s)2 = .4112 = .169 So the test statistic is χ2 = 14×.169 .1444 = 16.39 With the lower-tail critical value of χ2 .95,14 = 6.57 • Because the test statistic (16.39) is larger than the critical value (6.57) we are unable to reject the null hypothesis There is insufficient evidence to claim that to the variability in time response is not greater than the value given in the technical specifications 13 / 21
  • 110. Example χ2 statistic III upper test However, most of the times we want to test whether or not the lack of precision in a certain process or product exceeds a particular value specified in the standards. In such case the claim we want to test is whether or not the standard deviation of the vending machines do not exceed .38 seconds, which means that the research hypothesis becomes H1 : σ2 .1444 • Here the comparison of the test statistic with the critical value is χ2 χ2 α,ν • And since the test statistic value 16.39 is smaller than χ2 .05, 14 = 23.7, then we are unable to reject the null hypothesis We do not have sufficient evidence either to claim that the time response is greater than the value given in the specifications 14 / 21
  • 111. Sampling distribution for the example lower and upper tails 0 | 16.39 | 6.57 χ2 f(χ2 ) ν = 14 0 | 16.39 | 23.27 χ2 f(χ2 ) ν = 14 15 / 21
  • 112. Interval estimation Another way to make inferences about the population variance is through interval estimation In this case the confidence interval is delimited by lower and upper critical values, which depend on the sample size and the level of significance Confidence Interval 0 | UCL | LCL χ2 f(χ2 ) 16 / 21
  • 113. Confidence Interval Estimator The confidence interval estimator of σ2 comes from the probability statement that leads to the boundaries of the interval P χ2 1−α/2 χ2 χ2 α/2 = 1 − α Lower Confidence Limit (LCL): (n − 1)s2 χ2 α/2 Upper Confidence Limit (UCL): (n − 1)s2 χ2 1−α/2 17 / 21
  • 114. Example Confidence Interval of σ2 vending machines For a 95% confidence level we obtain the limits of the confidence interval are LCL = (15−1).4112 χ2 .05/2 = 14×.169 26.1 = .01 UCL = (15−1).4112 χ2 1−.05/2 = 14×.169 5.63 = .42 σ2 ∈ [.01; .42] ª Thus the variance of response time lies between .01 and .42 seconds 18 / 21
  • 115. One-sided Confidence Intervals for σ2 For one-tailed χ2 tests of σ2 with ν = N − 1 the lower and upper one-sided confidence interval are σ2 (N−1)s2 χ2 1−α, ν 0 σ2 (N−1)s2 χ2 α, ν ª keeping in mind that we are computing confidence intervals when looking at the critical values of the χ2 distribution table 19 / 21
  • 116. p-value χ2 statistic In case that the null hypothesis is rejected, we should compute the p-value as well, and we can approximate the range of this probability with the critical values table of the χ2 distribution In the example the value of the test statistic 16.39 for n = 15 is calculated with the lower tail critical values of the chi-square distribution 16.39 χ2 1−.90,14 = 7.79 for the upper tail critical values 16.39 χ2 .10,14 = 21.1 thus .10 P(χ2 7.79) or P(χ2 21.1) We can reasonably say that the p-value is larger than 10% 20 / 21
  • 117. Summary Alongside with making inferences about a central location parameter like the mean, we make conclusions about the variability of the population In such case we performed a hypothesis test and estimation for the population variance through the chi-square test statistic, which is an indirect method to infer about the standard deviation parameter However, since the chi-square distribution is nonnegative and positive skewed, we require specific critical values for both sides of the distribution in two-sided tests 21 / 21
  • 118. BUSINESS STATISTICS I Lecture – Week 48 Antonio Rivero Ostoic School of Business and Social Sciences  November  AARHUS UNIVERSITYAU
  • 119. Today’s Agenda 1. Inference about a Population Proportion – hypothesis testing – confidence interval 2. Selecting the Sample Size 3. Exact probabilities – Binomial and hypergeometric 2 / 26
  • 120. Intro The tests we have seen until now both for the population mean and variance are designed for interval data However many times we confront with nominal data containing different categories With nominal data parameters like the mean and variance are no longer valid, but rather proportions Thus the parameter of interest for describing the population is p that represents the population proportion 3 / 26
  • 121. Test of hypotheses about proportions To make inferences about the population proportion we test research questions regarding the proportion of successes in a sample distribution The sample follows the binomial distribution since there are two possible outcomes, namely a success or a failure In hypothesis testing the research questions deal on whether the recommended proportion of successes p0 is within a recommended limit, or else if it is less or greater than the prescribed boundary p = p0 p p0 p p0 4 / 26
  • 122. Test statistic for p The inferences about the population proportion are made by means of the sample proportion, which is the ratio of the number of success x to the sample size n ˆp = x n The sampling distribution of ˆP is approximately normal distributed with mean p and standard deviation p(1−p) n 5 / 26
  • 123. Test statistic for p z score The test statistic depends on a normal approximation, and it is based on a z score z = ˆP − p0 p0(1−p0) n provided that the sample size is sufficient large 6 / 26
  • 124. One and two-sided tests for proportion cumulative Z table The two-sided test with a significance level α is based on z scores where the null hypothesis is rejected whenever z zα/2 or z z1−α/2 For the upper and lower tailed test to reject H0 there is a single comparison to be made z z1−α z zα 7 / 26
  • 125. Example testing proportions Vending machines • The proportion of defective vending machines in our sample are the units having a response time greater than the upper 95% confidence level ª The value of the UCL was calculated to 2.32 seconds -cf. lecture week 41 (43)- and the defective units in the sampling are then emphasized 2.37 1.95 1.49 2.05 2.27 2.53 1.87 2.42 1.43 2.24 2.69 2.16 1.88 1.71 2.82 This means that, out of 15 machines, 5 have shown to be defective. Hence ˆp = 5 15 = 1 3 or equally 0.333 8 / 26
  • 126. Example testing proportions p0 • The specifications for the vending machines however establish that a defective machine is a unit having a response time greater than 2.50 The defective machines in the sample according to the prescribed limits are emphasized in bold 2.37 1.95 1.49 2.05 2.27 2.53 1.87 2.42 1.43 2.24 2.69 2.16 1.88 1.71 2.82 And the proportion in this case is 3 15 = 0.2, which will represent the parameter ª but be aware that the proportion parameter can come from another source 9 / 26
  • 127. Example testing proportions hypothesis formulation The hypotheses are formulated in order to answer a question like: • Should we invest in a new product delivery system in the vending machines to fulfill the technical specifications? Hence we want to see whether there is enough statistical evidence to claim that the proportion of defects units found in the sample data is larger than the population proportion. And in this case we perform a one-sided test where the null hypothesis is that p = p0, whereas the alternative hypothesis is that p p0 10 / 26
  • 128. Example testing proportions test statistic The test statistic takes the sample proportion as the departure from the prescribed limit and the standard error of the proportion (e.g.) z = ˆP−p0 p0(1−p0) n = 0.333−0.2 0.2(0.8) 15 = 1.41 ª This outcome has to be confronted to the critical value z.95 = 1.645 from the cumulative Z probabilities table • Since the value of this test statistic 1.41 is less than the critical value (1.645) we are not able to reject H0 There is not sufficient evidence at the 5% significance level to claim that the sample proportion of defect machines exceeds the population proportion and hence no new product delivery system is indeed needed. 11 / 26
  • 129. Confidence interval estimator of p The confidential interval estimator of the population proportion comes from the sampling distribution ˆp ± zα/2 · p(1−p) n However the problem lies on the standard error of the proportion since this estimate requires the value of the parameter we wish to draw conclusions about We can solve this issue by invoking the central limit theorem in which any population is considered approx. normal with a sufficiently large sample size, and use the sample proportion ˆp as the best estimator of p ª this is possible because ˆp equals x n , and this is the sample average 12 / 26
  • 130. Confidence interval estimator of p with sampling proportions By modifying the standard error of the proportion, the confidential interval estimator of p becomes ˆp ± zα/2 · ˆp(1−ˆp) n for a sufficient large sample size at 100(1 − α)% confidence level 13 / 26
  • 131. Example CI for Proportions Vending machines • We wish to find the proportion of defective vending machines in our sample that are the units having a response time greater than the upper 95% confidence level. ª Since the UCL equals to 2.32 seconds -cf. lecture week 41 (43)- the defective units in the sampling are emphasized 2.37 1.95 1.49 2.05 2.27 2.53 1.87 2.42 1.43 2.24 2.69 2.16 1.88 1.71 2.82 This means that, out of 15 machines, 5 have shown to be defective. • As a result, ˆp = 5/15 = 0.333, and the maximum error of the estimate is 1.96 × 0.333(1 − 0.333)/15 = 0.239 0.333 ± 0.239 LCL: 0.094; UCL: 0.572 14 / 26
  • 132. Selecting the Sample Size Since the test statistic for a proportion is approximate, the size of the sample should be large enough to be valid However, even for a quite large sample the actual distribution of the parameter representing ˆp is considerably nonnormal Another problem is that if there is any success in the trial it implies that there is any success in the population either and that may in reality not be the case There are different criteria to choose the appropriate value for n, and an important condition both for hypothesis testing and confidence estimation is that n p0, n(1 − p0) 5 ª thus if the value of p0 is 0.1 then n should be at least 51, for p0 = 0.01 then n 501... 15 / 26
  • 133. Selecting the Sample Size estimation error We can also calculate the probability of error in the estimation of the proportion related to the maximum error estimate at certain confidence level In this case the bound on the error of estimation is B = zα/2 ˆp(1 − ˆp) n And the sample size to estimate a proportion is n = zα/2 ˆp(1 − ˆp) B 2 The problem is that this formula requires the value of ˆp, which usually is unknown before the sample takes place A possibility is to give to the sample proportion of successes a 50% chance of occurring, or else to assign ˆp a known value of the proportion parameter 16 / 26
  • 134. Selecting the Sample Size Wilson estimate For small samples with no successes the Wilson estimate adds 2 to the number of successes and 4 to the sample size, i.e. ˜p = x+2 n+4 In this case the standard error of ˜p is σ˜p = ˜p(1−˜p) n+4 And the confidence interval estimator of the population proportion becomes ˜p = zα/2 · ˜p(1 − ˜p) n + 4 17 / 26
  • 135. Estimating the Total Number of Successes finite population It is possible for large finite populations to calculate confidence estimators of the total population This is done by multiplying the confidence limits of the proportion estimate by the population size ˆp ± zα/2 ˆp(1−ˆp) n · N 18 / 26
  • 136. Example Sample size method 2 • The sample size for proportions within 3% error margin with 95% confidence level is n = 1.96· √ ˆp(1−ˆp) .03 ª In the case of the vending machines the interval estimation for such confidential level is ˆp = 0.333, which means that n = 1.96× √ 0.333(0.666) .03 2 = (30.79)2 948 Thus we need a sample size of at least 948 units to get a 3% error estimate with the desired confidence level 19 / 26
  • 137. Binomial distribution exact probabilities The proportion or successes in a sample follows the binomial distribution in which p is the probability of a particular item being found as a success Hence when dealing with proportions it is also possible to obtain exact probabilities through an exact binomial test ª recall that with samples following continuous distributions the point probability is 0 Typically the test of a hypothesis involving the probability of success in a binomial experiment is like that H1 : p = .05, but one-sided tests are also possible In case we want to obtain exact probabilities we can use the tables for the Binomial probabilities 20 / 26
  • 138. Binomial distribution mass function For samples with a different size than the available tables (typically large samples) we can approximate the p-value through the probability mass function of the binomial distribution P(x) = n x px(1 − p)n−x ª for x = 0, 1, 2, . . . , n successes and the probability of observing successes is conditional on the value assigned to p 21 / 26
  • 139. Example Binomial test p-value • In a lot where the rate of defectives is 5% or more, we can look at a random sample of 50 pieces and compute the probability of finding one (or less) defective item H0 : p .05, n = 50, x = 1 ª Thus we state the null hypothesis for a one-sided test in which the alternative hypothesis where true probability of success is less than 5% We then perform an exact binomial test and the p-value for this hypothesis is calculated as follows p-value = P(X 1 | n = 50, p = .05) = 50 0 × .050 × (1 − .05)50 + 50 1 × .051 × (1 − .05)49 = .077 + .202 = .279 22 / 26
  • 140. Hypergeometric distribution exact probabilities Another approach in getting exact probabilities is through a hypergeometric experiment this distribution is for the probability of x successes in a trial without replacement For example, to compute the possibility in hand of 5 cards of getting 3 or more out of, say the 4 A’s, over repeated draws from a pack of 52 cards we use the probability mass function of the hypergeometric distribution P(x) = (k x)(N−k n−x) (N n) where N = 52, n = 5, k = 4, x = 3 23 / 26
  • 141. Hypergeometric distribution test p-value • In a test statistic the function of the problem just posed is represented with p denoting a true probability H0 : p = 4 52 ; N = 52, k = 4, n = 5, x = 3 ª Hence the null hypothesis for a two-sided test where H1 : p = 4 52 Again, we perform an exact test and the p-value for this hypothesis is represented as follows p-value = 2 · P(X 3 | N = 52, k = 4, n = 5) = 2 × 4 3 · 52−4 5−3 52 5 + 4 4 · 52−4 5−4 52 5 = 2 × 4 3 · 48 2 52 5 + 4 4 · 48 1 52 5 = 2 × (.0017361 + .0000185) = .0035091 24 / 26
  • 142. Probabilities in the example Hypergeometric distribution 1 2 3 4 0.0 0.1 0.2 0.3 N = 52, n = 5, k = 4 25 / 26
  • 143. Summary In Chap. 12 we compare a single sample with a target represented by a theoretical value Thus – besides a one-sample statistic for the mean and a one-sample statistic for the variance – we have seen a one-sample percentage success that serves to represent categorical variables In is possible to compute interval estimators via normal approximation, and exact probabilities with the binomial or the hypergeometric distribution 26 / 26
  • 144. BUSINESS STATISTICS I Lecture – Week 49 Antonio Rivero Ostoic School of Business and Social Sciences  December  AARHUS UNIVERSITYAU
  • 145. Today’s Agenda Inferences about Comparing Two Populations: 1. Difference between Two Means 2. Ratio of Two Variances 3. Test of σ2 1/σ2 2 4. Test and Estimation of µ1 − µ2 2 / 30
  • 146. Intro Comparing the characteristics of two populations or two groups is essential for social sciences, business, and also for medical studies We can compare for instance the mean income of males and females with similar education and job experience Or if we wish to compare data based on two different processes generating the same product and assess which process performs better ª or else whether the two processes produce the same proportion of defective items Another possible comparison is between an experimental group and a control group of patients and we look at a specific parameter 3 / 30
  • 147. Comparing two groups Statistical inferences about comparing two populations are based on sample data corresponding to each population However sometimes just a single population may be involved with samples at two different points of time in a type of study known as longitudinal Another possibility is to have a large sample of cross-sectional data that is from at a single point of time, which is divided into two subsamples corresponding to a variable such gender with a pair of categories 4 / 30
  • 148. Comparing two groups inference Inferences are based either on two independent random samples or else on two dependent samples with a natural matching between each individual in one sample and an individual in the other sample ª each case requires a specific statistical method for the analysis We rely on hypothesis testing and confidence estimation to make inferences about comparing two populations where the objective is typically to determine whether or not the populations are similar For the comparison we can look at the central location in the two sample distributions where the variability parameter in the populations is known Or we may not know the variability in the populations and hence we can make inferences about the population variance or standard deviation as well 5 / 30
  • 149. Comparing independent samples from two populations Population 1 Parameters: µ1, σ2 1 ª Statistics: x1, s2 1 Population 2 Parameters: µ2, σ2 2 ª Statistics: x2, s2 2 ª with sample sizes n1 and n2 respectively we assume that x1 − x2 is the best estimator of µ1 − µ2 6 / 30
  • 150. Sampling distribution of X1 − X2 Expectations of x1 − x2 E(x1 − x2) = µ1 − µ2 (value) V(x1 − x2) = σ2 1 n1 + σ2 2 n2 (variance) SE(x1 − x2) = σ2 1 n1 + σ2 2 n2 (standard error) x1 − x2 is normally distributed if the populations are normal and approx. normal if the populations are nonnormal and with large sample sizes 7 / 30
  • 151. Difference between Two Means hypothesis tests For two random samples X1 and X2 that are independent to each other we look at the two mean populations and try to infer whether or not the means are the same Hence the null premise takes the true mean of the first population µ1 against the true mean of the second population µ2, and the research hypotheses are: µ1 = µ2 or (µ1 − µ2) = 0 µ1 µ2 or (µ1 − µ2) 0 µ1 µ2 or (µ1 − µ2) 0 thus we do not compare the parameter to a nominal value as when we considered a single group 8 / 30
  • 152. Test Statistic and Interval Estimation z, µ1 − µ2, independent samples Because of the normal approximation of the populations we benefit from the z statistics to make inferences about µ1 − µ2 In such case the statistic is the proportion of the difference between the estimate of the parameter and the null hypothesis value of parameter to the standard error of estimator z = (x1−x2) − (µ1−µ2) σ2 1 n1 + σ2 2 n2 Whereas the confidence interval estimator is (x1 − x2) ± zα/2· σ2 1 n1 + σ2 2 n2 9 / 30
  • 153. Variance parameters in µ1 − µ2 However the problem of using the z test statistics is that it requires knowing the variance parameters And since the variance parameters are typically not known when comparing two populations, we need to address this problem and modify the standard error in the test statistics A less stringent test statistic than the z score was found in the t statistic, which is used when the variability parameter is unknown In the case of the difference between two means we are still going to benefit from the t scores both for testing and for the estimation ª and it corresponds in this case to a 2-sample t statistic 10 / 30
  • 154. Test Statistic for µ1 − µ2 For the difference between two means the t test statistic with small sample sizes comes in two flavors: Equal variances – i.e. statistically equal even if the values may be numerically different – here we try to find the weighted mean of the variance where the degrees of freedom are the weighting factors Unequal variances – in this case there is no attempt made to average the variances together, and the number of degrees of freedom is adjusted ª Thus to apply the appropriate t test statistic for the difference between two means we need to determine whether or not the two population variances differ 11 / 30
  • 155. Inferences about σ2 When the population variances are not known we can make inferences about the parameters based on sampling distributions corresponding to each population And we perform a test in order to gather sufficient statistical evidence to infer that the variability in both populations is equal or not equal Such type of problem corresponds to a test of the ratio of two variances, and the hypothesis testing tries to find out whether these parameters are equal or not 12 / 30
  • 156. Testing Population Variances To test if two population variances are equal we look at the ratio of these parameters, and the null hypothesis implies that this product is one Hence a two-sided hypothesis testing corresponds to H0 : σ2 1 σ2 2 = 1 H1 : σ2 1 σ2 2 = 1 or σ2 1 = σ2 2 But it is also possible to perform one-tailed tests with alternative hypotheses σ2 1 σ2 2 1 or σ2 1 σ2 2 σ2 1 σ2 2 1 or σ2 1 σ2 2 13 / 30
  • 157. F-Test of Equality of Variances independent samples Provided that the two populations are normally distributed, the test to be used to compare two variances in independent samples is: Ftest = larger variance smaller variance and hence we work with the right critical values Under the assumption the null hypothesis is true; the test statistic corresponds to the ratio of the two sample variances: F = s2 1 s2 2 that is F-distributed with degrees of freedom ν1 = n1 − 1 and ν2 = n2 − 1, which are called numerator and denominator respectively 14 / 30
  • 158. The F-distribution e.g. ν1, ν2 = 6 0 F f(F ) recall that the F-distribution is formed by the ratio of two independent χ2 variables 15 / 30
  • 159. Rejection Regions F-test The test strategies for the ratio of two variances works in the same fashion than for the mean parameters That is, we define a significance level α and the rejection of the null hypothesis is based on the F statistic whenever F Fα/2, ν1,ν2 or F F1−α/2, ν1,ν2 And for the upper and lower tailed test the rejection regions are F Fα, ν1,ν2 F F1−α, ν1,ν2 16 / 30
  • 160. Critical values, F-distribution As the χ2 distribution, the F-distribution is asymmetric having only positive scores ª and we require distinct critical values for the tails of the distribution However, the F-distribution depends upon two degrees of freedoms depending on different sample sizes A property for the critical values in both tails of the distribution is Fα/2, ν1,ν2 = 1 F1−α/2, ν2,ν1 and this means that a two-sided test requires just the upper critical values 17 / 30
  • 161. Example F-Test The response time in seconds for the vending machines has been measured in a random sample of size 15 with the following statistics: mean = 2.125, SD = 0.411. While a random sample of 20 machines from the competition presumably gives a mean of 2.089 and SD of .5 in the sample distribution • The question is whether or not our machines are more accurate than the machines from the competition, i.e. have smaller variability? ª The parameter of interest is the ratio of two variances and we perform a F-test of equality of variances. Since the SD (and hence the variance) is smaller in our machines than the competition, then σ2 2 corresponds to our machines and σ2 1 to the competition 18 / 30
  • 162. Stem-and-Leaf display and Box Plot of the data OWN COMPETITION 0 | 9 1 | 4 1 | 4 1 | 5799 1 | 56899 2 | 0122344 2 | 00112244 2 | 578 2 | 55889 1 1.5 2 2.5 3 comp own Response time (seconds) Gropus 19 / 30
  • 163. Example F-Test test statistic • The research hypothesis is H1 : σ2 1/σ2 2 1 or whether the true ratio of the variances is greater than one • The test statistic is computed next F = s2 1/s2 2 = 0.5 0.411 2 = 1.48 • And for an upper one-sided test with a standard significance level the critical value is F.05, 19,14 = 2.4 ª Because the test statistic (1.48) is not greater than 2.4 then we fail to reject the null hypothesis There is not enough statistical evidence at a 5% significance level to claim that our machines are more accurate than the machines from the competition 20 / 30
  • 164. Test statistic for µ1 − µ2 when σ2 1 = σ2 2 pooled In case that we fail to reject the null hypothesis in the test of the ratio of two variances, we perform a t test statistic for µ1 − µ2 with a pooled variance estimator represented by s2 p = (n1−1)s2 1 + (n2−1)s2 2 n1+n2−2 And the test statistic for equal variances is t = (x1−x2)−(µ1−µ2) s2 p· 1 n1 + 1 n2 ν = n1 + n2 − 2 21 / 30
  • 165. Test statistic for µ1 − µ2 when σ2 1 = σ2 2 unpooled On the other hand in case that H0 is rejected and there is enough statistical evidence that the two variances differ, we cannot use the pooled variance estimate In this case we estimate each variance parameter by its sample statistic from the sampling distribution (x1−x2) − (µ1−µ2) s2 1 n1 + s2 2 n2 but unfortunately this is not Student t distributed (nor normal neither) 22 / 30
  • 166. Test statistic for µ1 − µ2 when σ2 1 = σ2 2 Welch test with Student t approximation An approximation to the Student t distribution is possible by adjusting the number of degrees of freedom to ν = (s2 1/n1 + s2 2/n2)2 (s2 1 /n1)2 n1−1 + (s2 2 /n2)2 n2−1 (Welch-Satterthwaite) And the test statistic used by applying the approximate value of ν is t = (x1−x2) − (µ1−µ2) s2 1 n1 + s2 2 n2 23 / 30
  • 167. Rejection Regions t-test To reject the null hypothesis we compare the t scores against the critical values at a chosen significance level α For a two-tailed test we check that |t| tα/2, ν And for the upper and lower tailed test the rejection regions are t tα, ν t t1−α, ν 24 / 30
  • 168. Confidence Intervals for µ1 − µ2 independent samples Two-sided confidence intervals for 100(1 − α)% level for the difference between two means are For σ2 1 = σ2 1 (x1 − x2) ± tα/2, ν · s2 p 1 n1 + 1 n2 For σ2 1 = σ2 1 (x1 − x2) ± tα/2, ν · s2 1 n1 + s2 2 n2 25 / 30
  • 169. Example µ1 − µ2 vending machines In the F-test performed before we were unable to reject the null hypothesis that the ratio of the two variances equals 1. • This implies that to test the difference between two means in our machines and in the competition we assume equal variances in the populations ª Recall that the sample statistics are s1 = .5, x1 = 2.089, n1 = 20; s2 = .411, x2 = 2.125, n2 = 15 • Now the question is whether the mean µ2 for our machines is greater than the mean µ1 from the competition? This is a one-sided (lower-tail) test for the difference between two means where H1 : (µ1 − µ2) 0. 26 / 30
  • 170. Example test µ1 − µ2 ª For equal variances we compute first the pooled variance estimator s2 p = (20−1)(.52 ) + (15−1)(.4112 ) 20 + 15 − 2 = 7.13 33 = .216 • And the test statistic is calculated using such estimate t = (2.089−2.125) − 0 .216× 1 20 + 1 15 = −.227 ª To determine the critical value we compute the number of degrees of freedom ν = n1 + n2 − 2 = 33 • The rejection region at the standard alpha value is t t1−α,ν = t1−.05,33 = −t.05,33 ≈ −t.05,35 = −1.69 • Because the t score is greater than the critical value we are unable to reject H0. There is not sufficient evidence at 5% α level to claim that the average response time in our machines differ from the competition. 27 / 30
  • 171. Example estimation µ1 − µ2 The estimation of the difference between two means with equal variance parameters is based on the two-sided 95% confidence intervals (x1 − x2) ± tα/2, ν · s2 p 1 n1 + 1 n2 (2.089 − 2.125) ± 2.03 · .216 × 1 20 + 1 15 −.036 ± .322 (µ1 − µ2) ∈ [−0.36; 0.29] As the 0 is within the interval, we cannot conclude that there is a significant difference between the mean response time in our machines and the competition. 28 / 30
  • 172. p-value Despite we did not rejected the null hypotheses in the example; we compute a range of the p-values from the test statistics. • For µ1 − µ2, we find from the t table for ν ≈ 35 that the closest critical value to the t score is 1.306 −.227 which means that .10 P(t −.227) and hence we can reasonably say that p-value 10% • For σ2 1/σ2 2 the F score is 1.48 that is smaller than (≈) F.100,20,15 1.92 1.48 So the p-value in this case is more than 10% as well because .100 P(F 1.48) (or 5% with F.050,20,15 = 2.33 1.48). 29 / 30
  • 173. Summary Drawing conclusions in comparing two populations imply a two-sample test statistic and estimation For large and independent samples with known σ the test and estimation is based on the standard normal distribution But for small and independent samples we apply the t statistics where is possible to average the variances in the samples whenever these are statistically equal Thus we need to make inferences about the ratio of two variances in case we want to perform a test or estimation of the difference between two means with independent samples. 30 / 30
  • 174. BUSINESS STATISTICS I Lecture – Week 50 Antonio Rivero Ostoic School of Business and Social Sciences  December  AARHUS UNIVERSITYAU
  • 175. Today’s Agenda Inferences about Comparing Two Populations: 1. Difference between Two Means in Matched Pairs Experiment ª test and estimation of µD 2. Difference between Two Population Proportions ª test and estimation of p1 − p2 2 / 27
  • 176. Introduction In the last lecture we made inferences about comparing two populations from sample data with the condition that the samples are independent to each other In many situations the independence condition applies, especially when the samples belong to different populations However when the two samples have the same subject there is typically a dependence relation among the observations and the samples are said to be paired or matching ª in Keller these pairs are matched in a ‘group’ 3 / 27
  • 177. Experimental designs Whether the observations in one population are independent or are rather dependent to the observations in the other population determine the type of experimental design Besides independent samples, another type of experimental design is matched pairs since each observation in one sample matches with an observation from another sample ª in this case the data are called paired data examples of paired data are found in repeated measurements on the same subjects, or measurements on subjects that are very closely related because they match in terms of certain characteristics like age, sex, etc. 4 / 27
  • 178. Statistics for Comparing Matched Pairs Given two dependent samples of observed data the paired difference between the values is obtained where Di = observation in sample 1 − observation in sample 2 The sample mean paired difference xD is defined for a number of difference scores nD xD = nD i=1 Di nD And the sample standard deviation for paired differences sD is sD = nD i=1(Di − xD)2 nD − 1 5 / 27
  • 179. Inferences about the Difference between Two Means matched pairs experiment Inferences about the difference between two means in matched pairs experiment are based on the mean of the population differences that is represented by µD, and where xD estimates µD In fact, the parameter µD is identical to the difference between the mean parameters of two populations, µ1 − µ2 ª thus the mean of the difference scores corresponds to the difference between the means of the sample populations This implies that we try to infer whether or not there is a difference between the mean of two depending populations In other words, we test if the true mean of the population difference parameter equals 0 6 / 27
  • 180. Hypothesis test for the difference between two means matched pairs In a two-sided hypothesis testing we have the following null and alternative hypotheses H0 : µD = 0 or µ1 = µ2 H1 : µD = 0 or µ1 = µ2 And by performing a one-sided test the research hypotheses are µD 0 or µ1 µ2 µD 0 or µ1 µ2 7 / 27
  • 181. Test Statistic of µD In the case of matched pairs data we perform a paired t-test for the mean of population differences t = xD − µD sD/ √ nD that is Student t distributed with degrees of freedom ν = nD − 1 the assumption here is that the difference scores are normally distributed 8 / 27
  • 182. Rejection Regions paired t-test The rejection regions for a paired t-test for the mean of population differences are |t| tα/2, ν t tα, ν t t1−α, ν that correspond to a right tailed table of critical values with a significance level α with ν degrees of freedom 9 / 27
  • 183. Interval Estimation of µD Inferences about the population mean of paired differences are also made through confidence interval estimator of µD A two-sided confidence intervals for 100(1 − α)% level is based on the t statistic as well xD ± tα/2 sD √ nD and it takes the standard error of the sample mean paired difference 10 / 27
  • 184. Example Test of µD • Recall that the response time in our vending machines was measured in a random sample with n = 15, and we obtained the response time from the competition from a random sample with n = 20. Suppose that the first 15 measurements from the competitors sample match the observations in our sample, and this is because e.g. the machines use the same version of the main control board. ª The paired data with CPU v., and the difference between samples are 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2.37 1.95 1.49 2.05 2.27 2.53 1.87 2.42 1.43 2.24 2.69 2.16 1.88 1.71 2.82 1.55 2.09 2.79 1.43 1.96 2.07 2.35 1.88 2.75 1.93 2.21 2.49 1.80 1.48 2.89 0.82 -0.14 -1.30 0.62 0.31 0.46 -0.48 0.54 -1.32 0.31 0.48 -0.33 0.08 0.23 -0.07 ª The sample statistics for our machines are x2 = 2.125, s2 = .411; and for the paired competitors are x1 = 2.111, s1 = .468 • Due the experiment design the parameter of interest in this case is µD or the mean of the population differences for dependent samples. 11 / 27
  • 185. Example Test of µD II • The question is whether there is a difference between the true mean for our machines and the mean from the competition? Because the sample mean in our machines is still higher than the competition the alternative hypothesis is formulated as H1 : µD 0 • Next we compute the statistics of the paired differences xD = .014, and sD = .646, and these outcomes are used in the t test statistic t = 0.014 − 0 0.646/ √ 15 = .084 • The rejection region at the standard α value is calculated t t1−α, ν = t1−.05,14 = −t.05,14 = −1.76 • Because the t score (.084) is greater than the critical value we are unable to reject the null hypothesis. There is not sufficient evidence at 5% α level to infer that there is a difference between the response time in our machines and from the competition using the same version of the control board. 12 / 27
  • 186. Example Estimation of µD • The estimation of the mean difference for paired data is based on a two-sided standard confidence level xD ± tα/2, ν sD √ nD 0.014 ± 2.145 × 0.646 √ 15 ª Hence the maximum error estimate is .358 LCL = −.34 and UCL = .37 We cannot conclude either that there is a significant difference between the mean response time in our machines and the competition using the same version of the control board. 13 / 27
  • 187. Difference between Two Population Proportions For nominal data that corresponds to a categorical variable (like gender) we perform inferences about the difference between two population proportions rather than means The parameter of interest in this case is p1 − p2 that represents the difference between two population proportions Recall that samples for proportion follow the Binomial distribution, and it is possible to get a Normal approximation to the Binomial with sufficiently large sample sizes For small samples there are tests to obtain exact probabilities when comparing two group proportions 14 / 27
  • 188. Comparing Proportions from Two Populations Population 1 Parameter: p1 ª Statistic: ˆp1 Population 2 Parameter: p2 ª Statistic: ˆp2 ª with number of successes x1 and x2 out of n1 and n2 respectively Here ˆp1 = x1 n1 , ˆp2 = x2 n2 , and ˆp1 − ˆp2 is the best estimator of p1 − p2 15 / 27
  • 189. Expectations of ˆp1 − ˆp2 E(ˆp1 − ˆp2) = p1 − p2 (value) V(ˆp1 − ˆp2) = p1(1 − p1) n1 + p2(1 − p2) n2 (variance) SE(ˆp1 − ˆp2) = p1(1 − p1) n1 + p2(1 − p2) n2 (standard error) ˆp1 − ˆp2 is approx. normally distributed with large samples where n1 ˆp1, n1(1 − ˆp1) and n2 ˆp2, n2(1 − ˆp2) 5 16 / 27
  • 190. Testing the Difference between Two Proportions z statistic Because of the Normal approximation to Binomial we benefit from the Z distribution for testing the difference between two group proportions z = (ˆp1−ˆp2) − (p1−p2) p1(1−p1) n1 + p2(1−p2) n2 But the z test statistics requires for the SE of the difference between proportions both parameters p1 and p2, which are typically unknown There are two different estimators of ˆp1 − ˆp2 (i.e. the best estimator of p1 − p2), one when the parameters differ, and other is when p1 and p2 equal Hence the null hypothesis determine which of the two cases is going to be applied to the test statistic 17 / 27
  • 191. p1 − p2 with Equal Parameters If the null hypothesis postulates that the two population proportions are equal, then there is no difference between these parameters H0 : (p1 − p2) = 0 In such case it is possible to use a pooled proportion estimate ˆp = x1 + x2 n1 + n2 And this weighted average of the proportions is applied to the standard error of ˆp1 − ˆp2 p1(1−p1) n1 + p2(1−p2) n2 = ˆp1(1−ˆp1) n1 + ˆp2(1−ˆp2) n2 = ˆp(1 − ˆp) 1 n1 + 1 n2 18 / 27
  • 192. Hypothesis Testing for p1 − p2 In case that H0 assumes that the two population proportions are equal, then the research hypotheses for a two and one-sided tests are (p1 − p2) = 0 or p1 = p2 (p1 − p2) 0 or p1 p2 (p1 − p2) 0 or p1 p2 But in case that p1 and p2 are assumed not to be equal then there is a value D different than zero that is considered each hypothesis In this latter case the research hypotheses are either (p1 − p2) = D, D, or D and hence one proportion exceeds the other parameter by a nonzero quantity, D 19 / 27
  • 193. Test Statistic of p1 − p2 equal and unequal parameters When the proportion parameters in both populations are equal then the test statistics assumes H0 : (p1 − p2) = 0, and it is represented by z = (ˆp1 − ˆp2) − (p1 − p2) ˆp(1 − ˆp) 1 n1 + 1 n2 = (ˆp1 − ˆp2) ˆp(1 − ˆp) 1 n1 + 1 n2 However, if H0 : (p1 − p2) = D then the test statistics is defined as z = (ˆp1 − ˆp2) − (p1 − p2) ˆp1(1 − ˆp1) n1 + ˆp2(1 − ˆp2) n2 = (ˆp1 − ˆp2) − D ˆp1(1 − ˆp1) n1 + ˆp2(1 − ˆp2) n2 20 / 27
  • 194. Rejection Regions z-test of p1 − p2 The rejection regions are based on the scores of the standard normal distribution that are compared with the critical values of the cumulative table of Z probabilities for a significance level α The null hypothesis is rejected for a two-tailed test whenever |z| z1−α/2 Whereas for p1 p2 and p1 p2 the rejection regions are z z1−α z zα 21 / 27
  • 195. Interval Estimation of p1 − p2 Confidence interval estimations are also used to make inferences about the differences between two population proportions For a two-sample test of proportions the confidence intervals for 100(1 − α)% level assumes unequal parameters (ˆp1 − ˆp2) ± zα/2 ˆp1(1 − ˆp1) n1 + ˆp2(1 − ˆp2) n2 which is effective whenever n1 ˆp1, n1(1 − ˆp1) and n2 ˆp2, n2(1 − ˆp2) 5 22 / 27
  • 196. Example test of p1 − p2 vending machines By testing the difference between two population proportions we can compare e.g. the introduction years’ market for vending machines in a given town belonging to either our company or to the competition. Assuming that 12 machines in the samples are placed in this market; the question is whether or not there enough evidence to conclude that our machines are more popular than the competition in this town? • To be consistent with the coding of the populations the research hypothesis is that (p1 − p2) 0, and hence the null hypothesis adopts equal proportions in the testing. • For the test statistics we require both sample proportions and also the pooled estimate ª ˆp1 = 12 20 = .6 ˆp2 = 12 15 = .8 and ˆp = 12 + 12 20 + 15 = .686 23 / 27
  • 197. Example test of p1 − p2 test statistic • The test statistic is computed next z = (.6 − .8) (.686)(1−.686)× 1 20 + 1 15 = −1.26 ª And the standard rejection region for a cumulated Z statistic is z zα = z.05 = −1.645 • Since the outcome of the z test statistic is greater than the critical value we do not reject H0 At 5% significance level there is not sufficient evidence to conclude that our vending machines were more popular than the competition in town during the introductory year. Here P(Z z) = .1038 constitutes the associated p-value. 24 / 27
  • 198. Example test of p1 − p2 Revisited • However if we consider only the paired sample data and only 7 machines from the competition were placed on town during the introductory year, then for the same hypothesis testing design the test statistics become z = (.533 − .8) (.667)(1−.667)× 1 15 + 1 15 = −1.89 • Which means that zobs zα and hence we reject the null hypothesis in favor to the alternative. There is enough statistical evidence at the standard significance level to conclude that our machines were more popular in town during the introductory year than the competition if we consider that they were using the same main control board (cf. test of µD) The p-value then must be computed P(Z z) = .0294, and since it is less than α, it means that the result is statistical significant. It is also possible to test proportion parameters with an hypothesized difference value different than zero, so e.g. H0 : (p1 − p2) = .05 25 / 27
  • 199. Example estimation of p1 − p2 To estimate the difference between the two proportions we use the standard confidence intervals with a 95% level. (ˆp1 − ˆp2) ± zα/2 ˆp1(1−ˆp1) n1 + ˆp2(1−ˆp2) n2 • For the example with all observations: (.6 − .8) ± 1.96 × .6(1−.6) 20 + .8(1−.8) 15 −.2 ± .3 [−.5; .1] • And for the revisited version with paired data: (.533 − .8) ± 1.96 × .533(1−.533) 15 + .8(1−.8) 15 −.333 ± .32 [−.66; −.01] 26 / 27
  • 200. Summary We continue drawing inferences about comparing two populations, and we have looked at parameters of central location with hypothesis testing and interval estimation Besides the difference between two means in independent samples, we made inferences about the difference between two means in a matched pair experiment In this case the samples are dependent, and we applied the t statistic and used statistics of the paired difference between the samples For nominal data we made inferences about comparing two population proportions and applied the z test where we hypothesize both that there is and there is not a true difference between parameters 27 / 27
  • 201. Summary Descriptive Statistics Probability Distributions Statistical Inference One-sample estimation and testing of µ, σ2 , p Two-sample estimation and testing of µ1 − µ2, µD, σ2 1 /σ2 2 , p1 − p2