add several checks of the data and sample.mean arguments