On the number of variables to use in principal component regression