-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmPU_.pas
67 lines (67 loc) · 1.08 KB
/
mPU_.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//mPU_(simulation cycles M)/D.G.SCHRAUSSER/2025
//Permutation test in the random sampling model,
//randomized permutation, p-value not randomized, mP
//2 independent samples (x|g)
//(including intraclass permutation)
//e.g.mPU_(100)
#cas
mPU_(M):=
BEGIN
//L1L2 provided
//
{}▶L3;{}▶L4
{}▶L5;{}▶L6
0▶M11
0▶M12
0▶M2
SIZE(L1)▶N1
SIZE(L2)▶N2
N=N1+N2
//N vector L7
FOR I FROM 1 TO N DO
I▶L7(I) END;
//
ABS(mean(L1)-mean(L2))▶Q02
ΣLIST(L1)▶Q011
ΣLIST(L2)▶Q012
//
MSGBOX("mPU")
FOR J FROM 1 TO M
DO
//
//prm vector L9
FOR A FROM 1 TO N DO
{RANDOM(),L7(A)}▶L0(A) END;
sort(L0)▶L9
FOR A FROM 1 TO N DO
L9(A)▶L8;L8(2)▶L9(A) END;
{}▶L8
CONCAT(L1,L2)▶L8
//
FOR A FROM 1 TO N1 DO
L8(L9(A))▶L3(A) END;
FOR A FROM 1 TO N2 DO
L8(L9(N1+A))▶L4(A) END;
ABS(mean(L3)-mean(L4))▶QJ2
ΣLIST(L3)▶QJ11
ΣLIST(L4)▶QJ12
IF QJ11≥Q011 THEN M11=M11+1 END;
IF QJ12≥Q012 THEN M12=M12+1 END;
IF QJ2≥Q02 THEN M2=M2+1 END;
//
QJ11▶L5(J)
QJ2▶L6(J)
//
END;
//
SORT(L5)▶L5
SORT(L6)▶L6
{}▶L7
{}▶L8
{}▶L9
{}▶L0
//
N1,N2,[Q011,Q012,Q02],M11/M,M12/M,M2/M
END;
#end
//