In this video, we are implementing algorithms for calculating the mean, median and mode of a dataset with JavaScript.

Before proceeding to coding, we briefly discuss how we can calculate each of these dataset properties.

Mean: in order to calculate the mean, all we have to do is to sum up all data points and divide by the number of data points. In other words, the mean, and more specifically the arithmetic mean (which is what we are calculating today), is what we usually call “the average” in everyday-life. Although, technically, mean, median, and mode are all kinds of averages, each trying to summarize the dataset with a single number representing a “typical” data point from the dataset.

Median: in order to get the median (the middle value), we first need to sort the dataset (conventionally in ascending order, but we would get the same result by sorting in descending order) and pick the data-point in the middle. If we had an even number of data points, we would get the mean of the 2 middle elements (by adding them and dividing by 2).

Mode: is the value in the dataset which occurs more frequently. If all values in the dataset appear with the same frequency, then the dataset has no mode. It is also possible for a dataset to have more than one modes.

Mean, median and mode, are different approaches for calculating the “typical” or “central” value of a dataset. That’s why they are also called measures of central tendency. Usually, they are used in conjunction with measures of spread (or measures of dispersion), in order to get the degree to which data is distributed around the center. Such measures of spread are the Range (which is the difference between the maximum and minimum value of the dataset) and Variance (or Standard Deviation which is the square root of Variance).

In this video, we are implementing algorithms for measures of central tendency. Feel free to expand on this, maybe by also calculating measures of spread and/or other statistical values. You could even take it a step further by creating a user interface such as a statistics calculator, which allows the user to enter a dataset and calculates and presents to the user a number of statistical values for the given dataset.

00:00 - Introduction to Concepts
04:15 - Implementation of Algorithms

Enjoy 😊

Don’t forget to like, share, subscribe and I would love to hear your thoughts in the comments section below!

Code for this Project: https://codepen.io/Coding_Journey/pen/VweybWG

Support the Channel 💙☕🙏
PayPal: https://paypal.me/CodingJourney

Affiliate Links*
Bluehost Web Hosting: https://www.bluehost.com/track/codingjourney/

*By making a purchase through any of my affiliate links, I’ll receive a small commission at no additional cost to you. This helps support the channel and allows me to continue creating videos like this. Thank you for your support!

Suggested Videos:
JavaScript Loops: https://www.youtube.com/watch?v=rTDAAhUgJZM
CSS box-shadow Editor: https://www.youtube.com/watch?v=EBbgImXJeqY
Coding Memes: https://www.youtube.com/watch?v=rs2GOUfA9j0
Data Visualization with Chart.js: https://www.youtube.com/watch?v=DSlUGncFxa4
Currency Converter with HTML, CSS and JavaScript: https://www.youtube.com/watch?v=ARBvYDNeNdM&list=PLdGqEpyfYoMCSMLcavLm4BmTiZoBnme-O

Codepen: https://codepen.io/Coding_Journey/
Twitter: https://twitter.com/CodingJrney
Email: codingjourney123@gmail.com

Subscribe 💖
https://www.youtube.com/channel/UCwpH4liYtBSiVXSfL8x2TyQ?sub_confirmation=1

#javascript #median #mode #mean

Mean, Median and Mode with JavaScript
1.25 GEEK