if covariance is -150, what is the type of relationship between two variables?

The covariance of of two variables has been calculated to be -150. what does the statistics telling about the relationship between two variables ?

Answer

To add to Łukasz Deryło’s answer: as he writes, a covariance of -150 implies a negative relationship. Whether this is a strong relationship or a weak one depends on the variables’ variances. Below I plot examples for a strong relationship (each separate variable has a variance of 200, so the covariance is large, in absolute terms, compared to the variance), and for a weak relationship (each variance is 2000, so the covariance is small, in absolute terms, compared to the variance).

Strong relationship, variance <- 200:

strong relationship

Weak relationship, variance <- 2000:

enter image description here

R code:

library(MASS)

nn <- 100
epsilon <- 0.1
variance <- 2000 # weak relationship

opar <- par(mfrow=c(2,2))
    for ( ii in 1:4 ) {
        while ( TRUE ) {
            dataset <- mvrnorm(n=100,mu=c(0,0),Sigma=rbind(c(2000,-150),c(-150,2000)))
            if ( abs(cov(dataset)[1,2]-(-150)) < epsilon ) break
        }   
        plot(dataset,pch=19,xlab="",ylab="",main=paste("Covariance:",cov(dataset)[1,2]))
    }
par(opar)

EDIT: Anscombe’s quartet

As whuber notes, the covariance in itself doesn’t really tell us a lot about a dataset. To illustrate, I’ll take Anscombe’s quartet and modify it slightly. Note how very different scatterplots can all have the same (rounded) covariance of -150:

Anscombe

anscombe.mod <- anscombe
anscombe.mod[,c("x1","x2","x3","x4")] <- sqrt(150/5.5)*anscombe[,c("x1","x2","x3","x4")]
anscombe.mod[,c("y1","y2","y3","y4")] <- -sqrt(150/5.5)*anscombe[,c("y1","y2","y3","y4")]
opar <- par(mfrow=c(2,2))
    with(anscombe.mod,plot(x1,y1,pch=19,main=paste("Covariance:",round(cov(x1,y1),0))))
    with(anscombe.mod,plot(x2,y2,pch=19,main=paste("Covariance:",round(cov(x2,y2),0))))
    with(anscombe.mod,plot(x3,y3,pch=19,main=paste("Covariance:",round(cov(x3,y3),0))))
    with(anscombe.mod,plot(x4,y4,pch=19,main=paste("Covariance:",round(cov(x4,y4),0))))
par(opar)

FINAL EDIT (I promise!)

Finally, here is a covariance of -150 with perhaps the most tenuous “negative relationship” between x and y imaginable:

final

xx <- yy <- seq(0,100,by=10)
yy[9] <- -336.7
plot(xx,yy,pch=19,main=paste("Covariance:",cov(xx,yy)))

Attribution
Source : Link , Question Author : Sameera , Answer Author : Stephan Kolassa

Leave a Comment