chap 3 moodle u

Table of contents

  1. Descriptive statistics: Tabular and graphical presentations
  2. Exploratory data analysis: Bivariate descriptive analyses
  3. Case 3: Quantitative x Qualitative
  4. Measures of Location
  5. Measures of Distribution Shape
  6. Detecting Outliers
  7. Measures of Variability
  8. Measures of Association Between Two Variables

1. Descriptive statistics: Tabular and graphical presentations

1.1 Summarizing qualitative data

This section covers methods for summarizing qualitative data, which represents categories or labels rather than numerical values. The primary tools for this are frequency distributions, bar graphs, and pie charts.

A frequency distribution is a table that organizes data by showing the count of items within distinct, non-overlapping categories. This helps reveal patterns that are not obvious from the raw data.

  • Relative frequency distribution: This table shows the proportion or fraction of the total data that falls into each category.
  • Percent frequency distribution: This table presents the relative frequency multiplied by 100, indicating the percentage of data in each category.

A bar graph is a visual representation of qualitative data. It uses bars of equal width, with their heights corresponding to the frequency, relative frequency, or percent frequency of each category.

The bars are separated to highlight that each category is distinct.

A pie chart is another graphical tool for displaying relative frequencies of qualitative data. A circle is divided into sectors, where each sector's size is proportional to the relative frequency of its corresponding category.

1.2 Holiday Inn guest ratings example

This example illustrates the creation of a frequency distribution for qualitative data using guest ratings of accommodations.

The ratings provided by 20 guests were: Below Average, Above Average, Above Average, Average, Above Average, Average, Above Average, Average, Above Average, Below Average, Poor, Excellent, Above Average, Average, Above Average, Above Average, Below Average, Poor, Above Average, Average.

RatingFrequency
Poor2
Below Average3
Average5
Above Average9
Excellent1

The total frequency is 20.

The relative and percent frequencies are calculated as follows:

RatingRelative FrequencyPercent Frequency
Poor0.1010%
Below Average0.1515%
Average0.2525%
Above Average0.4545%
Excellent0.055%
Total1.00100%

A bar graph visually represents these ratings, with bars for each category and heights indicating their frequency.

Distribution of the Moroccan population by age groups in thousands in 2019.

A pie chart further illustrates the distribution of ratings, showing the proportion of each rating category as a sector of a circle. For instance, "Above Average" accounts for 45% of the ratings.

1.3 Ring charts

Ring charts are an alternative graphical presentation for qualitative variables, similar in concept to pie charts but with a hole in the center.

1.4 Univariate descriptive analysis with Excel

Excel can be used for univariate descriptive analysis. For qualitative variables, pivot tables can be created by dragging the variable into the 'Rows' area and its count into the 'Values' area.

A pie chart can then be inserted to visualize this data.

1.5 Summarizing quantitative data

This section focuses on methods for summarizing quantitative data, which involves numerical values. The techniques include frequency distributions, histograms, and cumulative distributions.

A frequency distribution for quantitative data groups numerical values into mutually exclusive and collectively exhaustive classes. This allows for a structured overview of the data's spread.

Guidelines for selecting the number of classes include using between 5 and 20 classes, with more classes generally needed for larger datasets. The class width should be chosen to adequately represent the data's variation without having too few data points per class.

A common method is to use the square root of the number of data points to estimate the number of classes.

For example, if data ranges from 10 to 90 with 40 data points, the range is 80. The square root of 40 is approximately 6.34, suggesting 6 or 7 classes. A class width of approximately 14 (80/6) would be suitable, leading to intervals like 10-24, 25-39, and so on.

1.6 Auto repair parts cost example

This example demonstrates creating a frequency distribution for the cost of parts used in 50 engine tune-ups. The costs are rounded to the nearest dollar.

If six classes are chosen for the parts costs, ranging from $50 to $109, the distribution is as follows:

Parts Cost ($)Frequency
50-592
60-6913
70-7916
80-897
90-997
100-1095
Total50

The approximate class width is 10, calculated as (109 - 52) / 6 ≈ 9.5.

The relative and percent frequencies for these classes are:

Parts Cost ($)Relative FrequencyPercent Frequency
50-590.044%
60-690.2626%
70-790.3232%
80-890.1414%
90-990.1414%
100-1090.1010%
Total1.00100%

Insights from this distribution include that 4% of parts costs are in the $50-59 class, the largest percentage (32%) falls into the $70-79 class, 30% of costs are under $70, and 10% are $100 or more.

1.7 Histogram

A histogram is a graphical representation of quantitative data, specifically for continuous variables. It uses rectangles drawn above each class interval, with the height of each rectangle corresponding to the frequency, relative frequency, or percent frequency of that interval.

Unlike bar graphs, histograms have no gaps between adjacent rectangles, indicating the continuous nature of the data.

The histogram for the auto repair parts cost shows the frequency distribution visually.

A scatter plot showing a negative correlation between x and y, with a regression line indicating the trend.

Histograms can also illustrate the shape of the data distribution. A symmetric histogram has tails that are mirror images of each other, such as those often seen for human heights and weights.

1.8 Cumulative distributions

Cumulative distributions describe the total number, proportion, or percentage of data points that fall below a certain value.

  • Cumulative frequency distribution: This shows the total number of items with values less than or equal to the upper limit of each class.
  • Cumulative relative frequency distribution: This shows the proportion of items with values less than or equal to the upper limit of each class.
  • Cumulative percent frequency distribution: This shows the percentage of items with values less than or equal to the upper limit of each class.

For the auto repair parts cost example, the cumulative distributions are:

Cost ($)Cumulative FrequencyCumulative Relative FrequencyCumulative Percent Frequency
< 5920.044%
< 69150.3030%
< 79310.6262%
< 89380.7676%
< 99450.9090%
< 109501.00100%

2. Exploratory data analysis: Bivariate descriptive analyses

2.1 Introduction to bivariate analysis

Exploratory data analysis (EDA) uses simple arithmetic and visual tools to quickly summarize data. A common managerial interest lies in understanding the relationship between two variables.

Crosstabulation (contingency tables) and scatter diagrams are key methods for summarizing data for two variables simultaneously.

2.2 Quantitative vs. Quantitative variables

When analyzing the relationship between two quantitative variables, graphical tools like scatter plots and numerical tools such as covariance and correlation are employed.

2.3 Scatter diagram and trendline

A scatter diagram graphically presents the relationship between two quantitative variables, with one on the horizontal axis and the other on the vertical axis. The pattern of the plotted points indicates the overall relationship.

A trendline approximates this relationship.

  • Positive relationship: As one variable increases, the other tends to increase. A bar chart illustrating a symmetric distribution with zero skewness.
  • Negative relationship: As one variable increases, the other tends to decrease. A bar chart illustrating a moderately right-skewed distribution with a skewness value of 0.31.
  • No apparent relationship: There is no discernible pattern between the variables. A bar chart illustrating a moderately skewed left distribution with a negative skewness value of -0.31.

The scatter diagram can be created using software like Excel. Data points are plotted, and labels can be added to identify each observation.

A bar chart illustrating a highly skewed right distribution with a skewness value of 1.25.

2.4 Covariance and correlation

Covariance and correlation are numerical tools used to quantify the linear relationship between two quantitative variables, X and Y.

  • Covariance: Measures the extent to which two variables change together. Cov(X,Y)=∑i=1n(xi−xˉ)(yi−yˉ)/nCov(X,Y) = \sum_{i=1}^{n} (x_i - \bar{x})(y_i - \bar{y}) / n
  • Correlation coefficient (Pearson's r): Standardizes covariance to a range between -1 and 1, indicating the strength and direction of the linear relationship. Corr(X,Y) = \rho(X,Y) = Cov(X,Y) / (\sigma_X \sigma_Y) The correlation coefficient ρ(X,Y)\rho(X, Y) ranges from -1 to 1.

2.5 Qualitative vs. Qualitative variables

When analyzing the relationship between two qualitative variables, graphical tools like pie charts and numerical tools like contingency tables are used.

2.6 Contingency tables

A contingency table classifies observations according to two identifiable characteristics. It is used to study the relationship between two variables when one or both are qualitative.

The table below shows the relationship between gender and dessert ordered:

—Dessert Ordered: YesDessert Ordered: NoTotal
Male3268100
Female1585100
Total47153200

Contingency tables can be constructed and analyzed using tools like Excel's Pivot Tables.

A normal distribution curve showing percentages of data within standard deviations.

2.7 Mathematical notations for contingency tables

Contingency tables can be represented using mathematical notation to denote frequencies and marginal totals.

Consider a sample of 1000 Moroccans regarding smoking habits:

—Smoke: YesSmoke: NoMargin
Female16484n1.
Male165335n2.
Marginn.1n.2n
  • Row profiles: Show the distribution of one variable across the categories of the other variable for each row. For example, the row profile for females shows the percentage of females who smoke versus those who do not.

  • Female row profile: 3.2% smoke, 96.8% do not smoke.

  • Margin profile: 18.1% of the total sample smoke, and 81.9% do not smoke.

  • Column profiles: Show the distribution of one variable across the categories of the other variable for each column. For example, the column profile for smokers shows the percentage of smokers who are female versus male.

  • Smoke: Yes column profile: 8.8% are female, 91.2% are male.

3. Case 3: Quantitative x Qualitative

3.1 Graphical and numerical tools

This section introduces methods for analyzing the relationship between quantitative and qualitative variables. Graphical tools like box plots and numerical tools such as statistical comparison of means, specifically ANOVA, are highlighted.

A box plot, also known as a box-and-whisker plot, is a graphical method used to display the distribution of a dataset. It visually represents key statistical measures, including the median, quartiles, and potential outliers, making it effective for comparing the spread, skewness, and variability across different datasets.

  • The box in a box plot encompasses the interquartile range (IQR), which contains the central 50% of the data.
  • A line within the box indicates the median (50th percentile) of the data.
  • The left edge of the box represents the first quartile (Q1), or the 25th percentile.
  • The right edge of the box represents the third quartile (Q3), or the 75th percentile.
  • Whiskers extend from the box to show the range of the data, excluding outliers.
  • Outliers are individual data points that fall beyond the whiskers, indicating unusually high or low values.

3.2 Example: Comparing student grades

This example compares the distribution of grades between male and female students in a Data Analysis and Business (DAB) course using box plot principles.

Male students' grades: 78, 85, 90, 65, 88, 92, 75, 80, 82, 70, 95, 60 Female students' grades: 82, 77, 85, 91, 88, 79, 73, 87, 90, 69, 84, 76

The median score for females (83) is slightly higher than for males (81), suggesting females performed marginally better on average. The spread of scores, indicated by the distance between Q1 and Q3, is slightly wider for males (71.25 to 89) than for females (76.25 to 87.75), showing more variability in male scores.

Both groups have a similar overall range (male: 60 to 95, female: 69 to 91), but males exhibit a broader range of scores with higher variability. The female students' grades are less spread out and more tightly clustered around the middle values, indicating less variability.

Neither group has outliers.

📝 Comparing the spread of male and female grades shows that male scores are more variable, with a wider range from 60 to 95, while female scores are more clustered, ranging from 69 to 91.

3.3 Tabular and graphical methods for data analysis

Different types of data require specific tabular and graphical methods for analysis. Qualitative data is typically analyzed using frequency distributions, bar graphs, and pie charts.

Quantitative data uses histograms, cumulative frequency distributions, and scatter diagrams. Crosstabulation can be used for both types when examining relationships between variables.

Data TypeTabular MethodsGraphical Methods
Qualitative DataFrequency Distribution, Relative Frequency Distribution, Percent Frequency Distribution, CrosstabulationBar Graph, Pie Chart
Quantitative DataFrequency Distribution, Relative Frequency Distribution, Percent Frequency Distribution, Cumulative Frequency Distribution, Cumulative Relative Frequency Distribution, Cumulative Percent Frequency Distribution, CrosstabulationHistogram, Ogive, Scatter Diagram

4. Measures of Location

4.1 Sample statistics and population parameters

  • Sample statistics: These are measures computed from data within a sample.
  • Population parameters: These are measures computed from data within an entire population.
  • A sample statistic serves as a point estimator for its corresponding population parameter.

4.2 Mean

The mean of a data set is the arithmetic average of all its values. It is calculated by summing all observations and dividing by the total number of observations.

The sample mean is used as an estimator for the population mean.

4.3 Sample mean

The sample mean, denoted by xˉ\bar{x}, is calculated using the formula: xˉ=∑xin\bar{x} = \frac{\sum x_i}{n} where ∑xi\sum x_i is the sum of the values of the nn observations, and nn is the number of observations in the sample.

4.4 Population mean

The population mean, denoted by μ\mu, is calculated using the formula: μ=∑xiN\mu = \frac{\sum x_i}{N} where ∑xi\sum x_i is the sum of the values of the NN observations, and NN is the number of observations in the population.

4.5 Median

The median is the middle value in a data set when the data are arranged in ascending order. It is particularly useful when a data set contains extreme values (outliers) because it is not affected by them.

The median is frequently reported for data like annual income or property values, where a few very high values could significantly skew the mean.

  • For an odd number of observations, the median is the single middle value.
  • For an even number of observations, the median is the average of the two middle values.

Example: Consider the data set: 12, 14, 18, 19, 26, 27, 27. With 7 observations, the median is the 4th value, which is 19. Consider the data set: 12, 14, 18, 19, 26, 27, 27, 30. With 8 observations, the median is the average of the 4th and 5th values: (19+26)/2=22.5(19 + 26) / 2 = 22.5.

The median represents the point where half the data values are below it and half are above it. This makes it a robust measure of central tendency, especially for skewed distributions where the mean might be misleading.

For ordinal data, where values can be ranked but not precisely measured, the median is often the most appropriate measure of central tendency.

4.6 Mode

The mode of a data set is the value that occurs most frequently. A data set can have one mode (unimodal), two modes (bimodal), or more than two modes (multimodal).

  • The mode is especially useful for categorical data, as it identifies the most common category.
  • For nominal data, the mode is often the only meaningful measure of central tendency.

Example: In the data set: 425, 430, 430, 435, 435, 435, 435, 435, 440, 440, 440, 440, 440, 445, 445, 445, 445, 445, 450, 450, 450, 450, 450, 450, 450, 460, 460, 460, 465, 465, 465, 470, 470, 472, 475, 475, 475, 480, 480, 480, 480, 485, 490, 490, 490, 500, 500, 500, 500, 510, 510, 515, 525, 525, 525, 535, 549, 550, 570, 570, 575, 575, 580, 590, 600, 600, 600, 600, 615, 615, the value 450 occurs most frequently (7 times). Therefore, the mode is 450.

Example: Consider a survey of 100 students about their favorite social media platform:

  • WhatsApp: 40
  • Facebook: 30
  • Twitter: 20
  • Instagram: 10 The mode is "WhatsApp" because it is the most preferred platform among the respondents. This insight is valuable for targeted marketing and understanding consumer preferences.
MeasureDescriptionUse Case
MeanAverage of all data valuesSymmetrical data, not affected by outliers
MedianMiddle value in ordered dataSkewed data, data with outliers
ModeMost frequent valueCategorical data, identifying most common choice

5. Measures of Distribution Shape

5.1 Skewness

Skewness is a statistical measure that quantifies the asymmetry of a data distribution. It indicates whether the data is more concentrated on one side of the mean or the other, revealing the shape of the distribution's tails.

  • Symmetric distribution:
  • Skewness is zero.
  • The mean and median are equal.
  • Moderately skewed right:
  • Skewness is positive.
  • The mean is typically greater than the median.
  • The tail on the right side (higher values) is longer than the left side.
  • Most data points are concentrated on the left.
  • Example: Income distribution, where a few high earners pull the mean higher.
  • Moderately skewed left:
  • Skewness is negative.
  • The mean is typically less than the median.
  • The tail on the left side (lower values) is longer than the right side.
  • Most data points are concentrated on the right.
  • Example: Age at retirement, where most retire around a certain age, but some retire earlier.
  • Highly skewed right:
  • Skewness is positive, often above 1.0.
  • The mean is typically greater than the median.

Measuring skewness is important for data analysis, as it influences the choice of statistical measures (like using the median over the mean for skewed data) and the selection of appropriate statistical tests, many of which assume normality.

  • Skewness example: Income distribution in many countries is often positively skewed because a majority of the population earns lower incomes, while a small number of individuals earn very high incomes, creating a long tail on the right side of the distribution.

5.2 Kurtosis

Kurtosis is a statistical measure that describes the shape of a data distribution in terms of its peak and tails, relative to a normal distribution. It indicates the degree of "tailedness" and "peakedness."

  • Mesokurtic:
  • Kurtosis is approximately 3, or excess kurtosis is approximately 0.
  • The distribution has a moderate peak and tails, similar to a normal distribution.
  • Leptokurtic:
  • Kurtosis is greater than 3, or excess kurtosis is greater than 0.
  • The distribution has heavier tails and a sharper peak than a normal distribution.
  • This suggests a greater likelihood of extreme values or outliers.
  • Platykurtic:
  • Kurtosis is less than 3, or excess kurtosis is less than 0.
  • The distribution has lighter tails and a flatter peak compared to a normal distribution.
  • Data points are spread more evenly, indicating fewer outliers.

Kurtosis is important for identifying outliers, understanding how data deviates from normality, and analyzing tail behavior, which is crucial in fields like finance for assessing risks associated with extreme events.

  • Kurtosis example (Class A vs. Class B exam scores): Class A, with scores spread evenly and few extremes, exhibits a platykurtic distribution (Kurtosis ≈ 2). Class B, with most scores near the average but some very high and very low scores, shows a leptokurtic distribution (Kurtosis ≈ 5), indicating more extreme outcomes.

5.3 Z-Scores

A z-score, also known as a standardized value, measures how many standard deviations a particular data point is away from the mean of its dataset. It is a way to standardize observations, allowing for comparison across different distributions.

The formula for a z-score is: z=x−xˉsz = \frac{x - \bar{x}}{s} where:

  • xx is the individual data value

  • xˉ\bar{x} is the mean of the data

  • ss is the standard deviation of the data

  • A data value less than the sample mean will have a z-score less than zero.

  • A data value greater than the sample mean will have a z-score greater than zero.

  • A data value equal to the sample mean will have a z-score of zero.

  • Z-score example: A rent of 425 dollars, with a mean rent of 490.80 dollars and a standard deviation of 54.74 dollars, has a z-score of approximately -1.20, indicating it is about 1.20 standard deviations below the mean.

5.4 Empirical Rule

The Empirical Rule, also known as the 68-95-99.7 rule, applies to data that follows a bell-shaped (normal) distribution. It provides approximate percentages of data values that fall within certain ranges of standard deviations from the mean.

  • Approximately 68.26% of the data values lie within one standard deviation of the mean (μ±1σ\mu \pm 1\sigma).
  • Approximately 95.44% of the data values lie within two standard deviations of the mean (μ±2σ\mu \pm 2\sigma).
  • Approximately 99.72% of the data values lie within three standard deviations of the mean (μ±3σ\mu \pm 3\sigma).

The Empirical Rule is valuable for quick data analysis, identifying potential outliers (values beyond 3 standard deviations), and providing predictive insights into data distributions in various fields.

  • Empirical Rule example: If a stock's annual returns follow a normal distribution with a mean of 8% and a standard deviation of 5%, the Empirical Rule predicts that about 68% of returns will be between 3% and 13% (8% ± 5%), approximately 95% will be between -2% and 18% (8% ± 10%), and nearly all returns (99.7%) will be between -7% and 23% (8% ± 15%). This insight helps investors assess risk and volatility.

6. Detecting Outliers

6.1 Definition of an outlier

An outlier is defined as an unusually small or unusually large value within a dataset. These extreme values can significantly influence statistical analyses.

6.2 Identifying outliers using z-scores

A common method for detecting outliers involves calculating z-scores for each data point. A z-score measures how many standard deviations a particular data point is away from the mean.

  • Outlier criterion: A data value with a z-score less than -3 or greater than +3 is often considered a potential outlier.
  • Interpretation: Z-scores indicate the position of a data point relative to the mean. Values far from the mean (high absolute z-score) are candidates for outliers.

6.3 Possible causes of outliers

Outliers can arise from several sources, and understanding their origin is crucial for deciding how to handle them.

  • Incorrect data entry: A value may have been recorded erroneously.
  • Incorrect inclusion: A data point might have been mistakenly added to the dataset.
  • Legitimate extreme value: The data point may be correctly recorded and genuinely represent an extreme but valid observation within the population.

6.4 Example: Analyzing apartment rents

The provided data shows standardized values (z-scores) for apartment rents.

📝 Using the criterion ∣z∣>3|z| > 3 to identify outliers in the apartment rent data, we examine the list of z-scores. The most extreme z-scores observed are -1.20 and 2.27. Since neither of these values exceeds 3 in absolute magnitude, there are no outliers in this dataset according to this rule.

6.5 Strategies for handling outliers

Once outliers are identified, several strategies can be employed to manage their impact on data analysis.

  • Keep them: If outliers are confirmed to be legitimate and important observations, they should be retained in the dataset.
  • Transform the data: Applying data transformations (e.g., logarithmic transformation) can reduce the influence of outliers without removing them.
  • Remove them: If outliers are clearly errors (e.g., data entry mistakes), they may be removed from the dataset.
StrategyDescription
Keep themRetain legitimate extreme values.
Transform the dataReduce outlier impact without removal.
Remove themEliminate clear errors or incorrect inclusions.

7. Measures of Variability

7.1 Range

The range is the simplest measure of variability, calculated as the difference between the largest and smallest data values in a set. It is highly sensitive to extreme values, meaning a single outlier can significantly impact its value.

  • Calculation: Range = Largest value - Smallest value.
  • Sensitivity to outliers: While it highlights extreme values, the range may not accurately represent the variability of the majority of the data, especially in skewed distributions.
  • Limitation: It does not account for how data points are distributed between the minimum and maximum values.

📝 Given the data set {425, 430, 435,..., 600, 615}, the range is calculated as 615 - 425 = 190.

7.2 Variance

Variance is a measure of variability that considers all data points in a set. It is based on the squared differences between each observation and the mean.

  • Calculation: Variance is the average of the squared differences between each data value and the mean.
  • For a sample: s2=∑(xi−xˉ)2n−1s^2 = \frac{\sum (x_i - \bar{x})^2}{n-1}
  • For a population: σ2=∑(xi−μ)2N\sigma^2 = \frac{\sum (x_i - \mu)^2}{N}
  • Influence of outliers: Variance is heavily influenced by extreme values, which can inflate the measure and potentially misrepresent the typical variability.
  • Information limitation: It does not provide information about the shape of the distribution, such as symmetry or skewness.

7.3 Standard Deviation

The standard deviation is the positive square root of the variance and is measured in the same units as the data, making it more interpretable.

  • Calculation: The standard deviation is the square root of the variance.
  • For a sample: s=s2s = \sqrt{s^2}
  • For a population: σ=σ2\sigma = \sqrt{\sigma^2}
  • Comprehensive view: Like variance, it considers all data points, offering a comprehensive view of variability.
  • Interpretation: Its units match the data, facilitating easier understanding compared to variance.
  • Distribution shape: It does not provide information about the shape of the data distribution.

7.4 Coefficient of Variation

The coefficient of variation (CV) indicates the magnitude of the standard deviation relative to the mean, providing a standardized measure of variability.

  • Calculation: The CV is computed as the ratio of the standard deviation to the mean, multiplied by 100%.
  • For a sample: CV=sxˉ×100%CV = \frac{s}{\bar{x}} \times 100\%
  • For a population: CV=σμ×100%CV = \frac{\sigma}{\mu} \times 100\%
  • Comparison across datasets: The CV allows for the comparison of variability between datasets with different units or scales.
  • Risk assessment: In finance, it can help assess risk by comparing the volatility of different investments relative to their expected returns.
MeasureFormula (Sample)Formula (Population)Key Characteristic
RangeLargest value - Smallest valueLargest value - Smallest valueSimplest measure, highly sensitive to outliers
Variances2=∑(xi−xˉ)2n−1s^2 = \frac{\sum (x_i - \bar{x})^2}{n-1}σ2=∑(xi−μ)2N\sigma^2 = \frac{\sum (x_i - \mu)^2}{N}Average of squared differences from the mean, influenced by outliers
Standard Deviations=s2s = \sqrt{s^2}σ=σ2\sigma = \sqrt{\sigma^2}Positive square root of variance, same units as data
Coefficient of VariationCV=sxˉ×100%CV = \frac{s}{\bar{x}} \times 100\%CV=σμ×100%CV = \frac{\sigma}{\mu} \times 100\%Standardized measure, compares variability across datasets with different means

8. Measures of Association Between Two Variables

8.1 Covariance

The covariance is a statistical measure that quantifies the linear association between two variables. It indicates the direction of the relationship: positive values suggest that as one variable increases, the other tends to increase, while negative values indicate that as one variable increases, the other tends to decrease.

A covariance close to zero implies no linear relationship.

The sample covariance (SxyS_{xy}) is calculated using the formula: Sxy=∑i=1n(xi−xˉ)(yi−yˉ)n−1S_{xy} = \frac{\sum_{i=1}^{n} (x_i - \bar{x})(y_i - \bar{y})}{n-1} For populations, the formula uses NN in the denominator instead of n−1n-1.

A key limitation of covariance is its scale dependence. The magnitude of the covariance is influenced by the units of the variables, making it difficult to interpret the strength of the relationship without additional context.

For instance, changing the unit of measurement will alter the covariance value. Despite this, covariance is a foundational concept used in various statistical analyses, such as regression and portfolio theory.

8.2 Correlation Coefficient

The correlation coefficient is a standardized measure that quantifies the linear association between two variables, indicating both the direction and the strength of the relationship. It is crucial to remember that correlation does not imply causation; a strong correlation between two variables does not mean one causes the other.

The sample correlation coefficient (rxyr_{xy}) is computed as: rxy=SxySxSyr_{xy} = \frac{S_{xy}}{S_x S_y} where SxyS_{xy} is the sample covariance, and SxS_x and SyS_y are the sample standard deviations of the two variables.

The correlation coefficient ranges from -1 to +1.

  • Values near +1 indicate a strong positive linear relationship.
  • Values near -1 indicate a strong negative linear relationship.
  • Values near 0 suggest no linear relationship.

8.3 Types of Correlation

  • Positive Correlation: Both variables tend to increase or decrease together. For example, height and weight often exhibit a positive correlation.
  • Negative Correlation: As one variable increases, the other tends to decrease. An example is the relationship between study hours and leisure hours.
  • Zero Correlation: There is no apparent linear relationship between the two variables. Shoe size and intelligence are examples of variables likely to have zero correlation.

8.4 Advantages and Disadvantages of Correlation

FeatureAdvantagesDisadvantages
MeasureStandardized measure (-1 to +1), easy to interpret strength and direction.Pearson's correlation only measures linear relationships; non-linear relationships may be missed.
ApplicationUseful for prediction and predictive modeling.Correlation does not imply causation.
Data TypesApplicable to continuous and ordinal data.Can be significantly affected by outliers, distorting the perceived relationship.

8.5 Example: Golfer's Driving Distance and Score

A golfer is investigating the relationship between driving distance and their 18-hole score. The provided data includes average driving distance (in yards) and average 18-hole score for several rounds.

Average Driving Distance (yds.)Average 18-Hole Score
277.669
259.571
269.170
267.070
255.671
272.969

To analyze this, one would calculate the sample covariance and the sample correlation coefficient. The sample covariance is computed using the deviations of each data point from the respective means.

xy(xᵢ - x̄)(yᵢ - ȳ)(xᵢ - x̄)(yᵢ - ȳ)
277.66910.65-1.0-10.65
259.571-7.451.0-7.45
269.1702.1500
267.0700.0500
255.671-11.351.0-11.35
272.9695.95-1.0-5.95

The average driving distance is 267.0 yards, and the average 18-hole score is 70.0. The sum of the products of deviations is -35.40.

The sample covariance (SxyS_{xy}) is calculated as: Sxy=−35.406−1=−7.08S_{xy} = \frac{-35.40}{6-1} = -7.08

The sample correlation coefficient (rxyr_{xy}) is then calculated using the sample covariance and the standard deviations of driving distance (Sx=8.2192S_x = 8.2192) and score (Sy=0.8944S_y = 0.8944): rxy=−7.08(8.2192)(0.8944)≈−0.9631r_{xy} = \frac{-7.08}{(8.2192)(0.8944)} \approx -0.9631

📝 The calculated correlation coefficient of approximately -0.9631 indicates a strong negative linear relationship between driving distance and 18-hole score for this golfer. This suggests that as the golfer's driving distance increases, their 18-hole score tends to decrease.

8.6 Key Differences Between Covariance and Correlation

FeatureCovarianceCorrelation Coefficient
Range-∞ to +∞-1 to +1
UnitsDepends on the units of the variablesDimensionless (no units)
InterpretationShows the direction of the relationship (positive/negative)Shows both the direction and strength of the relationship
ScaleAffected by changes in scaleNot affected by changes in scale

© 2026 Maeve. All rights reserved. This content is protected by copyright.

See also