SecreC 2 language  2.8.0 (2023.09)
Language and standard library reference
Functions

Functions

template<domain D :shared3p >
D float32 mannWhitneyU (D int32[[1]] sample1, D bool[[1]] ia1, D int32[[1]] sample2, D bool[[1]] ia2, bool correctRanks, int64 alternative)
 
template<domain D :shared3p >
D float64 mannWhitneyU (D int64[[1]] sample1, D bool[[1]] ia1, D int64[[1]] sample2, D bool[[1]] ia2, bool correctRanks, int64 alternative)
 
template<domain D :shared3p >
D float32 mannWhitneyU (D float32[[1]] sample1, D bool[[1]] ia1, D float32[[1]] sample2, D bool[[1]] ia2, bool correctRanks, int64 alternative)
 
template<domain D :shared3p >
D float64 mannWhitneyU (D float64[[1]] sample1, D bool[[1]] ia1, D float64[[1]] sample2, D bool[[1]] ia2, bool correctRanks, int64 alternative)
 

Detailed Description

Perform Mann-Whitney U test.

Note
D - shared3p protection domain
Supported types - int32 / int64 / float32 / float64
The t-test requires the populations to be normally distributed. If the populations cannot be assumed to be normally distributed but are ordinal then the Mann-Whitney U or Wilcoxon rank-sum test can be used instead.
Parameters
sample1- first sample
ia1- vector indicating which elements of the first sample are available
sample2- second sample
ia2- vector indicating which elements of the second sample are available
correctRanks- indicates if the equal sample values should be ranked correctly. If they are not the test is more conservative but faster.
alternative- the type of alternative hypothesis. Less - mean of sample1 is less than mean of sample2, greater - mean of sample1 is greater than mean of sample2, two-sided - means of sample1 and sample2 are different
Returns
returns a vector where the first element is the test statistic and the second element is the z-score. The z-score is continuity corrected. The z-score is an approximation and is only correct when the samples are large and the significance level is not very low.
Leakage
Leaks the sum of the number of true values in ia1 and ia2

Function Documentation

◆ mannWhitneyU() [1/4]

D float32 mannWhitneyU ( D float32[[1]]  sample1,
D bool[[1]]  ia1,
D float32[[1]]  sample2,
D bool[[1]]  ia2,
bool  correctRanks,
int64  alternative 
)

◆ mannWhitneyU() [2/4]

D float64 mannWhitneyU ( D float64[[1]]  sample1,
D bool[[1]]  ia1,
D float64[[1]]  sample2,
D bool[[1]]  ia2,
bool  correctRanks,
int64  alternative 
)

◆ mannWhitneyU() [3/4]

D float32 mannWhitneyU ( D int32[[1]]  sample1,
D bool[[1]]  ia1,
D int32[[1]]  sample2,
D bool[[1]]  ia2,
bool  correctRanks,
int64  alternative 
)

◆ mannWhitneyU() [4/4]

D float64 mannWhitneyU ( D int64[[1]]  sample1,
D bool[[1]]  ia1,
D int64[[1]]  sample2,
D bool[[1]]  ia2,
bool  correctRanks,
int64  alternative 
)