statistiques descriptives Cours DV
📚 statistiques descriptives_Cours DV (1).pptx
Brief overview
This document introduces the foundational concepts and methods of descriptive statistics. It provides tools for organizing, summarizing, and presenting data to understand its main characteristics. Mastering these techniques is essential for initial data exploration and informed decision-making.
Key points
- Overview of descriptive statistics, its objectives, and core terminology
- Techniques for organizing and visualizing single-variable data sets
- Calculation and interpretation of central tendency measures for single variables
- Application of dispersion measures and methods for class determination
- Methods for analyzing relationships between two quantitative variables
1. Introduction to descriptive statistics and terminology
1.1 Purpose and scope of descriptive statistics
Descriptive statistics provides methods to organize, summarize, describe, and visualize data. Its primary objectives include:
- Preparing data for further analysis.
- Comparing different datasets or groups.
Descriptive statistics bridges raw data and meaningful insights.
1.2 Statistics vs. The Discipline of Statistics
The terms "statistics" and "statistics" (the discipline) are distinct:
| Term | Description |
|---|---|
| Statistics (plural) | Numerical data points or measures derived from observations (e.g., means, percentages, indices). |
| Statistics (discipline) | The scientific field encompassing methods for collecting, analyzing, interpreting, and presenting data. |
1.3 Definition and application of statistics
Statistics is the discipline dedicated to the methods used to describe and analyze observations (data). It involves gathering numerical data from large groups, analyzing it, interpreting findings, and making informed decisions based on this analysis.
- Its applications are ubiquitous across:
- Industry (e.g., reliability, quality control)
- Economy and finance (e.g., surveys, marketing, insurance)
- Health and environment sectors
- Essentially any field where data is available.
1.4 The statistical process
The statistical process follows a structured methodology:
Data Collection → Statistical Analysis → Statistical Decision
- Data Collection: The initial, systematic gathering of data from various sources (questionnaires, interviews, existing records) for a specific purpose.
- Statistical Analysis: Organizing and structuring the collected data. This involves sorting, tabulating, and presenting data through charts or graphs.
- Statistical Decision: Drawing conclusions and defining actions based on the assimilated analysis of the data.
1.5 Core terminology
Understanding key terms is fundamental to descriptive statistics.
| Term | Definition |
|---|---|
| Population | The complete set of individuals or objects being studied for statistical analysis. |
| Sample | A subset selected from the population under consideration. |
| Individual/Unit | A single element belonging to a population or a sample. |
| Character/Variable | A property or characteristic observed within the population or sample. |
| Modality | A specific value that a variable can take. |
| Series (statistical) | The collection of observations or data points gathered. |
| Effectif (Count) | The number of individuals within a population or sample. Also, the count of individuals possessing a specific modality of a variable. |
| Frequency | The proportion of individuals possessing a specific modality, calculated as fi=ni/n. |
Population size is denoted by N, and sample size by n.
1.6 Types of statistical variables
Variables are classified based on the nature of their modalities.
| Variable Type | Modalities are... | Forms | Examples |
|---|---|---|---|
| Quantitative | Measurable or numerical. | Discrete (isolated values) | Number of children, number of rooms. |
| Continuous (interval) | Diameter of parts, salaries. | ||
| Qualitative | Non-measurable attributes or categories. | Ordinal (ordered categories) | Resistance, satisfaction levels. |
| Nominal (unordered categories) | Nationality, profession, marital status, color. |
1.7 Statistical series
A statistical series is the recorded set of observations.
- A simple series involves studying a population based on a single variable.
- A double series examines two variables simultaneously within the same population.
Example: The notes of 5 students (10, 12, 15, 12, 14) constitute a statistical series.
The components of a statistical series include:
- Effectif of a modality (ni): The number of individuals with a specific modality.
- Effectif of the population (n): The total number of individuals in the population (or sample), calculated as n=∑ni.
- Frequency (fi): The proportion of individuals with a specific modality, calculated as fi=ni/n.
🔑 Important: Mastering this core terminology is crucial for accurately interpreting and communicating statistical findings.
🔑 Important: The distinction between discrete and continuous quantitative variables, and ordinal and nominal qualitative variables, dictates the appropriate statistical methods to be used.
2. Descriptive statistics for single variable series: tables, graphs, and central tendency measures (part 1)
2.1 Statistical tables
Statistical tables are fundamental for organizing and presenting data from a statistical series, summarizing individuals based on the studied characteristic. The format of these tables is contingent upon the nature of the variable: qualitative, discrete quantitative, or continuous quantitative.
2.1.1 Qualitative variables
For qualitative variables, tables generally list the possible modalities and their corresponding frequencies or counts.
📝 Example: Distribution of nationalities of foreigners in Meknes: Italian, Spanish, French, German, Tunisian, Algerian, Portuguese.
2.1.2 Discrete quantitative variables
When dealing with discrete quantitative variables, tables typically display the possible values of the variable alongside their respective frequencies or counts.
📝 Example: Number of children per family: 0, 1, 2, 3.
2.1.3 Continuous quantitative variables
For continuous quantitative variables, modalities are represented as classes or intervals of values. These intervals must be mutually exclusive to ensure each individual is classified into only one class.
- Class bounds: Defined by lower and upper limits. The notation
[a; b[signifies that the lower boundais included, and the upper boundbis excluded. - Class center: Calculated as the average of the lower and upper bounds.
- Class amplitude: The difference between the upper and lower bounds.
The number of classes is generally recommended to be between 5 and 20 to effectively represent the data without excessive fragmentation or oversimplification.
2.1.4 Cumulative frequencies
Cumulative frequencies provide a running total of frequencies.
- Cumulative frequency (increasing) (ECC): The sum of the frequencies for a given value and all preceding values. It indicates the total number of observations less than or equal to a certain value. The final ECC must equal the total sample size (N).
- Cumulative frequency (decreasing) (ECD): The sum of the frequencies for a given value and all succeeding values. It indicates the total number of observations greater than or equal to a certain value. The first ECD must equal the total sample size (N).
🔑 Important: Calculating cumulative frequencies requires data to be ordered, typically in ascending order for ECC and descending order for ECD.
2.2 Graphical representations
Graphical representations offer a visual synthesis of statistical data, complementing tables by simplifying raw data into easily interpretable charts. The choice of graph is dictated by the nature and type of the variable under study.
2.2.1 Qualitative variables
Distributions of qualitative variables are commonly visualized using:
- Circular diagrams (pie charts): Composed of a circle divided into sectors. The central angles of these sectors are directly proportional to the frequencies or percentages of each modality.
- Bar charts (or pipe organ diagrams): Utilise bars of equal width where the height (or length) of each bar is proportional to the frequency or count of the corresponding modality.
🔑 Important: Both circular diagrams and bar charts are suitable for nominal and ordinal qualitative data, providing a clear comparison of proportions.
3. Descriptive statistics for single variable series: tables, graphs, and central tendency measures (part 2)
3.1 Graphical representations
Graphical representations are crucial for visualizing the distribution of data. The choice of graph depends on the type of variable.
3.1.1 Qualitative variables
For qualitative variables, graphical representations help illustrate the frequency or proportion of each category.
- Circular diagrams (or pie charts): Represent proportions of a whole as sectors of a circle.
- Semi-circular diagrams: Similar to circular diagrams but use a half-circle.
- Organ pipe diagrams (bar charts): Rectangles are drawn for each modality, with height proportional to the modality's frequency or count. The base of each rectangle represents a category.
The core idea is to visually partition categories based on their prevalence.
3.1.2 Discrete quantitative variables
Discrete quantitative variables can be depicted using bar charts and cumulative curves.
- Bar charts: For each distinct value of the variable, a vertical line or bar is drawn, with its height corresponding to the frequency or count of that value.
- Cumulative curves: These graphs represent cumulative frequencies or counts.
- The y-axis displays the cumulative frequency (ECC/ECD) or cumulative frequency (FCC/FCD).
- The x-axis displays the variable's values (xi).
- For each modality (xi), a point is plotted corresponding to its cumulative frequency (Fi). Straight lines connect these points, often representing intervals.
3.1.3 Continuous quantitative variables
Continuous quantitative variables are typically represented using histograms and frequency polygons.
- Histograms: These are composed of adjacent rectangles.
- The base of each rectangle represents the class interval.
- The height of each rectangle is adjusted such that the area of the rectangle is proportional to the frequency or count of that class.
- Histograms with equal class amplitude: In this simplified case, the height of each rectangle is directly proportional to the frequency or count of the class.
- Histograms with unequal class amplitude: The height of rectangles is proportional to corrected frequencies or counts. This correction accounts for varying class widths, ensuring areas accurately reflect proportions. The correction typically involves dividing the frequency/count by the class amplitude.
Area in a histogram represents frequency; this is key for unequal amplitudes.
- Frequency polygons: These are formed by connecting the midpoints of the upper sides of the histogram's rectangles.
- To complete the polygon, it's extended to the x-axis by connecting to points representing the midpoints of two hypothetical adjacent classes (with zero frequency) at each end.
- Polygon of cumulative frequencies: Formed by connecting points where the x-axis represents the upper bound of each class and the y-axis represents the cumulative frequency.
- Polygon of cumulative frequencies (decreasing): Formed by connecting points where the x-axis represents the lower bound of each class and the y-axis represents the cumulative frequency.
- Cumulative representations are unaffected by equal or unequal class amplitudes.
3.1.4 Cumulative curves
Cumulative curves provide insight into the total proportion of data below a certain value.
- Cumulative frequency polygon (increasing): Connects points where the x-axis is the upper bound of a class and the y-axis is the cumulative frequency of that class.
- Cumulative frequency polygon (decreasing): Connects points where the x-axis is the lower bound of a class and the y-axis is the cumulative frequency up to (but not including) that lower bound.
Cumulative curves offer a continuous view of data accumulation.
| Graph Type | Variable Type | Key Feature |
|---|---|---|
| Circular Diagram | Qualitative | Sectors represent proportions of a whole. |
| Organ Pipe Diagram | Qualitative | Rectangles proportional to modality frequency/count. |
| Bar Chart | Quantitative Discrete | Bars proportional to value frequency/count. |
| Histogram | Quantitative Continuous | Rectangle areas proportional to class frequency/count. |
| Frequency Polygon | Quantitative Continuous | Connects midpoints of histogram tops. |
| Cumulative Curve | Any | Plots cumulative frequencies against variable values/bounds. |
The choice of graph aligns with variable type: categories (qualitative), distinct values (discrete), or ranges (continuous).
3.2 Measures of central tendency
Measures of central tendency, also known as measures of position, aim to summarize a dataset by identifying a "typical" or central value around which the data tend to cluster.
- Purpose: To represent the central location of a distribution.
- Limitations: They do not describe the spread or dispersion of the data.
- Key Measures: Mode, mean, median, and quantiles (such as quartiles).
Central tendency measures condense data into a single representative value.
3.2.1 Mode
- Definition: The value or modality that appears most frequently in a dataset.
- Applicability: Can be used for qualitative, discrete, and continuous variables (though for continuous variables, it's typically the midpoint of the modal class).
- Characteristics:
- The only measure of central tendency applicable to nominal qualitative variables.
- A dataset can have one mode (unimodal), two modes (bimodal), or more (multimodal).
3.2.2 Mean
The mean represents the arithmetic average of a dataset. Various forms exist to accommodate different data characteristics.
- Arithmetic Mean:
- Formula: xˉ=n∑i=1nxi
- Usage: Standard average, sensitive to outliers. Applicable to quantitative variables.
- Geometric Mean:
- Formula: G=nx1⋅x2⋅…⋅xn (for positive values)
- Usage: Used for averaging rates of change or growth factors.
- Harmonic Mean:
- Formula: H=∑i=1nxi1n
- Usage: Used for averaging rates or ratios when the numerator is constant.
- Quadratic Mean (Root Mean Square):
- Formula: Q=n∑i=1nxi2
- Usage: Used when deviations from zero are important, such as in electrical engineering or physics.
The choice of mean (arithmetic, geometric, harmonic, quadratic) depends on the nature of the data and the phenomenon being measured.
3.2.3 Median
- Definition: The middle value of a dataset when it is ordered from least to greatest.
- Calculation:
- For an odd number of observations (n), the median is the value at position 2n+1.
- For an even number of observations (n), the median is typically the average of the two middle values at positions 2n and 2n+1.
- Applicability: Applicable to ordinal and quantitative variables.
- Characteristics: Robust to outliers, unlike the arithmetic mean.
3.2.4 Quantiles
Quantiles divide the ordered dataset into equal parts.
- Quartiles: Divide the data into four equal parts.
- Q1 (First Quartile): The median of the lower half of the data (25th percentile).
- Q2 (Second Quartile): The median of the entire dataset (50th percentile).
- Q3 (Third Quartile): The median of the upper half of the data (75th percentile).
- The Interquartile Range (IQR=Q3−Q1) is a measure of spread.
- Deciles: Divide the data into ten equal parts.
- Percentiles: Divide the data into one hundred equal parts. The k-th percentile (Pk) is the value below which k percent of the data falls.
Quantiles provide specific positional markers within the data distribution.
Measures of central tendency offer different perspectives on data centrality: the mode for frequency, the mean for average value, the median for ordered position, and quantiles for specific distributional splits.
4. Descriptive statistics for single variable series: tables, graphs, and central tendency measures (part 3)
4.1 The mode
- Mode: The value that appears most frequently in a dataset. It is applicable to both qualitative and quantitative variables.
- A distribution can be unimodal (one mode), bimodal (two modes), or multimodal (more than two modes).
📝 Example: For the series
0, 2, 3, 5, 2, 4, 4, 6, 6, 2, 2, the mode is2as it appears four times, more than any other value.
-
Continuous variables: When a continuous variable is grouped into classes:
- For classes of equal width, the modal class has the highest frequency.
- For classes of unequal width, the modal class is the one with the highest density. Density is calculated as density=class widthfrequency.
-
Analytical calculation of mode (for grouped continuous data): The mode (Mo) can be estimated using the formula: Mo=Lmo+(Δ1+Δ2Δ1)×w Where:
- Lmo: Lower bound of the modal class.
- Δ1: Frequency of the modal class minus the frequency of the preceding class.
- Δ2: Frequency of the modal class minus the frequency of the succeeding class.
- w: Width of the modal class.
-
Graphical calculation of mode: The mode is the x-axis value at the intersection of two specific diagonals. These diagonals connect:
- The top-right corner of the modal class to the top-right corner of the adjacent left class.
- The top-left corner of the modal class to the top-left corner of the adjacent right class.
-
Properties of the mode:
- Pros: Easy to determine, has immediate interpretation.
- Cons: Not precise for continuous data, sensitive to class grouping, difficult for algebraic manipulation.
4.2 The arithmetic mean
-
Arithmetic Mean: The most common measure of central tendency, representing an equal distribution of the total value across all observations. It is conceptually tied to additive quantities.
-
Calculation: The mean (xˉ) is the sum of all values divided by the total number of observations (n). xˉ=n∑i=1kxini=∑i=1kxifi Where:
- xi: The distinct values in the series.
- ni: The frequency of value xi.
- n: The total number of observations (∑ni).
- k: The number of distinct values.
- fi: The relative frequency of value xi (ni/n).
🔑 Important: The mean is calculated as a weighted average where values are weighted by their frequencies or relative frequencies.
-
Properties of the arithmetic mean:
- Linearity: If a variable X is transformed linearly into Y=aX+b, then the mean of Y is yˉ=axˉ+b. This property simplifies calculations when dealing with transformed data.
-
Calculation via change of variable: This method simplifies computations when dealing with large values or wide ranges.
- Define a new variable X′ using a change of origin (X0) and a change of scale (a): xi′=axi−X0.
- X0 is often chosen near the mode or median.
- a is typically the greatest common divisor of the differences (xi−X0).
- Calculate the mean of the transformed variable (x′ˉ).
- Transform the mean of X′ back to the original scale: xˉ=ax′ˉ+X0.
Variable Transformation Example X Original variable e.g., Age X′ Transformed variable e.g., Age - 30 / 5 X0 Change of origin e.g., 30 a Change of scale e.g., 5 - Define a new variable X′ using a change of origin (X0) and a change of scale (a): xi′=axi−X0.
📝 Example: For a dataset with values 10,15,20,25,30, choosing X0=20 and a=5, the transformed values are −1,0,1,2,3. If x′ˉ=1, then xˉ=5×1+20=25.
🔑 Important: Using a change of variable reduces the magnitude of numbers involved, making calculations for the mean more manageable and less prone to arithmetic errors.
4.3 Other means (brief mention)
While the arithmetic mean is dominant, other means exist for specific applications:
| Mean Type | Formula/Concept | Applicability/Context |
|---|---|---|
| Geometric Mean | nx1x2…xn (for positive values) | Averaging rates of change, growth rates, multiplicative processes. |
| Harmonic Mean | ∑i=1nxi1n (for positive values) | Averaging ratios where the numerator is constant (e.g., speeds). |
| Quadratic Mean | n∑xi2 | Measures dispersion, related to standard deviation. |
🔑 Important: The choice of mean depends critically on the nature of the data and the phenomenon being analyzed; the arithmetic mean is suitable for additive phenomena, while others are used for multiplicative or ratio-based contexts.
5. Descriptive statistics for single variable series: tables, graphs, and central tendency measures (part 4)
5.1 Measures of central tendency: advanced means
-
Geometric mean (G): Used for multiplicative phenomena like growth rates or interest rates. It calculates the average rate of change over time.
- Formula: G=nx1⋅x2⋅…⋅xn or G=(∏i=1nxi)n1
- Application: Averaging annual growth rates.
- Property: Always less than or equal to the arithmetic mean.
-
Harmonic mean (H): Employed when dealing with rates or ratios expressed as a unit per another unit (e.g., km/h, dollars/kg). It's useful for inverse proportionality.
- Formula: H=∑i=1nxi1n
- Application: Calculating average speeds over equal distances or average prices per unit.
-
Quadratic mean (RMS - Root Mean Square): Used when the sign of values is important, or to average deviations without negative numbers. It's common in phenomena with alternating positive and negative values, such as in electricity.
- Formula: RMS=n1∑i=1nxi2
- Application: Calculating the magnitude of oscillating electrical currents or averaging deviations.
-
Relationship between means: For a given distribution, the means are ordered as follows:
Harmonic Mean ≤ Geometric Mean ≤ Arithmetic Mean ≤ Quadratic Mean
5.2 The Median: defining the midpoint
- Median (Me): The value that divides a dataset, ordered by magnitude, into two equal halves. 50% of observations are less than or equal to the median, and 50% are greater than or equal to it.
- Mathematically: F(Me)=0.5 and N(Me)=N/2.
- Applicability: Applicable only to quantitative variables (discrete or continuous).
5.2.1 Calculating the median for discrete data
-
Procedure:
- Order the data from smallest to largest.
- Identify the middle value(s).
-
Odd number of observations (N):
- The median is the single value at the central position.
- Central position: 2N+1
-
📝 Example: For N=9, the median is the 29+1=5th value.
-
Even number of observations (N):
- The median is the average of the two central values.
- Central positions: 2N and 2N+1
-
📝 Example: For N=10, the median is the average of the 210=5th and 210+1=6th values.
5.2.2 Calculating the median for continuous data
-
Procedure: Involves linear interpolation within the median class.
- Median Class: The interval containing the median, where the cumulative frequency first reaches or exceeds 0.5.
- Formula for interpolation:
Me=ei+F(ei+1)−F(ei)0.5−F(ei)×(ei+1−ei) Where:
- ei and ei+1 are the lower and upper bounds of the median class.
- F(ei) and F(ei+1) are the cumulative frequencies at ei and ei+1 respectively.
- F(ei)<0.5 and F(ei+1)≥0.5.
-
Graphical Determination:
- Plot cumulative frequency curves (both increasing and decreasing).
- The median is the value on the x-axis corresponding to the intersection point where the cumulative frequency is 0.5 (or 50%).
5.3 Quantiles: generalizing the median
- Quantile (xa): A value below which a proportion 'a' of the observations fall. F(xa)=a.
5.3.1 Types of quantiles
-
Quartiles: Divide the data into four equal parts.
- Q1: Quantile of order 0.25 (F(Q1)=0.25).
- Q2: Quantile of order 0.5 (F(Q2)=0.5). This is equivalent to the median.
- Q3: Quantile of order 0.75 (F(Q3)=0.75).
-
Deciles: Divide the data into ten equal parts.
- Dk: Quantile of order 0.1k for k=1,2,…,9.
- Example: D1 has F(D1)=0.1.
-
Percentiles (Centiles): Divide the data into one hundred equal parts.
- Ck: Quantile of order 0.01k for k=1,2,…,99.
- Example: C1 has F(C1)=0.01.
🔑 Important: Quantiles provide a more granular understanding of data distribution beyond just the central point, offering insights into spread and concentration.
6. Dispersion measures and class determination
6.1 Measures of dispersion
Measures of dispersion quantify the variability within a dataset, indicating how spread out the observed values are relative to a central tendency measure. High dispersion signifies values far from the center, suggesting less representativeness of the central value for the entire population.
Conversely, low dispersion indicates values clustered near the center, implying greater homogeneity and representativeness.
| Measure | Formula | Description |
|---|---|---|
| Variance | s2=N∑i=1N(xi−xˉ)2 | Average of the squared differences between each data point and the mean. |
| Standard deviation | s=s2 | The square root of the variance, measuring the typical deviation of data points from the mean. Its unit matches the data. |
| Range | E=Xmax−Xmin | The difference between the highest and lowest values in a dataset, indicating the total spread. |
| Coefficient of variation (CV) | CV=xˉs | The ratio of the standard deviation to the mean, expressed as a percentage. It standardizes dispersion for comparison. |
6.1.1 Variance and standard deviation
-
Variance: Represents the average of the squared deviations from the mean.
-
Standard deviation: The square root of the variance. It is expressed in the same units as the original data, making it more interpretable than variance.
A low standard deviation indicates data points are clustered closely around the mean, suggesting a homogeneous population.
A high standard deviation signifies data points are spread widely around the mean, indicating a heterogeneous population.
Standard deviation can be used to delineate parts of a population, defining those closest to (most representative) and farthest from the central tendencies.
📝 Example: Data: 2, 4, 6 Mean (xˉ) = 4 Squared deviations: (2−4)2=4, (4−4)2=0, (6−4)2=4 Variance (s2) = (4+0+4)/3=2.67 Standard deviation (s) ≈1.63
6.1.2 Range
-
Range: A simple measure of dispersion, calculated as the difference between the maximum (Xmax) and minimum (Xmin) values in a dataset.
📝 Example: For notes: 2, 15, 8, 16, 8, 11, 18 Range (E) = 18 - 2 = 16 Interpretation: The maximum difference between any two scores is 16.
6.1.3 Coefficient of variation
-
Coefficient of variation (CV): A standardized measure of dispersion, expressed as a percentage. It is particularly useful for comparing the variability of datasets with different units or means.
Formula: CV=xˉs A higher CV indicates greater relative dispersion.
| Measure | Unit | Comparability Across Datasets |
|---|---|---|
| Standard Deviation | Same as data | Limited |
| Coefficient of Variation | Unitless (%) | High |
6.2 Class determination for continuous data
When analyzing continuous quantitative data, it is often beneficial to group values into classes (intervals) to simplify interpretation.
6.2.1 The square root method for class determination
This method provides a straightforward approach to determine the number of classes and their characteristics.
| Step | Description | Formula/Guideline |
|---|---|---|
| 1 | Number of observations (N) | Count the total number of data points. |
| 2 | Number of classes (k) | Calculate k=N, then round to the nearest integer. |
| 3 | Range (E) | Calculate E=Xmax−Xmin. |
| 4 | Class amplitude (h) | Calculate h=kE, then round to a simple value (e.g., 2, 5, 10). |
| 5 | Construction of classes | Form intervals of the form [a;a+h[. The lower bound is inclusive, and the upper bound is exclusive. |
| 6 | Counting frequencies | Tally the number of observations falling into each class. |
| 7 | Calculating frequencies (relative) | Divide the frequency of each class by the total number of observations (N) to get the proportion or percentage. |
📝 Application Exercise Steps: Data: {12, 15, 14, 13, 16, 18, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27}
- Step 1: N=16 observations.
- Step 2: k=16=4 classes.
- Step 3: Xmax=27, Xmin=12. Range (E) = 27−12=15.
- Step 4: Class amplitude (h) = 415=3.75. Rounded to a simple value, h=4.
- Step 5: Classes: [12; 16[, [16; 20[, [20; 24[, [24; 28[.
- Step 6: Count observations within each class.
- Step 7: Calculate relative frequencies.
🔑 Important: The choice of class determination method impacts the appearance and interpretation of the data distribution; the square root method is a common, simple heuristic.
🔑 Important: Measures of dispersion are crucial for understanding the reliability and representativeness of central tendency values, and for comparing different datasets.
7. Bivariate analysis: quantitative variables
7.1 Introduction to bivariate analysis
Bivariate analysis investigates relationships between two observed statistical variables within a population.
📝 Example: Height and weight of individuals, hours of study and exam scores.
The primary goals of bivariate analysis are:
- To understand the nature of the relationship between two variables.
- To quantify the strength and direction of the relationship using correlation.
- To build predictive models using regression.
- To visualize the relationship with scatter plots.
Relationships between two variables (X and Y) can range from:
- Total independence (zero association).
- Total dependence (functional relationship).
Possible relationship types include:
- Positive relation: As X increases, Y increases.
- Negative relation: As X increases, Y decreases.
- No relation: Variables are independent.
7.2 Analysis of two quantitative variables
This section focuses on studying the mathematical relationship between two numerically measurable variables. Key questions include understanding how Y changes with X and the ability to predict Y from X.
7.2.1 Scatter plots
A scatter plot is a graphical tool to visualize the relationship between two quantitative variables, where each individual is represented by a point (X,Y) in a plane (X on the horizontal axis, Y on the vertical axis).
Visual interpretation of scatter plots reveals:
| Trend Type | Visual Description | Relationship Type | Example |
|---|---|---|---|
| Growing trend | Points ascend towards the right | Positive correlation | Hours of study vs. exam score |
| Decreasing trend | Points descend towards the right | Negative correlation | Speed vs. travel time |
| No trend | Points dispersed randomly | Independence | |
| Non-linear relation | Points form a curve | Non-linear relationship |
7.2.2 Covariance
The covariance measures how two quantitative variables vary together, indicating whether they tend to change in the same or opposite directions.
| Covariance Value | Relationship Indicated |
|---|---|
| Cov > 0 | Positive relation |
| Cov < 0 | Negative relation |
| Cov = 0 | No relation |
7.2.3 Pearson correlation coefficient
The Pearson correlation coefficient (r) quantifies the strength and direction of the linear relationship between two quantitative variables.
The formula for the Pearson correlation coefficient is: r=∑i=1n(xi−xˉ)2∑i=1n(yi−yˉ)2∑i=1n(xi−xˉ)(yi−yˉ)
Interpretation of the Pearson correlation coefficient (r):
- r=1: Perfect positive linear correlation.
- r=−1: Perfect negative linear correlation.
- r=0: No linear correlation.
The absolute value of r indicates the strength of the linear relationship:
- Values closer to 1 (or -1) indicate a stronger linear relationship.
- Values closer to 0 indicate a weaker linear relationship.
📝 Example: If hours of sport per week increase and weight also increases, this suggests a positive correlation. If hours of sleep increase and fatigue decreases, this suggests a negative correlation.
7.2.4 Simple linear regression
Simple linear regression models the relationship between two variables: an independent (explanatory) variable (x) and a dependent (to be explained) variable (y).
This method serves to:
- Explain the relationship between variables.
- Make predictions.
The model equation is y=ax+b, where a and b are coefficients. The formulas for these coefficients are derived to minimize the sum of squared errors between observed and predicted values.
🔑 Important: While covariance indicates the direction of a relationship, Pearson's r is preferred for assessing its linear strength and direction, and regression is used for modeling and prediction.
8. Bivariate analysis: qualitative and mixed variable types
8.1 Analysis of two qualitative variables
Bivariate analysis involving two qualitative variables aims to assess the dependency or relationship between them. This is achieved by examining how the categories of one variable are distributed across the categories of the other.
8.1.1 Contingency tables
A contingency table (or cross-tabulation table) is the primary tool for visualizing and analyzing the relationship between two qualitative variables.
- Rows represent the categories of one variable.
- Columns represent the categories of the other variable.
8.1.2 Frequency and percentage calculations
Analysis of contingency tables involves calculating various frequencies and percentages to reveal trends and relationships.
- Absolute frequencies: The raw count of observations falling into each cell of the table.
- Global percentages: Frequencies expressed as a proportion of the total sample size. This provides an overall distribution.
- Conditional percentages (row or column percentages): These are crucial for understanding dependency. They express frequencies as a proportion of the total for a specific row or column.
- Row percentages: Compare the distribution of the column variable within each category of the row variable. This answers questions like, "Among individuals in Category A, what proportion belong to Subcategory X?"
- Column percentages: Compare the distribution of the row variable within each category of the column variable. This answers, "Among individuals in Subcategory X, what proportion belong to Category A?"
8.1.3 Interpretation of conditional percentages
Comparing conditional percentages is key to identifying whether the variables are associated.
- If the proportions of one variable's categories differ significantly across the categories of the other variable, it suggests a relationship exists.
- For instance, if the percentage of "success" is substantially higher for one gender compared to another, it indicates a dependency between gender and success.
🔑 Important: Conditional percentages calculated by row (or column) are the most insightful for determining the dependence between two qualitative variables.
8.2 Analysis of mixed variable types (one qualitative, one quantitative)
When one variable is qualitative and the other is quantitative, the objective is typically to compare the quantitative measure across different groups defined by the qualitative variable.
- Qualitative variable: Defines the groups or categories.
- Quantitative variable: The measure being compared across these groups.
8.2.1 Objective of mixed variable analysis
The core goal is to ascertain if the average or distribution of the quantitative variable differs significantly between the groups formed by the qualitative variable.
🔑 Important: This type of analysis answers questions like, "Does the average salary differ by educational attainment?" or "Is there a difference in test scores between students using different learning methods?"
8.2.2 Tools for mixed variable analysis
The choice of statistical tool depends on the number of categories in the qualitative variable.
- Two categories in the qualitative variable: The most common scenario is comparing the means of a quantitative variable between two groups.
- Student's t-test: This statistical test is used to determine if the difference between the means of two groups is statistically significant. It helps ascertain if an observed difference is likely due to a real effect or merely random sampling variation.
📝 Example: Comparing the average height of males versus females.
- More than two categories in the qualitative variable: While not detailed here, Analysis of Variance (ANOVA) is the typical extension for comparing means across three or more groups.
8.2.3 The Student's t-test
The Student's t-test is a parametric inferential statistic used to assess if there is a significant difference between the means of two independent groups.
- It assumes that the quantitative variable is approximately normally distributed within each group and that the variances of the two groups are roughly equal (though variations exist for unequal variances).
- The test yields a p-value, which indicates the probability of observing the data (or more extreme data) if there were no actual difference between the group means. A small p-value (typically < 0.05) leads to rejecting the null hypothesis of no difference.
🔑 Important: The t-test is a foundational tool for detecting mean differences between two groups, crucial for identifying potential relationships when one variable categorizes the population and the other is a continuous measure.
© 2026 Maeve. All rights reserved. This content is protected by copyright.