




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































The lecture notes are divided into chapters. Long chapters are logically split into numbered subchapters.
Estimated time to study and fully grasp the subject of a chapter. The time is approximate add should only be treated as a guide.
These are aims that you need to achieve at the end of each chapter. They are based on knowledge and skills required.
Explanation expands on the studied material. New terms are introduced and explained in more detail. Examples are given.
Key ideas are summarized in conclusion of each chapter. If they are not clear enough at this point, it is recommended that you go back and study the chapter again.
To make sure that you thoroughly understand the discussed subject, you are going to be asked several theoretical questions. You will find the answers in the brackets or at the end of the textbook in the SOLUTION KEYS section.
Original goal of statistics was to collect data about population based on population samples. By population we mean a group of all existing components available for observation during statistical research. For example:
If a statistical research is performed about physical hight of 15-year old girls, the population will be all girls currently aged 15.
Considering the fact that the number of population members is usually high, the research will be based on the so-called sample examination where only part of the population is used. The examined part of the population is called a sample. What's really important is to make a definite selection that is as representative of the whole group as possible. There are several ways to achieve it. To avoid of omitting some elements of the population the so-called random sample is used in which each element of population has the same chance of being selected. It goes without saying that sample examination can never be as accurate as examining the whole population. Why do we do prefer it then?
Now that you know that statistics can describe the whole population based on information gathered from a population sample we will move on to Exploratory Data Analysis (EDA). Data we observe will be called the variables and their values variable variants. EDA is often the first step in revealing information hidden in a large amount of variables and their variants.
Because the way of processing variables depends most on their type, we will now explore how variables are devided into different categories. The variables division is shown in the following diagram.
Nominal variable – has equivalent variants: it is impossible to either compare them or sort them (for example: sex, nationality, etc.)
Variable
Qualitative (categorial, lexical...)
Quantitative (numerical...)
Nominal
general dividing
Ordinal
dividing based on number of variant variant
Alternative Plural
Discrete Continuous
Finite Denumerable
In case that a qualitative variable has k different variants (we describe their frequency as n 1 , n 2 … nk) - in a statistical group (of n values) it must be true that:
n n n n n
k
i
If you want to express the proportion of the variant frequency on the total number of occurrences, we use relative frequency to describe the variable.
i
alternatively:
= ⋅ 100 [%^ ] n
n p (^) i i
(We use the second formula to express the relative frequency in percentage points). For relative frequency it must be true that:
1 1 +^2 + + =∑ = =
k
i
When qualitative variables are processed, it is good to arrange frequency and relative frequency in the so-called frequency table :
FREQUENCY TABLE Values xi Absolute frequency Relative frequency ni pi x 1 n 1 p 1 x 2 n 2 p 2
x k nk pk
Total n n
k i i^
= 1
1 1
=
k i i
p
The last characteristic of nominal variable is the mode.
The mode represents a typical element of the group. Mode cannot be determined if there are more values with maximum frequency in the statistical group.
1.1.2 Graphical Methods of Presenting Qualitative Variables
The statistics often uses graphs for better analysis of variables. There are two types of graphs for analyzing nominal variable:
Histogram is a standard graph where variants of the variable are represented on one axis and variable frequencies on the other exis. Individual values of the frequency are then displayed as bars (boxes, vectors, squared logs, cones, etc.)
Examples:
0
2
4
6
8
10
12
14
16
18
20
1 2 3 4
Classification
0
2
4
6
8
10
12
14
16
18
20
1 2 3 4
Classification
0
2
4
6
8
10
12
14
16
18
20
1 2 3 4
Classification
0
2
4
6
8
10
12
14
16
18
20
1 2 3 4
Classification
0
2
4
6
8
10
12
14
16
18
20
1 2 3 4
Classification
What is the difference? From the second chart it is obvious that only two people were asked - the first one said YES and the second one said NO. What can be learned from that? Make charts in such a way that their interpretation is absolutely clear. If you are presented with a pie chart without absolute frequencies marked on it, you can ask yourselves whether it is because of the author’s ignorance or it is a deliberate bias.
An observational study has been undertaken on the use of an intersection. The collected data are in the table below. The data is made up of colours of cars that pass through the intersection. Analyze the data and interpret the results in a graphical form.
red blue red Green blue red red White green green blue Red
Solution: From the table it is obvious that the collected colours are qualitative (lexical) variables, and because there is no order or comparison between them, we can say they are nominal variables. For better description we create a frequency table and we determine the mode. We are going to present the colours of the passing vehicles by a histogram and a pie chart.
FREQUENCY TABLE Colors of passing cars
Absolute frequency Relative frequency ni pi red 5 5/12 = 0. blue 3 3/12 = 0. white 1 1/12 = 0. green 3 3/12 = 0. Total 12 1.
1 1
YES NO
We observed 12 cars total.
Mode = red (i.e. in our sample most cars were red)
1.1.3 Ordinal Variable
Now we are going to have a look at describing ordinal variables. The ordinal variable (just like the nominal variable) has various verbal variants in the group but these variants can be sorted i.e. we can tell which one is "smaller" and which one is "bigger" For describing ordinal variables we use the same statistical characteristics and graphs as for nominal variables (frequency, relative frequency, mode viewed by histogram or pie chart) plus two others characteristics (cumulative frequency and cumulative relative frequency) thus including information about how they are sorted.
E.g. we have a variable called "grade from Statistics" that has the following variants: "1", "2", "3" or "4" (where 1 is the best and 4 the worst grade). Then, for example, the cumulative frequency for variant "3", will be equal number of students who get grade "3" or better.
If variants are sorted by their "size" (“ (^) x 1 (^) < x 2 <K< xk ”) then the following must be true:
i i (^) j j m n 1
So it is self-evident that cumulative frequency k-th ("the highest") variant is equal to the variable n.
mk = n
0
1
2
3
4
5
6
red blue white green
Colours of passing cars
5
3
1
3
Colours of passing cars
red blue white green
Ogive (Cumulative Frequency Polygon)
- is a frequency polygon of the cumulative frequency or the relative cumulative frequency. The vertical axis is the cumulative frequency or relative cumulative frequency. The horizontal axis represents variants. The graph always starts at zero, at the lowest variant, and ends up at the total frequency (for a cumulative frequency) or 1.00 (for a relative cumulative frequency).
Pareto Graph
0
5
10
15
20
25
30
35
40
1 2 3 4
cumulative frequency
variant
Ogive for the evaluation grades
0
2
4
6
8
10
12
14
16
18
20
1 2 3 4
frequency
variant
Frequency polygon for the evaluation grades
Notice the decline of cumulative frequency. It drops as the frequency of variables decreases.
Following data represent t-shirts sizes that a cloths retailer offers on sale:
S, M, L, S, M, L, XL, XL, M, XL, XL, L, M, S, M, L, L, XL, XL, XL, L, M
a) Analyze the data and interpret results in a graphical form. b) Determine what percentage of people bought t-shirts of L size maximum.
Solution : a) The variable is qualitative (lexical) and t-shirt sizes can be sorted, therefore it is an ordinal variable. For its description you use frequency table for the ordinal variable and you determine the mode.
FREQUENCY TABLE Colors of passing cars
Absolute frequency Relative frequency ni pi red 5 blue 3 white 1 green 3 Total^12 1.
Mode = XL (the most people bought t-shirts with XL value)
For graphical representation use histogram, pie graph and cumulative frequency polygon (you don't create Pareto graph because it is mostly used for technical data).
1.2.1 Measures of Location and Variability
The most common measure of position is the variable mean. The mean represents average or typical value of the sample population. The most famous mean of quantitative variable is:
It is defined by the following formula:
n
i
∑ i
where: (^) xi ... are values of the variable n ... size of the sample population (number of the values of the variable)
Properties of the arithmetical mean:
!
=
n i
= = a x n
a x
n
x a x
n i i
n
: i! i^!
∀ ∈ℜ = ⇒ =
= = bx n
bx
n
x b x
n i i
n i i :!^!
Arithmetical mean is not always the best way to calculate the mean of the sample population. For example, if we work with a variable representing relative changes (cost indexes, etc.) we use the so-called geometrical mean. To calculate mean when the variable has a form of a unit, harmonical mean is often used.
Considering that the mean uses the whole variable values data set, it carries maximum information about the sample population. On the other hand, it's very sensitive to the so-called outlying observations (outliers). Outliers are values that are substantially different from the rest of the values in a group and they can distort the mean to such a degree that it no longer represents the sample population. We are going to have a closer look at the Outliers later.
Measures of location that are less dependent on the outlying observations are:
In the case of mode we will differentiate between discrete and continuous quantitative variable. For discrete variable we define mode as the most frequent value of the variable (similarly as with the qualitative variable).
But in the case of continuous variable we think of the mode as the value around which most variable values are concentrated. For assessment of this value we use shorth. Shorth is the shortest interval with at
number of values) (^) k values lie within shorth - which is n/2 (50%) variable values. In the case of a sample as large as (^) n = 2 k + 1 ( k ∈Ν) (with odd number of values) (^) k + 1 values lies within short - which is about 1/2 plus 50% variable values (n/2+1/2).
Then, the mode x ˆ can be defined as the centre of the shorth.
From what has been said so far it is clear that the shorth length (top boundary - bottom boundary) is unique but its location is not.
If the mode can be determined unambiguously we talk about unimode variable. When a variable has two modes we call it bimode. When there are two or more modes in a sample, it usually indicates a heterogenity of variable values. This heterogenity can be removed by dividing the sample into more subsamples (for example bimode mark for person's height can be divided by sex into two unimode marks - women's height and men's height).
The following data shows ages of musicians who performed at a concert. Age is a continuous variable. Calculate Mean, Shorth and Mode for the variable.
22 82 27 43 19 47 41 34 34 42 35
Solution:
a) Mean:
Mode = 38.5 years which means that the typical age of the musicians who performed at the concert was 38.5 years.
Among other characteristics describing quantitative variables are quantiles. Those are used for more detailed illustration of the distribution of the variable values within the scope of the population.
Quantile of variable x that separates 100% smaller values from the rest of the samples (i.e. from 100(1-p)% values) will be called 100p % quantile and marked xp.
In real life you most often come across the following quantiles:
Lower quartile x0,25 = 25% quantile - divides a sample of data in a way that 25% of the values are smaller than the quartile, i.e. 75% are bigger (or equal)
Median x0,5 = 50% quantile - divides a sample of data in a way that 50% of the values are smaller than the median and 50% of values are bigger (or equal)
Upper quartile x0,75 = 75% quantile - divides a sample of data in a way that 75% of values are smaller than the quartile, i.e. 25% are bigger (or equal)
Example:
Data 6 47 49 15 43 41 7 39 43 41 36 Data in ascending order 6 7 15 36 39 41 41 43 43 47 49 Median 41 Upper quartile 43 Lower quartile 15
The difference between the 1st and 3rd quartile is called the Inter-Quartile Range (IQR).
Example:
The deciles divide the data into 10 equal regions.
The percentiles divide the data into 100 equal regions.
For example, the 80th^ percentile is the number that has 80% of values below it and 20% above it. Rather than counting 80% from the bottom, count 20% from the top.
Note: The 50th^ percentile is the median.
x (^) min = x 0 , i.e. 0% of values are less than minimum x (^) max = x 1 , i.e. 100% of values are less than maximum
There is the following process to determine quantiles:
REMEMBER!!! In case of a data set with an even number of values the median is not uniquely defined. Any number between two middle values (including these values) can be accepted as the median. Most often it is the middle value.
We are now going to discuss the relation between quantiles and the cumulative relative frequency. The value p denotes cumulative relative frequency of quantile xp
Data 2 3 4 5 6 6 6 7 7 8 9 Upper quartile 7 Lower quartile 4 IQR 7 - 4 = 3