Support de cours Statistique descriptive

📚 Support de cours Statistique descriptive .pdf

Brief overview

This document provides a comprehensive introduction to descriptive statistics, equipping students with foundational concepts and methods for data analysis. It covers the entire process from data collection to summarizing and presenting bivariate data, enabling effective understanding and interpretation of statistical information.

Key points

  • Overview of statistical concepts, historical context, and applications.
  • Methods for data collection and categorization of variable types.
  • Techniques for data representation using tables and graphs.
  • Measures of central tendency and dispersion for summarizing data.
  • Analysis of relationships in bivariate data through regression and correlation.

1. Introduction to descriptive statistics

1.1 What is statistics?

  • Statistics: A field using methods to quantify and analyze phenomena. These phenomena are observable, countable, and classifiable.
  • Statistics is a tool for investigation, not an ideal model.
  • Variables are measured with varying precision based on the application.
  • Statistical methods synthesize phenomena effectively.

Statistics helps describe and analyze data.

1.2 Statistical vocabulary

  • Population: A group of individuals sharing a common trait.
  • Sample: A subset taken from the population.
  • Individual / Statistical unit: Each member of a population or sample.
  • Size: The number of individuals in a sample (nn) or population (NN).
  • Character / Variable: The specific aspect being studied.
  • Modalities: The different ways a character can be expressed (xix_i).
  • Statistical series: All data points for a set of individuals.
  • Effectif / Absolute frequency: The number of individuals with a specific modality (nin_i).
ConceptSymbolDescription
Total populationNNTotal number of individuals in the population
Sample sizennNumber of individuals in the sample
Modalitiesxix_iThe specific values a variable can take
Absolute frequencynin_iCount of individuals for a specific modality
Relative frequencyfif_iProportion of individuals for a specific modality (ni/Nn_i / N)
  • Relative frequency (fif_i): The proportion of individuals with a specific modality.
  • The sum of all frequencies equals 1 (or 100%).

1.3 Data collection

1.3.1 The collection process

  • Define research problem and objectives: What do you want to find out?
  • Identify target population: Who or what are you studying?

Data sources:

  • Exhaustive methods: Study every individual (e.g., Census).
    • Difficult for large populations due to cost and time.
  • Non-exhaustive methods: Study a subset (e.g., Survey).
    • The subset is called a sample.
    • Sampling methods are statistical techniques to select samples.

A sample must be representative of the population.

1.3.2 Nature of data: Character type

Data types determine appropriate analysis methods.

Character TypeDescriptionSubtypesExamples
QuantitatifModalities are measurable or numerical.Discrete: Whole numbers, often counts.Number of children per household
QualitatifModalities are descriptive words or categories, not numerical.Nominal: No inherent order.Sex, marital status

1.4 Statistical representation of collected data

  • Statistical tables summarize raw data for readability.
  • Tables present information about individuals (rows) and studied criteria (columns).

Tables make data easy to understand.

📝 Example: An inquiry into the number of children per household in 56 Moroccan families.

🔑 Important: Understanding data types is crucial for choosing the right analysis.

🔑 Important: The goal of descriptive statistics is to summarize and describe data.

2. Data representation using tables and graphs

2.1 Organizing data in tables

Statistical tables condense raw data for easier analysis and interpretation. They require clear headings for rows and columns, specifying units used.

A title should explain the table's content and source.

A basic statistical table for a single characteristic (univariate data) typically includes:

  • Modalities/Values (xix_i): The distinct categories or numerical values the characteristic can take.
  • Frequency (nin_i): The count of individuals or observations for each modality.

The sum of all frequencies (nin_i) equals the total number of observations (nn).

2.2 Frequency and cumulative values

  • Frequency (fif_i): The proportion of individuals with a specific modality. It's calculated as fi=ni/nf_i = n_i / n and ranges from 0 to 1 (or 0% to 100%). The sum of all frequencies is 1.
  • Cumulative Frequency: This shows the total number or proportion of observations up to a certain modality.
    • Increasing cumulative frequency: Counts observations less than or equal to a value.
    • Decreasing cumulative frequency: Counts observations greater than or equal to a value.
Modalities (xix_i)Frequency (nin_i)Frequency (fif_i)Increasing Cumulative Frequency (NcN_c)Increasing Cumulative Frequency (FcF_c)Decreasing Cumulative Frequency (NdN_d)Decreasing Cumulative Frequency (FdF_d)
x1x_1n1n_1f1f_1N1=n1N_1 = n_1F1=f1F_1 = f_1Nd1=nN_{d1} = nFd1=1F_{d1} = 1
x2x_2n2n_2f2f_2N2=n1+n2N_2 = n_1 + n_2F2=f1+f2F_2 = f_1 + f_2Nd2=n−n1N_{d2} = n - n_1Fd2=1−f1F_{d2} = 1 - f_1
.....................
xkx_knkn_kfkf_kNk=nN_k = nFk=1F_k = 1Ndk=nkN_{dk} = n_kFdk=fkF_{dk} = f_k

Cumulative frequencies help understand how data accumulates.

2.3 Quantitative data tables

Discrete quantitative data involves countable values. For example, the number of children per household.

Continuous quantitative data involves values that can fall anywhere within a range. Data is often grouped into classes (intervals) of equal or unequal amplitudes.

  • Equal amplitudes: Classes have the same width. The number of classes (kk) can be estimated using rules like Sturges' rule (k=1+3.22log⁡(n)k = 1 + 3.22 \log(n)) or Yule's rule (k=2.5(n)1/4k = 2.5(n)^{1/4}). The class width (ee) is calculated as the total range (E=xmax−xminE = x_{max} - x_{min}) divided by the number of classes (kk).
  • Unequal amplitudes: Class intervals vary. This requires using corrected frequencies (nicn_{ic}) to ensure fair comparison of class sizes. Corrected frequency is calculated as nic=ni/ain_{ic} = n_i / a_i, where aia_i is the amplitude of class ii.

The class center (cic_i) is the midpoint of a class interval, calculated as the average of its lower and upper bounds.

ClassFrequency (nin_i)Amplitude (aia_i)Corrected Frequency (ni/ain_i / a_i)
[e0,e1[[e_0, e_1[n1n_1a1a_1n1/a1n_1 / a_1
[e1,e2[[e_1, e_2[n2n_2a2a_2n2/a2n_2 / a_2
............
[ek−1,ek[[e_{k-1}, e_k[nkn_kaka_knk/akn_k / a_k

2.4 Qualitative data tables

For qualitative (non-measurable) data, categories are listed with their frequencies. The arrangement follows a logical interpretation.

Modality (xix_i)Frequency (nin_i)Frequency (fif_i)
Category AnAn_AfAf_A
Category BnBn_BfBf_B
.........
Totalnn1

Tables summarize data, making patterns visible.

2.5 Visualizing data with graphs

Graphs provide a visual summary of data from tables, allowing for quick understanding of distributions.

2.6 Graphs for qualitative data

  • Pie charts (Sectors): A circle divided into sectors, where each sector's area is proportional to its frequency. The angle of each sector is 360∘×fi360^\circ \times f_i.
  • Bar charts (Organ pipes): Rectangles with a constant base and heights proportional to frequencies or counts. Bars are typically ordered from largest to smallest.

2.7 Graphs for quantitative data

Discrete quantitative data:

  • Bar chart (Diagramme en bâtons): Values (xix_i) are on the x-axis, and frequencies (nin_i or fif_i) are on the y-axis. Each value gets a bar.
  • Frequency polygon: Connects the midpoints of the tops of the bars in a bar chart to show distribution shape.

Continuous quantitative data:

  • Histogram: Uses adjacent rectangles (bars) where the base represents the class amplitude and the height is proportional to the frequency (or corrected frequency). It visualizes data grouped into intervals.
    • Equal amplitudes: Height is directly proportional to frequency.
    • Unequal amplitudes: Height is proportional to the corrected frequency (ni/ain_i / a_i). The area of each rectangle represents the frequency for that class.

Histograms show the shape of continuous data distributions.

2.8 Summarizing data distributions

Numerical characteristics summarize tables and graphs, aiding comparisons and providing clarity. Key characteristics fall into three categories: central tendency, position, and dispersion.

2.9 Measures of central tendency

These indicate the typical value of a dataset.

  • Arithmetic Mean (X‾\overline{X}): The sum of all values divided by the number of observations.
    • Simple mean: X‾=∑xin\overline{X} = \frac{\sum x_i}{n}
    • Weighted mean: X‾=∑nixin\overline{X} = \frac{\sum n_i x_i}{n} (for discrete data) or X‾=∑nicin\overline{X} = \frac{\sum n_i c_i}{n} (for continuous data). It can also be calculated using frequencies: X‾=∑fixi\overline{X} = \sum f_i x_i or X‾=∑fici\overline{X} = \sum f_i c_i.
  • Geometric Mean (G): The nn-th root of the product of nn positive values. Used for multiplicative relationships, like average growth rates. G=x1⋅x2⋅⋯⋅xnnG = \sqrt[n]{x_1 \cdot x_2 \cdot \dots \cdot x_n} It can be calculated using logarithms: log⁡(G)=∑nilog⁡(xi)n\log(G) = \frac{\sum n_i \log(x_i)}{n}.
  • Quadratic Mean (Q): The square root of the mean of the squared values. It gives more weight to extreme values. Q=∑nixi2nQ = \sqrt{\frac{\sum n_i x_i^2}{n}}
  • Harmonic Mean (H): The reciprocal of the arithmetic mean of the reciprocals of the values. Used for inverse relationships, like price and quantity. H=n∑nixiH = \frac{n}{\sum \frac{n_i}{x_i}}

Order of means: H<G<X‾<QH < G < \overline{X} < Q.

2.10 The Mode (Mo)

The mode is the value or category that appears most frequently in a dataset.

  • For qualitative or discrete quantitative data, it's the modality with the highest frequency.
  • For continuous quantitative data grouped into classes:
    • Equal amplitude classes: The modal class has the highest frequency. The mode can be estimated using interpolation: Mo=xi−1+aid1d1+d2M_o = x_{i-1} + a_i \frac{d_1}{d_1 + d_2}, where xi−1x_{i-1} is the lower bound of the modal class, aia_i is its amplitude, d1d_1 is the difference in frequency between the modal class and the previous class, and d2d_2 is the difference between the modal class and the next class.
    • Unequal amplitude classes: Frequencies must be corrected before determining the modal class and calculating the mode.

The mode represents the most common observation.

2.11 The Median (Me)

The median is the middle value in a dataset that has been ordered from least to greatest. It divides the data into two equal halves (50% below, 50% above).

  • For discrete data:
    • If nn is odd, MeMe is the ((n+1)/2)th((n+1)/2)^{th} value.
    • If nn is even, MeMe is the average of the (n/2)th(n/2)^{th} and ((n/2)+1)th((n/2)+1)^{th} values.
  • For continuous data: The median is found within a specific class (the median class) that contains the (n/2)th(n/2)^{th} observation. Linear interpolation is used to estimate the median value within that class: Me=xi−1+aiR−Ni−1niMe = x_{i-1} + a_i \frac{R - N_{i-1}}{n_i}, where RR is the rank (n/2n/2), xi−1x_{i-1} is the lower bound of the median class, aia_i its amplitude, Ni−1N_{i-1} the cumulative frequency before the median class, and nin_i the frequency of the median class.

The median is less affected by outliers than the mean.

2.12 Quantiles

Quantiles generalize the median concept by dividing the ordered data into more than two equal parts.

  • Quartiles (Q1, Q2, Q3): Divide data into four equal parts. Q2 is the median. Q1 is the 25th percentile, Q3 is the 75th percentile.
  • Deciles (D1-D9): Divide data into ten equal parts. D5 is the median.
  • Percentiles (C1-C99): Divide data into one hundred equal parts. C50 is the median.

The interquartile range (Q3−Q1Q_3 - Q_1) contains 50% of the data around the median.


Data representation turns numbers into insights. Understanding tables and graphs is crucial for interpreting statistical information.

2.13 Measures of dispersion

Measures of dispersion describe how spread out data points are from the average. They show the variability within a dataset.

Common measures include range, interquartile range, variance, and standard deviation. A higher value indicates greater spread.

2.14 Standard deviation

The standard deviation (σ\sigma) measures the average amount of variability in a dataset. It is the square root of the variance.

A low standard deviation means data points are generally close to the mean. A high standard deviation means data points are spread out over a wider range of values.

The formula for standard deviation involves several steps:

  • Calculate the variance.
  • Take the square root of the variance.

σ=Variance\sigma = \sqrt{\text{Variance}}

2.15 Coefficient of variation

The coefficient of variation (Cv) is a standardized measure of dispersion. It expresses the standard deviation as a percentage of the mean.

This allows for comparison of dispersion between datasets with different units or vastly different means.

The formula for the coefficient of variation is:

Cv=σxˉ\text{Cv} = \frac{\sigma}{\bar{x}}

where:

  • σ\sigma is the standard deviation.
  • xˉ\bar{x} is the mean.

📝 Example: For student grades, a Cv of 0.51 indicates that the data spread is 51% of the average grade. This suggests a relatively high dispersion of scores compared to the mean.

2.16 Variance calculation from grouped data

When data is presented in grouped intervals (e.g., class bins), the variance can be calculated. This involves using the midpoint of each interval.

The calculation sums the squared deviations from the mean, weighted by the frequency of each interval.

The variance formula for grouped data is: V(x)=(1N∑i=1knici2)−xˉ2V(x) = \left( \frac{1}{N} \sum_{i=1}^{k} n_i c_i^2 \right) - \bar{x}^2 where:

  • NN is the total number of observations.
  • kk is the number of classes.
  • nin_i is the frequency of the ii-th class.
  • cic_i is the midpoint of the ii-th class.

📝 Example: In a dataset of student grades grouped into intervals, the variance is calculated using the midpoints of these intervals to estimate the spread of scores.

2.17 Interpretation of dispersion measures

  • Standard deviation: A value of 5.102 indicates that, on average, data points deviate by 5.102 units from the mean.
  • Coefficient of variation: A Cv of 0.51, or 51%, suggests that the spread of the data is quite large relative to the average value. This highlights significant variability in the measured values.

🔑 Important: High dispersion measures (standard deviation, coefficient of variation) mean data is widely spread. Low measures mean data is clustered near the mean.

🔑 Important: The coefficient of variation is essential for comparing the variability of datasets with different scales or units, like comparing the spread of heights in meters to the spread of weights in kilograms.

3. Bivariate data analysis

3.1 Contingency tables

  • Bivariate distribution: Data observed for two variables or characteristics.
  • Contingency table: Organizes bivariate data, showing frequencies for combinations of variable categories.

📝 Example: A table showing student counts by height and weight.

A contingency table structure:

Y1Y_1Y2Y_2...YkY_kMarginal Totals (X)
X1X_1n11n_{11}n12n_{12}...n1kn_{1k}n1.n_{1.}
X2X_2n21n_{21}n22n_{22}...n2kn_{2k}n2.n_{2.}
..................
XmX_mnm1n_{m1}nm2n_{m2}...nmkn_{mk}nm.n_{m.}
Marginal Totals (Y)n.1n_{.1}n.2n_{.2}...n.kn_{.k}NN
  • nijn_{ij}: Frequency for the combination of XiX_i and YjY_j.
  • ni.n_{i.} (or ni⋅n_{i\cdot}): Sum of frequencies for XiX_i (marginal total for X).
  • n.jn_{.j} (or n⋅jn_{\cdot j}): Sum of frequencies for YjY_j (marginal total for Y).
  • NN: Total number of observations.

3.2 Marginal and conditional distributions

3.2.1 Marginal distributions

  • Marginal distribution: Distribution of a single variable from a bivariate dataset. It's found at the "margins" of the contingency table.
  • Marginal mean: The mean calculated from a marginal distribution.

A marginal distribution for X:

X (xix_i)Frequency (ni.n_{i.})
x1x_1n1.n_{1.}
x2x_2n2.n_{2.}
......
xmx_mnm.n_{m.}
TotalNN

A marginal distribution for Y:

Y (yjy_j)Frequency (n.jn_{.j})
y1y_1n.1n_{.1}
y2y_2n.2n_{.2}
......
yky_kn.kn_{.k}
TotalNN

3.2.2 Conditional distributions

  • Conditional distribution: Distribution of one variable given a specific value or category of the other variable. It focuses on a subset of the data.
  • Conditional mean: The mean of a variable within a specific conditional distribution.

Consider the distribution of X given YjY_j:

X (xix_i)Frequency (nijn_{ij})
x1x_1n1jn_{1j}
x2x_2n2jn_{2j}
......
xmx_mnmjn_{mj}
Totaln.jn_{.j}

🔑 Important: There are as many conditional distributions for X as there are categories in Y.

3.3 Means and variances

3.3.1 Marginal means and variances

For discrete variables xix_i and yjy_j, or centers of classes for continuous variables:

  • Marginal mean of X: x‾=1N∑i=1mni.xi\overline{x} = \frac{1}{N} \sum_{i=1}^{m} n_{i.} x_i
  • Marginal mean of Y: y‾=1N∑j=1kn.jyj\overline{y} = \frac{1}{N} \sum_{j=1}^{k} n_{.j} y_j
  • Marginal variance of X: V(x)=1N∑i=1mni.(xi−x‾)2=1N∑i=1mni.xi2−x‾2V(x) = \frac{1}{N} \sum_{i=1}^{m} n_{i.} (x_i - \overline{x})^2 = \frac{1}{N} \sum_{i=1}^{m} n_{i.} x_i^2 - \overline{x}^2
  • Marginal variance of Y: V(y)=1N∑j=1kn.j(yj−y‾)2=1N∑j=1kn.jyj2−y‾2V(y) = \frac{1}{N} \sum_{j=1}^{k} n_{.j} (y_j - \overline{y})^2 = \frac{1}{N} \sum_{j=1}^{k} n_{.j} y_j^2 - \overline{y}^2

3.3.2 Conditional means and variances

For the conditional distribution of X given YjY_j:

  • Conditional mean of X given YjY_j: x‾∣Yj=1n.j∑i=1mnijxi\overline{x}_{|Y_j} = \frac{1}{n_{.j}} \sum_{i=1}^{m} n_{ij} x_i
  • Conditional variance of X given YjY_j: V(x∣Yj)=1n.j∑i=1mnij(xi−x‾∣Yj)2=1n.j∑i=1mnijxi2−x‾∣Yj2V(x_{|Y_j}) = \frac{1}{n_{.j}} \sum_{i=1}^{m} n_{ij} (x_i - \overline{x}_{|Y_j})^2 = \frac{1}{n_{.j}} \sum_{i=1}^{m} n_{ij} x_i^2 - \overline{x}_{|Y_j}^2

Similarly, for the conditional distribution of Y given XiX_i:

  • Conditional mean of Y given XiX_i: y‾∣Xi=1ni.∑j=1knijyj\overline{y}_{|X_i} = \frac{1}{n_{i.}} \sum_{j=1}^{k} n_{ij} y_j
  • Conditional variance of Y given XiX_i: V(y∣Xi)=1ni.∑j=1knij(yj−y‾∣Xi)2=1ni.∑j=1knijyj2−y‾∣Xi2V(y_{|X_i}) = \frac{1}{n_{i.}} \sum_{j=1}^{k} n_{ij} (y_j - \overline{y}_{|X_i})^2 = \frac{1}{n_{i.}} \sum_{j=1}^{k} n_{ij} y_j^2 - \overline{y}_{|X_i}^2

3.4 Covariance

  • Covariance: Measures the degree of joint variation between two variables.

The covariance formula is:

Cov(X,Y)=1N∑i=1m∑j=1knij(xi−x‾)(yj−y‾)Cov(X, Y) = \frac{1}{N} \sum_{i=1}^{m} \sum_{j=1}^{k} n_{ij} (x_i - \overline{x})(y_j - \overline{y})

A computationally simpler form:

Cov(X,Y)=1N∑i=1m∑j=1knijxiyj−x‾y‾Cov(X, Y) = \frac{1}{N} \sum_{i=1}^{m} \sum_{j=1}^{k} n_{ij} x_i y_j - \overline{x}\overline{y}

🔑 Important: The sign of the covariance indicates the direction of the linear relationship.

3.5 Linear regression

  • Regression: Relating one variable (Y) to another (X) using a function.
  • Linear regression: Specifically, fitting a straight line to represent the relationship between Y and X.

The goal is to find the equation of the regression line y=ax+by = ax + b that best fits the data points. This is typically done using the method of least squares, which minimizes the sum of squared distances between the data points and the line.

The coefficients are calculated as:

  • Slope (aa): a=Cov(X,Y)V(x)a = \frac{Cov(X, Y)}{V(x)}
  • Y-intercept (bb): b=y‾−ax‾b = \overline{y} - a\overline{x}

🔑 Important: The regression line helps predict the value of Y for a given X.

3.6 Linear correlation coefficient

  • Linear correlation coefficient (rr): Measures the strength and direction of a linear relationship between two variables. It is unitless.

The formula for rr is:

r=Cov(X,Y)σXσY=Cov(X,Y)V(x)V(y)r = \frac{Cov(X, Y)}{\sigma_X \sigma_Y} = \frac{Cov(X, Y)}{\sqrt{V(x)V(y)}}

Interpreting rr:

  • Sign:

    • r>0r > 0: Positive linear relationship (as X increases, Y tends to increase).
    • r<0r < 0: Negative linear relationship (as X increases, Y tends to decrease).
    • r=0r = 0: No linear relationship.
  • Magnitude (absolute value):

    • ∣r∣|r| close to 1: Strong linear correlation.
    • ∣r∣|r| close to 0: Weak or no linear correlation.

Interpretation Guide:

| Range of ∣r∣|r| | Strength of Correlation | | :------------- | :---------------------- | | 0≤∣r∣<0.400 \le |r| < 0.40 | Weak or quasi-absent | | 0.40≤∣r∣<0.600.40 \le |r| < 0.60 | Moderate | | 0.60≤∣r∣<0.800.60 \le |r| < 0.80 | Good | | 0.80≤∣r∣≤10.80 \le |r| \le 1 | High |

🔑 Important: The correlation coefficient only describes linear relationships; a high rr does not imply causation.

انظر أيضاً