Retaining principal components for discrete variables