Search the courses, subjects, tracks, games and features, or jump straight to a page.
Learn it your way
A short class with Sarah and her students. The other ways are under More.
Sign up free to listen. Transcripts are free to read.
Today, we're learning about covariance, which measures the joint variability of two random variables. Can anyone explain what that means?
I think it means how two variables change together.
Exactly! When one variable increases and the other does as well, we have a positive covariance. If one goes up while the other goes down, it's negative. This can help us understand relationships in data.
So, how do we calculate it?
Good question! We calculate it using the means of the variables and their individual variations from the mean. Remember, covariance doesn't tell us the strength of the relationship, just the direction.
Is there a way to quantify how strong that relationship is?
Yes! That brings us to correlation, which is a scaled version of covariance. Let’s move on to that.
To recap, covariance informs us about the direction of a relationship but not its strength. Keep this in mind as we progress!
Now that we know covariance, let's discuss correlation. Can anyone tell me what correlation measures?
It measures how strongly two variables are related.
Correct! Correlation provides a value between -1 and 1, where 1 means perfect positive correlation. What do you think a value of 0 indicates?
It means no linear correlation, right?
Exactly! The formula for correlation uses the covariance we calculated earlier divided by the product of the standard deviations of both variables. This standardizes our measure.
So, when we compute our example datasets later, we will see these relationships clearly?
Yes! After our worked example, we will discuss the significance of these relationships in practical applications, so stay tuned.
To summarize, correlation offers both direction and strength of a relationship, which covariance doesn’t.
Let’s now apply what we’ve learned through a worked example using sets X = {2, 4, 6, 8} and Y = {1, 3, 5, 7}. What’s our first step?
We need to find the means of both datasets!
That's right! For set X, what is the mean?
It's 5, right? Because (2 + 4 + 6 + 8)/4 = 5.
And for Y, it's (1 + 3 + 5 + 7)/4 = 4.
Excellent! Now, let's calculate the covariance using the means we've found.
So, we plug into the formula, which gives us five, right?
Exactly! Now, let’s find out the standard deviations. Can anyone recall how to do that?
We take the square root of the variance, which is the average of the squared differences from the mean.
Well said! Finally, how do we calculate the correlation using the covariance and standard deviations?
By dividing the covariance by the product of the standard deviations!
Correct! After calculating, we see a perfect positive relationship at a correlation of 1.
To summarize, we've learned to calculate means, covariance, and correlation step-by-step, reinforcing our understanding of these concepts.
Measures how two variables change together and indicates the direction of their relationship.
Standardizes covariance, allowing for interpretation of the strength and direction of the relationship.
The average of a set of data points, used in the calculations for covariance and correlation.
Provides insight into the spread of values in a dataset and is critical for calculating correlation.
Covariance goes up when both do shine, correlation tells us their ties, all in a line.
Imagine two friends walking in the same direction. If one speeds up, the other does too—this is like positive covariance!
C for Covariance relates to the C in Change together. Remember, correlation C for connection strength.
COV = Changes Observed Value: Indicates direction, but need CORR to see strength.
Term
Covariance
Click to flip
Term
Correlation
Click to flip
Term
Positive Correlation
Click to flip
A measure of the joint variability of two random variables.
A standardized measure of the relationship between two variables, providing a value between -1 and 1.
The average value of a dataset, calculated by dividing the sum of values by the number of values.
A measure of the amount of variation or dispersion in a set of values.
This section presents a worked example to calculate covariance and correlation between two datasets.
The worked example walks through the calculations of covariance and correlation for two datasets, illustrating their relationship. It highlights how to compute the means, covariance, standard deviations, and correlation coefficient, providing practical insights into these statistical concepts.
In this section, we provide a comprehensive worked example of calculating covariance and correlation. Given two datasets, 𝑋 = {2,4,6,8} and 𝑌 = {1,3,5,7}, we follow a systematic approach to calculate first the means of the datasets, then the covariance, and finally the correlation coefficient.
Step 1: Calculate Means
The means of datasets X and Y are computed as:
Step 2: Covariance
The covariance is calculated using the formula:
For our datasets, this yields:
Step 3: Standard Deviations
We then compute the standard deviations of both datasets, which is essential for calculating correlation.
Step 4: Correlation
Finally, the correlation is determined using the covariance and standard deviations:
This indicates a perfect positive linear relationship between datasets X and Y. This section emphasizes the importance of understanding covariance and correlation as they are critical tools for data analysis, machine learning, and interpreting the relationships between variables.