Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21297

Problem with sorting an array and Spearman's Rank

$
0
0
Ok, i've been on this forum for a long time, anonymously browsing and searching for problems. I've always found the answer i sought after but now i'm really stumped and desperately need someone's help and expertise.
Basically, i've been tasked to create a program for my college's Biology department. In this program, i need a form that aids in the completion of a statistical test (that is used on data the user will have collected). the problem is that this test is the Spearmans' Rank Correlation Coefficient. For those who don't know, you have two sets of data and you need to rank each set of data.
data set 1: 10, 5, 7, 4, 8 ranking: 5,2,3,1,4
data set 2: 60, 70, 40, 2, 10 ranking: 4,5,3,1,2
simple enough. the problem i am faced with is that the user needs to rank the data themselves using a bunch of text boxes. the data will be listed in a vertical line.
my theory, so far, was to use a sorting algorithm, probably the bubble sort method. this would be applied to two new arrays, each of dimensions 10. this would mean i have an array with the unordered data and then one with the data ordered correctly. i'd then put the new array into an array of labels (0-10). this way, when the user checks their answers, i can use the text within the text box as the index of the array and if the value returned (say it be 5) is equal to the adjacent label (this one will be visible for the user to see and to rank), viola! all works!
I'm completely stuck and would like anyone's help on the matter. I don't want it to be done for me so even something as simple as an algorithm or pseudo code would be much appreciated. if it's done for me, i'll have a harder time deciphering it and applying it to my existing code then if it were in a simple format so to speak.
Again, i greatly appreciate any help that can be provided :)

Viewing all articles
Browse latest Browse all 21297

Trending Articles