function(y, x1, x2)
{
	n <- length(y)
	xs2 <- cbind(jay(n, 1), x2)
	b1 <- inv(t(xs2) %*% xs2) %*% t(xs2) %*% y
	e1 <- y - xs2 %*% b1
	b2 <- inv(t(xs2) %*% xs2) %*% t(xs2) %*% x1
	e2 <- x1 - xs2 %*% b2
	r <- cor(e1, e2)
	r
}
