n_valid function

Obtain the number of data points without missing values