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 (n) or population (N).
- Character / Variable: The specific aspect being studied.
- Modalities: The different ways a character can be expressed (xi).
- Statistical series: All data points for a set of individuals.
- Effectif / Absolute frequency: The number of individuals with a specific modality (ni).
| Concept | Symbol | Description |
|---|---|---|
| Total population | N | Total number of individuals in the population |
| Sample size | n | Number of individuals in the sample |
| Modalities | xi | The specific values a variable can take |
| Absolute frequency | ni | Count of individuals for a specific modality |
| Relative frequency | fi | Proportion of individuals for a specific modality (ni/N) |
- Relative frequency (fi): 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 Type | Description | Subtypes | Examples |
|---|---|---|---|
| Quantitatif | Modalities are measurable or numerical. | Discrete: Whole numbers, often counts. | Number of children per household |
| Qualitatif | Modalities 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 (xi): The distinct categories or numerical values the characteristic can take.
- Frequency (ni): The count of individuals or observations for each modality.
The sum of all frequencies (ni) equals the total number of observations (n).
2.2 Frequency and cumulative values
- Frequency (fi): The proportion of individuals with a specific modality. It's calculated as fi=ni/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 (xi) | Frequency (ni) | Frequency (fi) | Increasing Cumulative Frequency (Nc) | Increasing Cumulative Frequency (Fc) | Decreasing Cumulative Frequency (Nd) | Decreasing Cumulative Frequency (Fd) |
|---|---|---|---|---|---|---|
| x1 | n1 | f1 | N1=n1 | F1=f1 | Nd1=n | Fd1=1 |
| x2 | n2 | f2 | N2=n1+n2 | F2=f1+f2 | Nd2=n−n1 | Fd2=1−f1 |
| ... | ... | ... | ... | ... | ... | ... |
| xk | nk | fk | Nk=n | Fk=1 | Ndk=nk | Fdk=fk |
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 (k) can be estimated using rules like Sturges' rule (k=1+3.22log(n)) or Yule's rule (k=2.5(n)1/4). The class width (e) is calculated as the total range (E=xmax−xmin) divided by the number of classes (k).
- Unequal amplitudes: Class intervals vary. This requires using corrected frequencies (nic) to ensure fair comparison of class sizes. Corrected frequency is calculated as nic=ni/ai, where ai is the amplitude of class i.
The class center (ci) is the midpoint of a class interval, calculated as the average of its lower and upper bounds.
| Class | Frequency (ni) | Amplitude (ai) | Corrected Frequency (ni/ai) |
|---|---|---|---|
| [e0,e1[ | n1 | a1 | n1/a1 |
| [e1,e2[ | n2 | a2 | n2/a2 |
| ... | ... | ... | ... |
| [ek−1,ek[ | nk | ak | nk/ak |
2.4 Qualitative data tables
For qualitative (non-measurable) data, categories are listed with their frequencies. The arrangement follows a logical interpretation.
| Modality (xi) | Frequency (ni) | Frequency (fi) |
|---|---|---|
| Category A | nA | fA |
| Category B | nB | fB |
| ... | ... | ... |
| Total | n | 1 |
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∘×fi.
- 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 (xi) are on the x-axis, and frequencies (ni or fi) 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/ai). 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): The sum of all values divided by the number of observations.
- Simple mean: X=n∑xi
- Weighted mean: X=n∑nixi (for discrete data) or X=n∑nici (for continuous data). It can also be calculated using frequencies: X=∑fixi or X=∑fici.
- Geometric Mean (G): The n-th root of the product of n positive values. Used for multiplicative relationships, like average growth rates. G=nx1⋅x2⋅⋯⋅xn It can be calculated using logarithms: log(G)=n∑nilog(xi).
- Quadratic Mean (Q): The square root of the mean of the squared values. It gives more weight to extreme values. Q=n∑nixi2
- Harmonic Mean (H): The reciprocal of the arithmetic mean of the reciprocals of the values. Used for inverse relationships, like price and quantity. H=∑xinin
Order of means: H<G<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+aid1+d2d1, where xi−1 is the lower bound of the modal class, ai is its amplitude, d1 is the difference in frequency between the modal class and the previous class, and d2 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 n is odd, Me is the ((n+1)/2)th value.
- If n is even, Me is the average of the (n/2)th and ((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 observation. Linear interpolation is used to estimate the median value within that class: Me=xi−1+ainiR−Ni−1, where R is the rank (n/2), xi−1 is the lower bound of the median class, ai its amplitude, Ni−1 the cumulative frequency before the median class, and ni 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−Q1) 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 (σ) 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
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ˉσ
where:
- σ is the standard deviation.
- 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)=(N1∑i=1knici2)−xˉ2 where:
- N is the total number of observations.
- k is the number of classes.
- ni is the frequency of the i-th class.
- ci is the midpoint of the i-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:
| Y1 | Y2 | ... | Yk | Marginal Totals (X) | |
|---|---|---|---|---|---|
| X1 | n11 | n12 | ... | n1k | n1. |
| X2 | n21 | n22 | ... | n2k | n2. |
| ... | ... | ... | ... | ... | ... |
| Xm | nm1 | nm2 | ... | nmk | nm. |
| Marginal Totals (Y) | n.1 | n.2 | ... | n.k | N |
- nij: Frequency for the combination of Xi and Yj.
- ni. (or ni⋅): Sum of frequencies for Xi (marginal total for X).
- n.j (or n⋅j): Sum of frequencies for Yj (marginal total for Y).
- N: 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 (xi) | Frequency (ni.) |
|---|---|
| x1 | n1. |
| x2 | n2. |
| ... | ... |
| xm | nm. |
| Total | N |
A marginal distribution for Y:
| Y (yj) | Frequency (n.j) |
|---|---|
| y1 | n.1 |
| y2 | n.2 |
| ... | ... |
| yk | n.k |
| Total | N |
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 Yj:
| X (xi) | Frequency (nij) |
|---|---|
| x1 | n1j |
| x2 | n2j |
| ... | ... |
| xm | nmj |
| Total | n.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 xi and yj, or centers of classes for continuous variables:
- Marginal mean of X: x=N1∑i=1mni.xi
- Marginal mean of Y: y=N1∑j=1kn.jyj
- Marginal variance of X: V(x)=N1∑i=1mni.(xi−x)2=N1∑i=1mni.xi2−x2
- Marginal variance of Y: V(y)=N1∑j=1kn.j(yj−y)2=N1∑j=1kn.jyj2−y2
3.3.2 Conditional means and variances
For the conditional distribution of X given Yj:
- Conditional mean of X given Yj: x∣Yj=n.j1∑i=1mnijxi
- Conditional variance of X given Yj: V(x∣Yj)=n.j1∑i=1mnij(xi−x∣Yj)2=n.j1∑i=1mnijxi2−x∣Yj2
Similarly, for the conditional distribution of Y given Xi:
- Conditional mean of Y given Xi: y∣Xi=ni.1∑j=1knijyj
- Conditional variance of Y given Xi: V(y∣Xi)=ni.1∑j=1knij(yj−y∣Xi)2=ni.1∑j=1knijyj2−y∣Xi2
3.4 Covariance
- Covariance: Measures the degree of joint variation between two variables.
The covariance formula is:
Cov(X,Y)=N1∑i=1m∑j=1knij(xi−x)(yj−y)
A computationally simpler form:
Cov(X,Y)=N1∑i=1m∑j=1knijxiyj−xy
🔑 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+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 (a): a=V(x)Cov(X,Y)
- Y-intercept (b): b=y−ax
🔑 Important: The regression line helps predict the value of Y for a given X.
3.6 Linear correlation coefficient
- Linear correlation coefficient (r): Measures the strength and direction of a linear relationship between two variables. It is unitless.
The formula for r is:
r=σXσYCov(X,Y)=V(x)V(y)Cov(X,Y)
Interpreting r:
-
Sign:
- r>0: Positive linear relationship (as X increases, Y tends to increase).
- r<0: Negative linear relationship (as X increases, Y tends to decrease).
- r=0: No linear relationship.
-
Magnitude (absolute value):
- ∣r∣ close to 1: Strong linear correlation.
- ∣r∣ close to 0: Weak or no linear correlation.
Interpretation Guide:
| Range of ∣r∣ | Strength of Correlation | | :------------- | :---------------------- | | 0≤∣r∣<0.40 | Weak or quasi-absent | | 0.40≤∣r∣<0.60 | Moderate | | 0.60≤∣r∣<0.80 | Good | | 0.80≤∣r∣≤1 | High |
🔑 Important: The correlation coefficient only describes linear relationships; a high r does not imply causation.