Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Calculateing the mode of a data set
- 1Bluemoose
-
5 posts
Calculateing the mode of a data set
Hello! I have recently been making a program the calculates the mean, median, mode and range of a data set. I have figured out how to calculate the mean, median and range, but I am stumped when it comes to the mode. You can view the project here
Any help is appreciated. Thanks
-1Bluemoose
Any help is appreciated. Thanks
-1Bluemoose

- drmcw
-
1000+ posts
Calculateing the mode of a data set
SImplest but not particularly efficient way would be to go through each item in the list then go through the list for each item but skipping the item you are checking and add up all occurences. The item with the highest number of occurences is the mode.
- 1Bluemoose
-
5 posts
Calculateing the mode of a data set
I get what you mean and have been thinking about this for a while but I cant seem to wrap my head around how you would code that. Can you provide a code example / better explination?
-1Bluemoose
-1Bluemoose
- drmcw
-
1000+ posts
Calculateing the mode of a data set
something like this http://scratch.mit.edu/projects/33302920/
- Discussion Forums
- » Help with Scripts
-
» Calculateing the mode of a data set