Dimension Choice for Sliced Inverse Regression Based on Ranks