nimare.stats.null_to_p

null_to_p(test_value, null_array, tail='two')[source]

Return p-value for test value against null array.

Parameters
  • test_value (1D array_like) – Values for which to determine p-value.

  • null_array (1D array_like) – Null distribution against which test_value is compared.

  • tail ({‘two’, ‘upper’, ‘lower’}, optional) – Whether to compare value against null distribution in a two-sided (‘two’) or one-sided (‘upper’ or ‘lower’) manner. If ‘upper’, then higher values for the test_value are more significant. If ‘lower’, then lower values for the test_value are more significant. Default is ‘two’.

Returns

p_value (float) – P-value associated with the test value when compared against the null distribution.

Notes

P-values are clipped based on the number of elements in the null array. Therefore no p-values of 0 or 1 should be produced.