FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
smallbasic.github.io/samples/node/1058.bas at master · smallbasic/smallbasic.github.io · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
smallbasic
/
smallbasic.github.io
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
4
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
smallbasic.github.io
/
samples
/
node
/
1058.bas
Copy path
More file actions
More file actions
Latest commit
History
History
History
83 lines (68 loc) · 1.79 KB
Breadcrumbs
smallbasic.github.io
/
samples
/
node
/
1058.bas
Copy path
File metadata and controls
83 lines (68 loc) · 1.79 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
68
69
70
71
72
73
74
75
76
77
78
79
80
'
'Small BASIC code for a two-sample permutation test
'
'Based on QB code I found on my hard drive
cls
?
"
Permutation Test for Two Independent Samples
"
?
input
"
What is the size (N) of the first sample:
"
,
m
input
"
What is the size (N) of the second sample:
"
,
n
?
mn
=
m
+
n
dim
x
(
1
to
mn
),
index
(
1
to
mn
)
?
"
Enter the data for group 1 (one datum at a time).
"
For
i
=
1
to
m
print
"
Group 1 No.
"
;i;
"
=
"
;
input
x
(
i
)
next
i
?
"
Enter the data for group 2 (one datum at a time).
"
For
i
=
1
to
n
print
"
Group 2 No.
"
;i;
"
=
"
;
input
x
(
m
+
i
)
next
i
'
'Get totals and set indexes
total
=
sum
(
x
)
for
i
=
1
to
mn
tot2
=
tot2
+
x
(
i
)
if
i
=
m
then
crit1
=
tot2
index
(
i
)=
i
next
i
nperm
=
1
'
' # of permutations
uppertail
=
1
'
' # in uppertail
label loop1
i
=
m
label loop2
if
index
(
i
)=
mn
then
i
=
i
-1
if
i
=
0
then
goto
Findings
else
goto
loop2
end if
end if
index
(
i
) =
index
(
i
) +
1
if
i
<
m
then
'
'get next element of permutation
i
=
i
+
1
index
(
i
) =
index
(
i
-1
)
goto
loop2
else
'
'evaluate current sum
nperm
=
nperm
+
1
tot1
=
0
for
i
=
1
to
m
tot1
=
tot1
+
x
(
index
(
i
))
'
'? index(i); " "; ''**************************
next
i
if
tot1
>=
crit1
then
uppertail
=
uppertail
+
1
end if
goto
loop1
end if
'
'computation done, print results
label Findings
'
' cls ***********************************************
?
?
"
PERMUTATION TEST
"
?
"
Group: 1 2
"
? using
"
Sample Size: #### ####
"
;m,
n
? using
"
Sample Sums: #######.## #######.##
"
; crit1,
total
-
crit1
? using
"
Number of Sums >= Group 1 Sum: ##### out of ######### sums.
"
; uppertail,
nperm
? using
"
Upper Tail Probability = #.######
"
;
uppertail
/
nperm
end
Back
|
FazBrowse Home
|
New Git URL