Dimension reduction for binary data