Descriptive Statistics & Linear Programming Course
Descriptive Statistics & Linear Programming Course
DESCRIPTIVE STATISTICS
The overall objective of the course is to teach students the main techniques of univariate
and bivariate descriptive statistics while giving them some basic notions of operations
research in linear programming. At the end of the course, students should be able to apply
these techniques appropriately in a given context. In other words, they should be able to:
Solve a linear programming problem by the graphical method
Understand the basic elements of descriptive statistics
Pull up statistical tables and graphs for one and two characters
Perform a statistical analysis using descriptive statistics.
To study the relationship between two statistical variables
Calculating indices in descriptive statistics
Specifically, it is about :
Summarize, synthesize the information contained in the statistical series;
To highlight its properties;
Suggest hypotheses about the population from which the sample was drawn.
2
Tools used :
Tables (frequency table, contingency table, ...)
Indicators (average, correlation, ...).
The type of tools used depends on
The nature of the series (single or multidimensional)
The nature of the variables (discrete quantitative, continuous or qualitative)
Some of these concepts can be developed and deepened in specific courses.
COURSE OUTLINE
General introduction
GENERAL INTRODUCTION
Statistics is the set of mathematical methods and tools aimed at collecting, describing and
analyzing data afin order to obtain information allowing to make decisions despite the
presence of uncertainty (error, noise). In other words, statistics is the set of mathematical
methods allowing to describe and analyze in a quantitative way repeated phenomena by
numerous elements of the same nature likely to be demonstrated and classified.
Statistics has nowadays invaded all scientific fields. Its teaching within the
framework of a training in education sciences is thus quite naturally part of it.
Sooner or later, in your learning projects or professional activities, you will have to
collect data, process them, describe them and, if possible, generalize them.
Statistics plays an essential role in many disciplines:
In economics: growth rate, number of patents filed, real estate prices, etc.
In finance: profitability of an investment,...
In marketing: market research, ...
In human resources management: absenteeism, ...
In medicine: marketing of new drugs, ...
In social sciences, political sciences, etc.
3
The application of statistical methods makes it possible to obtain statistics which are in fact
numerical results (collection of figures, set of numbers) presented in the form of tables or
graphs.
The objective of this chapter is to familiarize the student with purely graphical tools for
solving linear programming problems.
INTRODUCTION
Linear programming is one of the most important optimization techniques used in
operations research. This is due to the ease of modelling, the efficiency of the algorithms
developed and the existence of numerous software packages on the market. The
generalization of micro-computing has made linear programming available to everyone.
The objective of linear programming is to determine the optimal allocation of scarce
resources between competing activities or products. Economic situations often require
optimizing a function under several constraints in the form of inequalities.
m 1h 2h 8h
p 2 kg 2 kg 10 kg
q 9 kg 4 kg 36 kg
Unit profit 50 60
FCFA FCFA
What information does the company manager need to know to consider his problem
solved?
It is enough to know the quantity of product A and the quantity of product B to be
produced daily, isn't it? Let's act as if these quantities were known to us and denote them
with :
x1 = the quantity of product A to be
produced
x2 = the quantity of product B to be
produced
The variables x1 and x2 are called decision variables.
How much profit will the company make from the sale of these two products?
It is a question of adding up the benefits to be gained from each of the two products:
- For product A, it withdraws 50 CFA francs per unit and manufactures x1 units; this
production therefore yields a profit of (50x1) CFA francs;
- Similarly, the x2 quantity of product B allows him to make a profit of (60x2) FCFA.
The total profit to be made from the two products is therefore :
(50x1 + 60x2) FCFA
We will denote this total profit by z and leave the monetary unit implicit:
z = 50x1 + 60x2
We obviously try to make z as large as possible by giving x1 and x2 appropriate values.
The quantity z is a function which, for each production plan (a quantity of A, a
quantity of B), associates the number of dirhams that the firm would earn as profit if it
adopted this plan. This function z, which reflects the objective of our problem, is called the
objective function or economic function. And, since we want to make z as large as
possible, we write :
Maximize z where z = 50x1 + 60x2
which is generally agreed to be abbreviated as follows:
5
Max z = 50x1 + 60x2
If it were only a question of maximizing z, it would be enough to let x1 or x2 increase so
that z would take on a value as large as it wishes. But expecting such profits is more like a
dream than the situation of our company. There are, of course, natural impediments, called
constraints, that hinder the dream of infinite profit. Let's consider each of these constraints
in turn.
The variance variable of a constraint represents the unused available quantity. It is the
difference between the availability and the requirement.
1.4. Generalization: Production problem
Let there be m machines Mi (i = 1,... ,m) which mass produce n types of products Pj (j =
1,...,n). Machine Mi has a maximum capacity of bi time units. The production of one unit of
product Pj requires the use of machine Mi for aij time units.
If cj is the gain from producing one unit of product Pj, solving the problem
will provide the optimal values of the quantities xj to be produced of each of the products;
the economic function represents the total gain; the first member of each constraint (Mi)
represents the total time of use of the machine Mi. The values of the deviation variables
associated with each of these constraints correspond to the unused available time of each
machine.
1.2 FORMULATION OF A MINIMIZATION PROBLEM
1.2.1 Problem statement
A farmer wants his herd to consume the lowest daily ration of three nutrients A, B and C.
The daily requirements are 16 for A, 12 for B and 18 for C. The farmer buys two types of
feed P and Q :
- A unit of P includes 2 units of A, 1 unit of B and 1 unit of C; and it costs 20 FCFA
- A unit of Q consists of 1 unit of A, 1 unit of B and 3 units of C; and it costs 40 FCFA.
The farmer looks for the least expensive combination of P and Q amounts that will meet
the minimum nutrient consumption requirement.
The following table summarizes the data related to this problem:
P Q Minimum
7
requirements
A 2 1 16
B 1 1 12
C 1 3 18
Unit cost 20 40
FCFA FCFA
1.2.2 Building a linear model
Let us call x1 and x2 the quantities of feed P and Q that need to be purchased. The farmer's
objective is obviously to minimize the total cost of the food that must be purchased.
Mathematically this is written as :
Minimize z = 20x1 + 40x2
which is generally agreed to be abbreviated as follows:
Min z = 20x1 + 40x2
Each of the 3 nutrients to be considered gives rise to a constraint, which aims to require
that the feed, as a whole, satisfies the daily needs of the herd. We obtain:
The above constraints use the sign " ≥"because the minimum consumption requirements
must be met, but may be exceeded.
Finally, we must not forget that we cannot buy negative quantities of P or Q :
x1, x2 ≥ 0
The model can be summarized as follows:
This problem is nothing more than a mixing problem. It arises in many situations, for
example, in the composition of an animal diet.
2 GRAPHICAL METHOD
In this section we present a technique for solving a linear program with two variables x1
and x2. In this case we can use a graphical representation of the linear program. The
graphical representation will be useful to gain an intuitive understanding of the basic
principles of linear programming. The canonical formulation of a linear program with
two variables can be written in one of two forms:
Each constraint determines one of the two half-planes (P1) or (P2) that can be found by
checking whether a particular point (the origin (0,0) for example) is contained in it or not.
The intersection of all the half-planes corresponding to the constraints constitutes the set of
feasible points: these are the solutions common to all the constraints. This set corresponds
to a region D of the plane and is often called a feasible region. This region is sometimes
empty or unbounded.
y y
D
D
o x o x
Bounded regionUnbounded region
2.1.2 The search for an optimal solution
We have just constructed the feasible region of a linear program in two variables. This
set contains an infinite number of feasible solutions. It remains to find, among these
feasible solutions, the one(s) which give(s) the best value to z.
Fixing z at an arbitrarily chosen value p, we obtain the line :
(Dp) a0x1 + b0x2 = p
This line is called the z-function iso value line. It represents the points in the plane that
give z the value p.
We are interested in the family of lines (Dp) (p parameter). They are all parallel lines with
D
B
D D
A
C
o x o x
Case b0 > 0 and a0 > 0 Case b0 > 0 and a0 < 0
- If b0 < 0, maximizing z is equivalent to maximizing p and thus minimizing yp.
Therefore, the maximum of z is obtained for the line having at least one common
point with the feasible region and having the lowest possible intercept.
y direction z croissants y direction z croissants
D
B
D D
A
C
o x o x
Case b0 < 0 and a0 > 0 Case b0 < 0 and a0 < 0
All the points on the same line ensure the same value for z. When one passes from one
line to another, the values of z vary: they increase if one moves in the direction of the
normal vector to the iso value lines: hence the meaning of the arrow
indicating the "direction of increasing z".
2.2 MAXIMIZATION PROBLEM
2.2.1 Problem statement
A chassis manufacturing company is planning to produce two new models using the
capacities of its three workshops. These are an aluminium frame and a wooden frame
11
respectively. The first product requires the first workshop to manufacture the aluminium
frame and the third workshop where the glass is mounted on the frame. The second
product requires the second workshop to manufacture the wooden frame and the third
workshop where the glass is mounted on the frame. The unit profits, the manufacturing
times of each product in each workshop and the weekly capacities of these workshops
are given in the following table:
Product 1 Product 2 Available capacity
(hours/product) (hours/product) (hours/week)
Worksho 1 0 4
p1
Worksho 0 2 12
p2
Worksho 3 2 18
p3
Profit 300 FCFA 500 FCFA
The question that arises is, "How many frames of each type should be produced per week
in order to achieve maximum profit?"
2.2.2 The linear model
What are the quantities of chassis that the company should produce per week, if it wants
to maximize its profit? The decision variables will be:
x1 = number of type 1 chassis to be produced per week
x2 = number of type 2 chassis to be produced per week
The problem of planning the production of chassis is translated into the following linear
model:
To each couple of values of the decision variables x1 and x2 we associate a point (x1,x2)
of the R2 plan: the point (x1,x2) is interpreted as the proposal of a production plan
indicating the number of frames to be manufactured per week. Generally, we speak
indifferently of the point (x1,x2) or the production plan (x1,x2) or the solution (x1,x2).
2.2.3. Construction of the feasible region
The constraints x1 ≥ 0 and x2 ≥ 0 mean that all points (x1,x2) representing acceptable
solutions must be in the first quadrant, i.e. to the right of the Ox2 axis and above the Ox1
axis.
Note that all the constraints of the model, including the non-negativity constraints, can be
written in the following form:
12
ax1 + bx2 ≤ c
To clarify the procedure that leads to the graphical representation of the feasible region,
let us first consider the constraint on Workshop 1. The line associated with this
constraint is the line with equation :
x1 = 4 (1)
The graphical representation of equation (1) is obtained by drawing the vertical line which
passes through the point (4,0). The constraint (A1) is satisfied for the points of the plane
on the same side of the line (1) as the origin of the reference frame.
Since all the constraints in the linear model are of the same form, it is sufficient to
consider them in turn, proceeding, for each constraint, as follows:
- Choose 2 points of the associated line. In order to facilitate the calculations, we can
choose the two points having each one a null coordinate. Then draw this line ;
- Determine on which side of the associated line the constraint is satisfied. To quickly
find the right side, simply look to see if the point (0,0) is on the right side;
- Draw an arrow pointing to that side.
Let's illustrate this procedure again using the constraint (A2). The line associated with
this constraint is the line of equation :
x2 = 6 (2)
- The points (0,6) and (8,6) belong to the line (2) associated with (A2) ;
- The point (0,0) verifies the latter and the points that are feasible according to the
only constraint (A2) are under the line (2) ;
- The arrow pointing to the right side is placed.
The graphical result of considering constraints (A1) and (A2) is shown in the following
figure:
13
The set of points that have not been eliminated after all constraints have been taken into
consideration constitutes the feasible region. In economics, this set is also called the
production set.
2.2.4 Finding an optimal solution
The feasible region we have just constructed does not determine a solution, but a whole
domain containing an infinite number of points. We will have to find an optimal
production plan, i.e. a point verifying all the constraints and allowing z to take its
largest value on the feasible region.
For this, we will consider successive values of the economic function:
z = p.
This corresponds graphically to parallel lines
300x1 + 500x2 = p. (4)
14
The points of one of these lines are therefore the locus of all points giving the same value
of profit (hence the name of iso-profits lines).
Drawing a first iso-profit line gives an illustration of the slope of z. Drawing a second
iso-profit line allows us to determine the direction in which the value of z increases.
Thus, by gradually increasing the value of p in equation (4), we obtain parallel lines,
each further from the origin than the previous ones.
This point lies at the intersection of lines (2) and (3). The available capacities of
workshops 1 and 2 are therefore fully used. On the other hand, for this optimal solution,
the available capacities of workshop 1 will be more than sufficient. At the optimal point,
Constraints (A), (B) and (C) are written as " ≥" because the minimum raw material
requirements must be met, but these can be exceeded.
This program differs from the previous one in 2 aspects: the economic function is to
minimize; some constraints are of sign " ≥"and the origin O = (0,0) of the plane is not a
feasible solution.
The graphical resolution technique remains the same, but since it is a search for a
minimum, the iso value line closest to the origin and which remains in contact with the
feasible region, provides the minimum.
First, we construct the feasible region. The hatched area in the graph below is the
set of points satisfying all constraints.
16
The polyhedron ABCDEF, which constitutes the feasible region, is shown in the
following figure, along with the isocost lines z = 0, z = 100 and z = 440. Since the
objective is to minimize z, the optimum is achieved by finding the lowest possible
isocost line that touches the feasible region D.
isocosts z = 0, z = 200 and z = 440. the vertex B corresponds to the optimal solution
The graph shows vertex B=(9,3) as the point where the optimal solution is obtained. The
cost at point B is lower than the cost at all other vertices in the feasible region. This
result is confirmed by evaluating the economic function at each of the vertices adjacent
to B :
in A = (14,1) z = (20 × 14) + (40 × 1) = 320
in B = (9,3) z = (20 × 9) + (40 × 3) = 300
in C = (2,10) z = (20 × 2) + (40 × 10) = 440
Suppose that the cost of product X increases by 20 FCFA. The economic function
becomes :
Min z = 40x1 + 40x2 Let's find
the minimum value of z graphically. We obtain
17
Since the lowest possible isocost line is tangent to constraint (B), the minimum value
would be expected at vertices B(9,3) and C(2,10). Moreover, any point on the segment
[B, C] will minimize the economic function under the constraints. This multiplicity of
optimal solutions comes from the fact that the isocost lines are parallel to the line
associated with the constraint (B).
Objectives:
The general objective of this chapter is to provide the basic tools of descriptive statistics.
Specifically, the student should be able to, by the end of this chapter:
Distinguish between the different branches of statistics ;
18
Differentiate between qualitative and quantitative variables;
Differentiate between discrete and continuous statistical variables;
Master the basic vocabulary of descriptive statistics.
1 DEFINITION
Statistics is the study of data collection, analysis, processing, interpretation and
presentation to make the data understandable to all. It is at the same time a science, a
method and a set of techniques.
Or, it is also the set of methods that allow to collect, order, reduce and condense data.
It uses parameters (or synthesizers), graphs, and data analysis methods (programmable
calculators, computers...).
There are two branches of statistics: descriptive (definitive) statistics and inferential
(inductive) statistics. It should be noted that these branches do not oppose each other, but
complement each other.
Descriptive statistics: Descriptive statistics is a prerequisite to inferential statistics, in
which statistical methods are applied to infer properties of a population from a sample. Its
purpose is to describe and summarize in a formalized way the information collected in an
exhaustive way.
Inferential statistics (inductive) :
Make an estimate
Ex: Estimate the average weight of individuals in the population from the average
weight of individuals in the sample.
Testing a hypothesis
Ex: Test from the sample data whether the average weight in the population is greater than
70 kg.
In general, draw conclusions about a population using results obtained from a
sample.
Note: Inferential statistics only makes sense when you work on a sample drawn
(randomly) from a reference population.
Population
Sample 2
Sample 1
Units
20
2.3 THE E-MODALITIES OF A CHARACTERISTIC OR A VARIABLE.
2.3.1 Definition :
A characteristic can have two or more values or present two or more different situations
called the modalities of the characteristic. In other words, the modalities are different
possible values or situations that a characteristic (or a statistical variable) can take or
present.
The modalities of a character must have the following characteristics: they must be
incompatible, exhaustive and unambiguous. Example: for the variable gender, the terms
are male / female.
Note: The terms of a variable are meaningful only if the variable has an operational
definition, that is, a clear and universally accepted meaning.
I) GRAPHIC REPRESENTATIONS
I.1) Case of a Qualitative Characteristic (or Variable).
I.2) Case of a Quantitative Characteristic (or Variable).
Objectives:
The general objective of this chapter is to characterize univariate statistics.
Specifically, the student must master :
The characteristics of central tendencies of a statistical series and to be able to
determine them and especially to interpret them in front of a statistical problem;
Dispersion characteristics and how to calculate and interpret them;
Form and concentration characteristics: calculate and interpret them in relation to a
statistical study.
Introduction
Unlike qualitative characteristics, where graphical representation is the only means of
studying their distribution, quantitative characteristics lend themselves to several other
means of studying their distribution. Thus, the analysis of a quantitative variable can be
done on the basis of so-called central tendency characteristics (or positional characteristics)
such as the mean, mode and median. The analysis can also be based on dispersion
characteristics such as the range, variance and interquartile ranges, and even on shape
characteristics such as the skewness coefficient, the skewness coefficient and the kurtosis
coefficient.
24
I GRAPHIC REPRESENTATIONS.
These are graphs of the numbers ni or frequencies fi of the modalities xi in proportion
to the lengths or areas of the graphs.
I.1 CASE OF A QUALITATIVE CHARACTERISTIC (OR VARIABLE) :
In the case of a statistical distribution with a qualitative character, the modalities must be
arranged in the table according to the logic that facilitates the understanding and
interpretation of the phenomenon studied.
Three types of graphical representation are used:
- The strip chart ;
- The representation by organ pipes or in bar ;
- The pie chart or circular diagram or pie chart.
NB: The curve obtained by joining the vertices of the bars is called a statistical
polygon or polygonal diagram.
1) The Strip Chart :
(a) Method: We carry in :
* on the x-axis: the modalities xi, arbitrarily ;
on the ordinate: line segments whose length is proportional to the number ni or the
frequency fi of each modality xi.
b) Example:
Let xi be the measures of the marital status of individuals in a given population:
Married (M), Single (C), Widowed (V), Divorced (D), Married Life (MV).
Modalities xi M C V D VM
Staffing and 350 150 100 75 200
b) Example: In the previous example, let's give the histogram of this series:
25
or
3
0
2
0
1
0
0 D x
C V V
i
M
3) The Sector or Pie Chart :
(a) Method :
Divide a disk into sectors corresponding to the modalities xi of area proportional to
the number ni or the frequency fi of each modality.
b) Example:
In the previous example, let's give the pie chart of this series:
Situation Matrimoniale
Marié(M)
Célibataire(C )
Veuf(V)
Divorcé(D)
Vie Maritale(VM)
Exercises :
Let the following series be
1) a- Represent the series A by a table of effectives, and complete it with the frequency
distribution ;
b- Still for the series A, group the data by classes of amplitude 5 points;
c- Draw the bar graph representing the series of notes of the series A ;
2) For the B series, for example, draw the histogram
3) Draw the pie chart, organ pipe chart and strip chart.
27
II POSITION OR CENTRAL TENDENCY PARAMETERS.
Central tendency characteristics (or positional parameters) are values of the statistical
variable located in the centre of the distribution. There are three types of central tendency
characteristics: mean, median and mode.
II.1 THE M0 MODE AND THE MODAL CLASS.
1) Definitions :
* The mode refers to the value of the variable that corresponds to the maximum frequency
observed on the distribution. In other words, the mode is the distinct value corresponding
to the highest effective noted M0. Depending on the nature of the quantitative variable, the
way to determine it is not the same.
When the variable is discrete, the mode value can be determined by looking at the
highest frequency - absolute or relative. The mode is the value of the variable that has that
frequency. In the case of a bar chart, the mode corresponds to the highest chart. If 02
successive values of the variable have the highest frequency, a modal interval is defined.
When the mode is not unique, it loses all meaning.
When the variable is continuous, a modal class is defined. It is such that the average
frequency per unit of amplitude is the highest when the classes do not have the same
amplitude. By convention, the mode can be the center of the class or determined
graphically.
NB: When the variable is discrete, we can determine the value of the mode by
looking at the highest frequency - absolute or relative. The mode is the value of the
variable which has this frequency.
For a continuous quantitative character, i.e. the data are grouped in classes, we call
modal class, the class of the character xi having the greatest number of numbers and its
center is the modal value. By convention, we can retain for the mode the center of the
modal class.
Note1 : It is generally assumed that the distribution is uniform within each class.
Note 2:
- The mode can be calculated for all types of variables, quantitative and qualitative.
- The mode is not necessarily unique.
- When a continuous variable is partitioned into classes, we can definite a modal class
(class corresponding to the highest effectif).
Note: it is possible that a series does not have a
28
2) Examples:
(a) Example 1:
Let xi be the measures of the marital status of individuals in a given population: Married
(M), Single (C), Widowed (W), Divorced (D), Married Life (MV).
Modalities xi M C V D VM
Staffing and 350 150 100 75 200
The mode is m0 = xi = M
(b) Example 2:
Number of calls 0 1 2 3 4 5 6 7 8 Total
xi
No. of minutes or 93 261 416 393 308 174 93 42 20 N=1800
ni 5,2 14,5 23,1 21,8 17,1 9,7 5,2 2,3 1,1 100
Frequency fi=
N
The mode is m0 = x2 = 2.
(c) Example 3:
The distances xi (in thousands of km) travelled by each of the 150 cars of a car rental
company are recorded.
The results of this survey are :
Distances xi 0 ; 5 5 ; 7 7 ; 9 9 ; 15 Total
a+b 2,5 6 8 12
Centers here = of classes
2
Staffing and 15 78 36 21 150
The modal class is m0 = x2 = 5; 7 /2 = 6 and the modal value is ci = 6 .
The median of a variable noted Me or x1/2 is the value which divides the distribution of
the values arranged in ascending or descending order into two parts of equal numbers.
Or, It is the observed or possible value of the series ordered in ascending or descending
order, which divides this series into two sub-series, each comprising the same number of
observations
Application exercise :
Student A received 8 marks which are: x1 = 5; x2 = 5; x3 = 6; x4 = 9; x5 = 10; x6 = 12; x7
= 13; x8 = 13.
Student B received 9 marks which are: x1 = 2; x2 = 3; x3 = 5; x4 = 6; x5 = 8; x6 = 9; x7 =
9; x8 = 10; x9 = 10.
29
Student C received 10 marks which are: x1 = 6; x2 = 6; x3 = 10; x4 = 12; x5 = 12; x6 = 13;
x7 = 14; x8 = 15; x9 = 16; x10 = 16.
Student D received 11 marks which are: x1 = 0; x2 = 0; x3 = 1; x4 = 4; x5 = 5; x6 = 8; x7
= 10; x8 = 12; x9 = 13; x10 = 16; x11 = 17.
Let's find the median me of each student:
xN +xN x8 + x 8 x 4 + x 5 9+10
+1 +1
For student A (N= 8 : even) : we have me = 2 2
= 2 2 = 2 = 2 = 9,5
2 2
Let me = 9.5.
For student B (N= 9 : odd) : we have me = x N +1 = x 9+1 = x 5 = 8. So me = 8.
2 2
xN +xN x 10 + x 10 x5 + x 6 12+ 13
+1 +1
For student C (N= 10 : even) : we have me = 2 2
= 2 2 = = =
2 2 2 2
12,5. So me = 12.5.
For student D (N= 11 : odd) : we have me = x N +1 = x 11+ 1 = x 6 = 8. Let me = 8.
2 2
NB: the median is obtained by projecting the intersection of the two curves onto the x-axis
and obtaining the value of the median.
II.3 QUARTILES Q1 AND Q3.
1) Definitions :
The quartiles also called quantiles designate the values of the character xi separating an
ordered series into 4 segments of equal size (i.e. containing the same number of values).
There are 3 quartiles noted Q1, Q2 and Q3, from lowest to highest. The size of each of the
4 segments represents ¼ (i.e. 25%) of the size of the series as shown in the diagram below:
The first quartile, Q1, is the value that divides the sample by the proportions ¼ and
¾: 25% of the observations are below Q1, and 75% are above it.
31
The second quartile, Q2, is the value that divides the sample into two equal parts:
50% of the observations are below Q2, and 50% are above it. Q2 is therefore the
median.
The last quartile, Q3, is the value that divides the sample by the proportions ¾ and
¼: 75% of the observations are below Q3, and 25% are above it.
Quartile status
We can find out where the quartiles are in the ordered series using the formulas below.
Position of the first quartile Q1 : (n+1)/4th value
Position of the second quartile (median) Q2 : (n+1)/2 nd value
Position of the third quartile Q3: 3(n+1)/4 th value, where n is the number of
observations in the series.
If the total number N is not a multiple of 4, then the 1st quartile Q1 is the term of rank
N 3rd
immediately higher than and the quartile Q3 is the term of rank immediately
4
3N
higher than i.e. Q1 = x N +1and Q3 = x 3 N +1.
4 4 4
3) Application exercise :
Student A received 8 marks which are: x1 = 5; x2 = 5; x3 = 6; x4 = 9; x5 = 10; x6 = 12;
x7 = 13; x8 = 13.
Student B received 9 marks which are: x1 = 2; x2 = 3; x3 = 5; x4 = 6; x5 = 8; x6 = 9;
x7 = 9; x8 = 10; x9 = 10.
Solution
Let's find the quartiles of each student:
For student A (N= 8 =4x2): we have q1 = x N =x 8 =x 2= 5 and q3 = x 3 N = x 3 x 8 = x 6=¿ 12
4 4 4 4
Let q1 =5 and q3 = 12.
For student B (N= 9 =4x2 +1): we have q1 = x N +1=x 9 +1=x 3= 5 and q3 = x 3 N +1= x 3 x 9 +1=
4 4 4 4
x 7=¿ 9 Let q1 =5 and q3 = 9.
32
a- Generalization: quantiles
The quartiles Q1, Q2, Q3 are the quantiles of order 25%, 50% and 75%. In the ordered
series, 25% of observations precede Q1 and 75% of observations follow Q1.
The deciles D1, D2 , ..., D9 are the quantiles of order 10%, 20%, ... 90%. In the ordered
series, 20% of observations precede D2 and 80% of observations follow D2.
The percentiles C1, C2, ..., C99 are the quantiles of order 1%, 2%, ..., 99%. In the ordered
series, 1% of observations precede C1 and 99% of observations follow C1.
In empirical studies, the median is a feature that many researchers prefer to the arithmetic
mean. This is because the median has a very concrete meaning and is not very sensitive to
outliers. However, when studying a discrete variable with a small number of possible
(distinct) values, the use of the median is not recommended. The same is true for quantiles.
Remark:
- The median is the quantile of order p = 1/2.
- We often use
x1/4 for the first quartile,
x3/4 for the third quartile,
x1/10 for the first decile,
x1/5 for the first quintile,
x4/5 for the fourth quintile,
x9/10 for the ninth decile,
x0.05 for the fifth percentile,
x0.95 for the ninety-fifth percentile.
There are two types of arithmetic averages: the simple arithmetic average and the weighted
arithmetic average.
Simple arithmetic average
33
The simple arithmetic mean is used when each statistical unit has the same share in the
total value (this is known as equi-repartition). The average is the sum of the observed
values divided by their number, it is noted :
x 1+ x 2+ …+ xi+…+ xn 1 n
x= = ∑ xi
n n i=1
Example: The numbers of children in 8 families are 0, 0, 1, 1, 2, 3, 4.
0+0+1+1+1+2+3+ 4 12
The average is : x = = =1 ,5
8 8
Weighted arithmetic average
The weighted arithmetic mean takes into account the number of individuals and the value xi of
the variable. The different xi values do not have the same importance (or weight); the
calculation of the average must therefore take into account these differences in weight,
hence the weighting:
n n
1
moyenne pondérée X= ∑ ¿ xi=∑ fi xi
n i=1 i=1
¿
NB: fi = n is called relative frequency or simply frequency.
3) Application exercises :
a) Exercise 1:
Let's complete the table below and calculate the average x :
Number of calls 0 1 2 3 4 5
xi
No. of minutes or 93 261 416 393 308 174
34
ni 5,2 14,5 23,1 21,8 17,1 9,7
Frequency fi=
N
ni x i 0 261 832 1179 1232 870
∑ ni x i=¿5386
i=1
p
Therefore, we have
∑ ni x i 5386 = 2,992. Let x = 2,992.
x= i=1 =
N 1800
NB: If the modalities xi are classes, i.e. intervals, we use the centers ci of the classes.
When the statistical variable is continuous, the modalities being grouped in classes, by
convention, the centre of the classes is used for the calculation of the averages as the value
of the variable xi. The center of the class is the half-sum of the two limits of the interval.
xi+ xi+1
The center of the classes is defined by : Ci=
2
Note: when the observations are large numbers, to simplify the calculations, it is advisable
' xi−x 0
to perform a change of variables of the form : x i = .
a
xi is the variable under study; xi' is the auxiliary variable; a is the increase in the value of
the variable; x0 is a characteristic of the central tendency generally called the mode. This
change of variable is called change of origin and scale.
2- Geometric mean
The geometric mean, noted G, is widely used in the analysis of the evolution of a variable
over time. It is therefore used for everything that concerns the calculation of growth rates.
We can take the example of the growth rate of the turnover of a commercial company.
Like the arithmetic mean, a distinction is made between the simple geometric mean and the
weighted geometric mean. They are written respectively :
Simple geometric mean.
G = √n ¿ ¿) = [(x 1 x 2 x 3 … .. x n )]1/n
35
Note: The geometric mean is used, for example, when you want to calculate the average of
interest rates.
Example 1: The geometric mean of the numbers 8 and 12 is G = √2 8 x 12 = 9,8
Example 2. In a company X, the wage bill increases first by 10%, then by 15% and finally
by 30%. How much did it increase on average over the 3 periods?
Solution:
It is assumed that initially the base is 100.
1st
increase: 100 + 10% x100 = 1.1
2nd
increase: 100 + 15%x100 = 1.15
3rd
increase: 100 + 30%x100 = 1.3
G= √3 ( 1 ,1 ) ( 1 ,15 ) (1 ,3) = 1,1804. That is an average increase of 18.04% over the three
periods.
Note: the use of the arithmetic mean does not give a correct interpretation.
Weighted geometric mean
It is defined by :
G = √ x 1n 1 +…+ xn nn = (x1n1 + x2n2 + ...+ xnnnn) 1/n = ¿ ni)1/n
n n
log G = 1/n log ¿ ) = 1/n ∑ log xi = 1/n ∑ ¿ log xi
ni ni
i=1 i=1
n
1
∑ xi log xi OR G = n
⇒ G=e n i=1 √ ¿ ¿ ¿ ¿)
3- Harmonic average
The simple or weighted harmonic mean is used in the study of ratios such as speed, which
is expressed in kilometres travelled per hour. It is equal to the total number divided by the
average of the inverse of xi.
Simple harmonic mean
Example : on a journey, we do 60 km/h on the way out and 30 km/h on the way back.
What is the average speed?
Solution:
1 1 1 1
= [ + ] → H = 40km/h
H 2 60 30
Weighted harmonic average
1 n
n n
H= 1 =
∑
n i=1
¿∗1/ xi ∑ ¿/ xi
i=1
It is described as the square root of the means of the squares of the observations. The
simple or weighted quadratic mean, noted Q, is very commonly used in physics (as is the
harmonic mean which we will define below).
Simple quadratic mean
√ ∑x
2 2 2 2
x 1 + x +…+ x
Q= 2 = ( i=1 i )1/2
n
n
n
Example: let the series 1; 2; 3; 4; 5; 6 be;
Calculate its simple root mean square.
Q=
√ 1²+ 2 ²+3 ²+ 4 ²+5 ²+ 6 ²
6
=
Q=
√ x 12 n1+ x22 n2 +…+ x k 2 nk
n
Example: let's say the following series.
xi 1 2 3 4 5 6 Calculate the root mean square of this series.
or 20 30 15 10 5 2
1
Q² = [(20x1²) + (30x2²) + (15x3²) + (10x4²) +
82
(5x5²) + (2x6²)] = 7.71
Q = 2,78
Remark: note that H ≤ G ≤ X ≤ Q. There is equality (H = G = X = Q) when xi is constant.
Comparison of Measures of Central Tendency
Regardless of the shape of the distribution of the statistical variable under study, it is
accepted that the following inequalities always hold: H ≤ G ≤ X ≤ Q.
The range is the difference between the extreme values of a statistical distribution, i.e.
the difference between the highest value in the distribution and the lowest value in the
distribution. It measures the spread of values around the median.
Consider a statistical series whose values are arranged in ascending order.
The difference between the extreme terms x1 and xn of the series, i.e. the number: e
quartile.
38
The amplitude q of the interval q1; q3 is called the interquartile range, i.e. the
number q = Q3 - Q1.
Application exercise :
Student A received 8 marks which are: x1 = 5; x2 = 5; x3 = 6; x4 = 9; x5 = 10; x6 = 12; x7
= 13; x8 = 13.
Student B received 9 marks which are: x1 = 2; x2 = 3; x3 = 5; x4 = 6; x5 = 8; x6 = 9;
x7 = 9; x8 = 10; x9 = 10.
Solution:
Let's find the quartiles, interquartile range and interquartile range for each
student:
For student A (N= 8 =4x2): we have q1 = x N =x 8 =x 2= 5 and q3 = x 3 N = x 3 x 8 = x =¿ 12
6
4 4 4 4
Let q1 =5 and q3 = 12.
The variance is an indicator of the dispersion of a series with respect to its mean. It can be
defined as the sum of the squares of the deviations from the mean divided by the number of
observations. Its formula is the following:
The variance is the weighted sum of the squares of the deviations of the values in the
series from the mean.
Or
δx
=
√ V (x)
n n
1
V (X) = S2x = ∑ ¿ ¿ )2 = ∑ fi(xi−X ¿)¿ 2 KÖENIG's formula
n i=1 i=1
NB:
39
The variance V(x) and the standard deviationx measure the dispersion of values
around the mean x .
The standard deviation x compares the dispersion of 2 series. Unlike the
interquartile range q and the interdecile range d which take into account the whole
population.
A series is said to be more homogeneous (i.e. its values are less dispersed) than the
other series if and only if its standard deviation is lower. In other words, a series that is
not very dispersed (with values grouped around the mean value) will have a rather low
standard deviation.
Ownership:
4) Coefficient of variation
The CV makes it possible to appreciate the representativeness of the average in relation to
all the observations. It gives a good idea of the degree of homogeneity of a series. It should
be as low as possible (<15% in practice).
X−Mo
It is denoted β1 and defined by: β1 =
σ
2- The second Pearson coefficient
(X ¿−Me )
It is defined by; β1 = 3 ¿
σ
3- The third Pearson coefficient
40
It is defined by: β1 = μ32/ μ23with μ3 = ∑ f i( x i - x )3 ; μ2 = ∑ f i( x i - x )²
Note:
- If β1= S = γ1 = 0, the distribution is perfectly symmetric, then, M0 = Me = X
- If β1 > 0, S > 0, γ1 > 0, the distribution is right-spread, then, M0< Me< X
- If β1< 0, S < 0, γ1 < 0, the distribution is left-spread, then, X < Me< M0 or
M0> Me> X
Graphically, we have :
All skewness coefficients have the same properties, they are zero if the distribution is
symmetric, negative if the distribution is left asymmetric, and positive if the distribution is
right asymmetric as shown in the following figure:
Figure: Asymmetry of a distribution
41
Note: Some variables are always very asymmetric on the right, such as income, firm size,
or municipality size. A simple method to make a variable symmetrical is to take the
logarithm of this variable.
NB: one can also use the Pearson coefficient. The Pearson kurtosis is expressed by the
kurtosis of the dispersion. The kurtosis coefficient is equal to :
μ4 μ4
β2 = 2 = 4 with σ 4 = μ22
μ2 σ
42
- If β2 = 0, then the distribution is normal or mesokurtic.
- If β2 > 0, then the distribution is sharper than the normal distribution, it is said to
be leptokurtic.
- If β2 < 0, then the distribution is flatter than the normal distribution, so it is
platykurtic.
Example: In the following figure, an example of two distributions with the same mean and
variance is shown. The sharper distribution is leptokurtic, the other is mesokurtic. The
leptokurtic distribution has a thicker tail.
Application example:
Solution:
fi f i xi f i xi
2
xi - x f i( x i - x )² f i( x i - x )3 f i( x i - x )4
xi
0 0,216 0 0 -1,2 0,31104 -0,373 0,44789
1 0,432 0,432 0,432 -0,2 0,01728 -0,00345 6,91x10-4
2 0,288 0,576 1,152 +0,8 0,18432 +0,1474 0,11796
3 0,064 0,192 0,576 +1,8 0,20736 +0,373 0,671846
Totals 1 x = 1,2 2,16 0,72 0,144 1,238
μ4
β 2 (Pearson) = 2 with μ4 = 1,238 ; μ2= 0,72
μ2
β 2= 2,39
γ 2 (File) = β 2 - 3 = 2,39 - 3 = -0,611
Interpretation:
- This series is skewed to the left in the case of the asymmetric Ficher coefficient.
- In the case of Ficher kurtosis coefficients, the frequency curve is hypo-normal.
V APPLICATION EXERCISES
EXERCISE 1:
In a high school, 32 students were randomly selected from the senior classes. They
were asked to specify the series in which they would sit the baccalaureate: Philosophy and
literature (A); Economics and social sciences (B); Mathematics and physical sciences (C);
Mathematics and biology (D).
The results are as follows:
A-D-D-A-A-D-D-A-D-D-D-C-D-D-A-A-A-A-B-A-A-D-D-D
- C - C - B.
For this statistical series (xi; ni),
(a) Give the population, the individual, the characteristic, the list of modalities and the
total number of individuals.
(b) Is it a qualitative or quantitative characteristic? Discrete or continuous? Why is it
so?
(c) Organize these data in a table showing modalities, numbers, CTAs and DCEs,
frequencies, CCFs and CDFs.
EXERCISE 2
The distances xi (in thousands of km) travelled by each of the 150 cars of a car rental
company are recorded.
The results of this survey are :
Distances xi 0 ; 5 5 ; 7 7 ; 9 9 ; 15 Total
Staffing and 15 78 36 21 150
1) Let's build the histogram, and the polygon of the numbers.
2) Calculate the centre, amplitude, cumulative decreasing number, density of each
class, median, mode, mean, variance and standard deviation of this distribution.
44
EXERCISE 3
1) The number of children in 133 families is counted, the data is grouped as follows:
(a) Gross table :
001111111122222222223333333333
333333333333333333333333333333
333333333333444444444444444444
444444455555555555555666666666
6 6 6 6 6 6 6 6 7 7 9 9 10
2) The age at admission of 100 patients to the hospital is recorded, the data are
grouped as follows:
(a) Gross table :
10 22 24 42 37 77 89 85 28 63 9 10 7 51 2 1 52 7 48 54
32 29 2 15 46 48 39 6 72 14 36 69 40 61 12 21 54 53 58 32
27 31 1 25 22 6 81 11 56 5 63 53 88 48 52 87 71 51 53 33
46 33 85 22 5 87 28 2 85 61 16 42 69 7 10 53 33 3 85 8
51 60 58 9 14 74 24 87 7 81 30 76 7 6 27 18 17 53 70 49
Objectives:
The problem with bivariate statistical series is mainly that of the relationship or otherwise
between the variables.
For the sake of clarity, this chapter is based on the following example:
Exercise: The following table shows the evolution of the membership of a rugby club from
2001 to 2006.
The aim is to study this two-variable statistical series (rank and membership) in order to
predict the evolution of membership in the following years.
The first step is to make a graph that translates the two statistical series above.
48
Definition 1
In our example, if we place the rank on the abscissa, and the number of members on the
ordinate, we can represent each value by a point. We thus obtain a succession of points,
whose coordinates are (1; 70), (2; 90), ... (6; 220), form a point cloud.
Question 1
In a plane with an orthogonal reference frame and graphical units: 2 cm for one year on the
x-axis and 1 cm for 20 members on the y-axis, represent the cloud of points associated with
the series (xi; yi).
Definition 2
Let be a statistical series with two variables, X and Y, whose values are pairs (xi; yi). We
call the mean point of the series the point G of coordinates.
Question 2
Determine the coordinates of the following mean points:
G1 for the years 2001 to 2003,
G2 for the years 2004 to 2006,
G, mean point of the entire point cloud.
Solution:
G1 (2 ; 91, 7)
G2 (5 ; 176, 7)
G (3,5 ; 134, 2)
50
II Adjustments
II.1 Adjustment to the rule
The aim is to use the results obtained to make forecasts for the years to come. One way to
do this is to draw a line (D) as close as possible to the points of the cloud and to find the
equation of the type y = ax + b.
This adjustment consists in determining the line passing through two average points of the
point cloud.
Question 3
Determine the equation of the line D1 which passes through the mean points G1and G2
and plot it on the previous graph. The line D1 is not parallel to the ordinate axis, so its
equation is y = ax + b with :
Solution:
yG2− yG1
a= =28 , 3
xG2−xG2
To draw D1, simply place G1 and G2 and draw the line that connects them.
The aim is to obtain a line that is equidistant from the points on either side of it. To achieve
this, we try to minimize the sum of the distances of the points to the squared line. We
consider a statistical series with two variables represented by a cloud justifying an affine
adjustment.
Definition 3
51
In the plane provided with an orthogonal reference frame, we consider a cloud of n points
of coordinates (xi; yi). The line D of equation y = ax + b is called the regression line from
y to x of the statistical series if the following quantity is minimal:
Note 1
It would be just as well to look at the line D/ which minimizes the quantity :
Definition 4
The covariance of the dual statistical series of variables x and y is the real number :
52
Property 1
The regression line D from y to x has the equation y = ax + b where :
Question 4
Determine an equation of the least squares fit line D2 of y to x and plot it on the previous
graph.
The calculator gives D2: y = ax + b with a = 29 and b = 32.7
II.4 Comparison
With the last three adjustments, we can assess what will happen later, let's compare them:
Question 8
Assuming that the adjustments remain valid for subsequent years, give an estimate of the
number of members in 2007 using all three methods. In all cases, calculate y when x
corresponds to the year 2007, i.e. rank 7.
Mayer's method: y = 28.3 (7) + 35.1 = 233.2, i.e. approximately 233 members.
Affine adjustment: y = 29 (7) + 32.7 = 235.7 or approximately 236 members.
Definition 5
53
The linear correlation coefficient of a statistical series of variables x and y is the number r
defined by :
Graphical interpretation :
The closer the linear regression coefficient is to 1 in absolute value, the better the linear fit.
When r = ±1, the regression line passes through all the points of the cloud, which are
therefore aligned.
Question 10
Determine the linear correlation coefficient for the affine fit (between x and y) and then the
exponential fit (between x and z). Which fit is the most accurate?
Using the calculator, we find successively r2 = 0.987 and r3 = 0.999. This is consistent
with what we had deduced earlier, namely that the exponential fit is more reliable for this
case
Property 3
The linear correlation coefficient r checks -1 < r <1.
Property4 : Relationship between the regression coefficients and the linear correlation
coefficient
This relationship is as follows:
δx
r=a
δy
' δy
r=a
r2=a a ⇒|r|=√ aa '
δx
'
The sign of r depends on the sign of the covariance of the variables X and Y (Cov(X,Y))
III.1) The Distribution or Marginal Laws.
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
. . . . . . .
Where nij = number of employees in the pair (xi; yj) with i = row number and j = column
number.
b) Example:
Consider the following double series:
y= ages
x= (in years) y1=14 y2=15 y3=16 y4=17 y5=18
class centres
sizes (in m)
x1=1,5 1 2 1 0 1
x2=1,6 5 81 50 40 4
x4=1,8 0 1 8 10 9
For example, n23 = 50 means that there are 50 16-year-olds between 1.55m and 1.65m tall.
55
2) The Marginal Distribution :
(a) Definitions :
In a table of the numbers of 2 characters x (in rows) and y (in columns) :
A table margin is a completed row or column giving the total of the row or column,
also called the "total" row or "total" column.
The marginal distribution according to characteristic x is the "total" column: L1,
L2, ..., Lm.
The marginal distribution according to characteristic y is the "total" line: ,
C1 C2 , ...,
Cp.
NB:
The marginal distribution allows to study only one of the 2 characters x and y, the other
not being involved.
This amounts to a one-variable statistical series.
y
x y1 y …… yj …… yp Total" column
2
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
xm nm1 nm …… nmj …… nm Lm
2 p
Total" C1 C2 …… Cj …… Cp N= Total
line number
Where Li = ni1 + ni2 +...+ nip; Cj = n1j + n2j +...+ nmj and N = C1 + C2 +...+ Cp = L1 + L2 +...+
Lm = Total population.
56
x4=1,8 0 1 8 10 9
L4= 28
x4=1,8 0 1 8 10 9
L4= 28
Total" line C1=16 C2=204 C3=220 C4=180 C5=20 N=640
Marginal Total
frequency frequency
C f=1
fyj = j
N