mydata <- structure(list(X1 = c(1, 1, 1, 1, 1, 1), X2 = c(1, 4, 4, 3, 2, 2), X3 = c(1, 2, 2, 3, 3, 3), X1 = c(-1, 1, 1, 1, -1, -1), X2 = c(1, -1, -1, 1, -1, -1), X3