function validate( opts, options ) {
	if ( !isObject( options ) ) {
		return new TypeError( format( 'invalid argument. Options argument must be an object. Value: `%s`.', options ) );
	}
	if ( hasOwnProp( options, 'alpha' ) ) {
		opts.alpha = options.alpha;
		if ( !isNumber( opts.alpha ) || isnan( opts.alpha ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a number. Option: `%s`.', 'alpha', opts.alpha ) );
		}
		if ( !isProbability( opts.alpha ) ) {
			return new RangeError( format( 'invalid option. `%s` option must be a number on the interval: [0, 1]. Option: `%f`.', 'alpha', opts.alpha ) );
		}
	}
	if ( hasOwnProp( options, 'alternative' ) ) {
		opts.alternative = options.alternative;
		if ( !isString( opts.alternative ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a string. Option: `%s`.', 'alternative', opts.alternative ) );
		}
	}
	if ( hasOwnProp( options, 'difference' ) ) {
		opts.difference = options.difference;
		if ( !isNumber( opts.difference ) || isnan( opts.difference ) ) {
			return new TypeError( format( 'invalid option. `%s` option must be a number. Option: `%s`.', 'difference', opts.difference ) );
		}
	}
	return null;
}
Validates function options.

@private
@param {Object} opts - destination for validated options
@param {Options} options - function options
@param {number} [options.alpha] - significance level
@param {string} [options.alternative] - alternative hypothesis (`two-sided`, `less` or `greater`)
@param {number} [options.difference] - difference in means under H0
@returns {(null|Error)} null or an error