StatisticsUnit 610 min read

Correlation: Scatter Diagrams, Karl Pearson's and Spearman's Coefficients

Unit 6 of Statistics: covers the study of the relationship between two variables, focusing on the direction and strength of their association using graphical and mathematical methods.

Key points

  • Correlation measures the degree of linear relationship between two quantitative variables.
  • Scatter diagrams provide a visual representation of the relationship before calculation.
  • Karl Pearson's coefficient is used for quantitative data with a linear relationship.
  • Spearman's Rank correlation is used for qualitative data or non-linear monotonic relationships.
  • The correlation coefficient \( r \) always ranges between \(-1\) and \(+1\).
  • Correlation does not imply causation; it only shows a statistical association.

Introduction to Correlation

In the hospitality industry, managers often need to understand how one factor affects another. For example, does increasing the advertising budget lead to more room bookings? Does the temperature outside affect the sale of cold beverages in a hotel restaurant? This study of the relationship between two variables is called Correlation.

Definition: Correlation is a statistical tool that describes the strength and direction of the relationship between two variables. If two variables move together (either in the same or opposite direction), they are said to be correlated.

Types of Correlation

Correlation can be classified based on direction and number of variables:

  1. Positive Correlation: When both variables move in the same direction. (e.g., As the number of guests increases, the total food revenue increases).
  2. Negative Correlation: When variables move in opposite directions. (e.g., As the price of a luxury suite increases, the number of bookings may decrease).
  3. Zero Correlation: When there is no linear relationship between variables. (e.g., The shoe size of a guest and their room service spending).

Scatter Diagram

A scatter diagram is a graphical representation of the relationship between two variables. The independent variable is usually plotted on the X-axis and the dependent variable on the Y-axis.

123456510152025xyPerfect Positive (r = 1)Perfect Negative (r = -1)Zero Correlation (r ≈ 0)
Three scatter plot types demonstrating perfect positive, perfect negative, and zero correlation
  • Upward slope: Indicates positive correlation.
  • Downward slope: Indicates negative correlation.
  • Random dots: Indicates zero correlation.

Karl Pearson's Coefficient of Correlation

Karl Pearson's coefficient, denoted by , is the most widely used measure of linear correlation. It measures the strength and direction of the linear relationship between two quantitative variables.

-4-3-2-11234-4-3-2-11234xyy = x (r = 1)
Linear relationship where Pearson's r = 1 (perfect positive correlation)

Formula

The formula for the correlation coefficient is:

Alternatively, the computational formula is:

Where:

  • = Number of pairs of observations
  • = Sum of the product of x and y
  • = Sum of x and y values respectively
  • = Sum of squares of x and y values

Interpretation of

Value of Interpretation
Perfect Positive Correlation
to High Positive Correlation
to Moderate Positive Correlation
to Low Positive Correlation
No Correlation
to Low Negative Correlation
to Moderate Negative Correlation
to High Negative Correlation
Perfect Negative Correlation

Worked Example 1: Hotel Staffing and Guest Satisfaction

A hotel manager wants to see if there is a correlation between the number of staff members on a shift () and the guest satisfaction score () out of 10.

02.557.510Shift 16Shift 28Shift 39Shift 48Shift 510Guest Satisfaction Score (out of 10)
Bar chart of guest satisfaction scores for each shift (corresponding to staff count in the worked example)

Data:

Shift Staff () Score ()
1 5 6
2 8 8
3 10 9
4 12 8
5 15 10

Step-by-step Calculation:

  1. Create a calculation table:
5 6 25 36 30
8 8 64 64 64
10 9 100 81 90
12 8 144 64 96
15 10 225 100 150
  1. Apply the formula:

Conclusion: There is a high positive correlation () between the number of staff and guest satisfaction.

46810121416567891011Staff vs Satisfaction
Scatter plot showing high positive correlation (r ≈ 0.885) between staff count and guest satisfaction

Spearman's Rank Correlation Coefficient

When data is qualitative (e.g., beauty, honesty, taste) or when the relationship is not linear, we use Spearman's Rank Correlation ().

123456123456xyInverse ranks (r_s = -1)
Monotonic relationship where Spearman's r_s = -1 (perfect negative rank correlation)

Formula

Where:

  • = Difference between the ranks of the two variables ()
  • = Number of pairs of observations

Worked Example 2: Taste and Presentation

Two judges rank 5 dishes based on Taste () and Presentation ().

0123456Dish A (Rank X=1, Y=2)Dish B (Rank X=2, Y=1)Dish C (Rank X=3, Y=4)Dish D (Rank X=4, Y=3)Dish E (Rank X=5, Y=5)
Rank positions of dishes on Taste (X) and Presentation (Y) scales

Data:

Dish Judge X Rank Judge Y Rank
A 1 2
B 2 1
C 3 4
D 4 3
E 5 5

Step-by-step Calculation:

  1. Calculate and :
Dish
A 1 2 -1 1
B 2 1 1 1
C 3 4 -1 1
D 4 3 1 1
E 5 5 0 0
  1. Apply the formula:

Conclusion: There is a strong positive correlation () between the two judges' rankings.

Comparison: Karl Pearson vs. Spearman

Feature Karl Pearson () Spearman ()
Data Type Quantitative (Interval/Ratio) Qualitative or Quantitative (Ordinal)
Relationship Must be Linear Must be Monotonic
Sensitivity Sensitive to outliers Less sensitive to outliers
Requirement Requires actual values Requires ranks
Calculation More complex (means, variances) Simpler (differences in ranks)
123456123456xyPearson (Linear)Spearman (Monotonic)
Pearson measures linear relationships; Spearman measures monotonic (order-preserving) relationships

Advantages and Applications

Advantages

  • Predictive Power: Helps in forecasting trends (e.g., predicting room demand based on flight arrivals).
  • Efficiency: Identifies redundant variables in a business process.
  • Validation: Confirms if a change in one variable is associated with a change in another.

Applications in Hotel Management

  • Revenue Management: Correlating room rates with occupancy percentages to find the optimal price.
  • HR Management: Correlating employee training hours with the number of customer complaints.
  • Marketing: Correlating social media engagement (likes/shares) with the number of direct bookings.
24681012141618202468101214xyRoom Bookings vs. Advertising Budget (Positive Correlation)Guest Complaints vs. Room Price (Negative Correlation)
Hypothetical correlations in hotel operations: budget vs. bookings and price vs. complaints

In the real world

  1. Pathao/InDrive: These apps use correlation to determine "Surge Pricing." They analyze the correlation between the number of active riders (demand) and the number of available drivers (supply) in a specific area of Kathmandu. When the correlation shows a high demand but low supply, the price increases.
  2. NEPSE (Nepal Stock Exchange): Investors use correlation to diversify their portfolios. They look for stocks that have a negative correlation with each other. For example, if a hydropower stock goes down, they might hold a commercial bank stock that doesn't move in the same direction, reducing their overall risk.
  3. Daraz: Daraz uses correlation analysis to power its "Frequently Bought Together" section. If the data shows a high positive correlation between people buying a "Smartphone" and a "Screen Protector," the system automatically suggests the protector to anyone buying a phone.

Exam tip

When solving correlation problems in the TU/PU board exams, follow these rules to ensure full marks:

  1. Always draw the table clearly. Use a ruler. If the question asks for Karl Pearson, include columns for and .
  2. State the formula first. Never jump straight to the numbers. Write the general formula and then substitute the values.
  3. Interpret the result. Do not just write . Write: "Since , there is a high degree of positive correlation between [Variable X] and [Variable Y]."
  4. Check the range. If your answer is or , you have made a calculation error. and can never be outside the range of to .
  5. Rank Order: In Spearman's correlation, remember that the highest value gets Rank 1 (unless specified otherwise). Be consistent.

Based on the TU BHM syllabus for Statistics (STT311), unit 6.

Discussion

Loading…