xbar <- apply(as.matrix(X[,-1]), 2, mean)