estimate_p_value.default: Estimate p-value.

Description Usage Arguments Value References

Description

Estimates the p-value of the given observation for the given set of Monte Carlo samples. User can choose which method is used to treat possible tied values.

Usage

1
2
## Default S3 method:
estimate_p_value(obs, sim_vec, ties = 'midrank')

Arguments

obs

The data sample. A scalar real value. Must not be NULL.

sim_vec

The Monte Carlo samples. A vector of real values. Must not be NULL.

ties

The method to treat tied values with. If one or more of the elements of sim_vec are equal to obs, how should the rank of obs be determined? For 'conservative' the resulting p-value will be the highest possible. For 'liberal' the p-value will be the lowest possible. For 'random' the rank of the obs within the tied values is uniformly sampled so that the resulting p-value is at most the conservative option and at least the liberal option. For 'midrank' the mid-rank within the tied values is taken. 'midrank' is the default.

Value

The p-value estimate. A scalar real value between 0 and 1.

References

Hájek & Šidák & Sen. Theory of Rank Tests. 1999. ff. 130.


myllym/spptest documentation built on May 23, 2019, noon