AdvStats Blog #2

Today, I explored a fundamental concept in statistics and programming: calculating the mean of a dataset. This exploration not only reinforced my understanding of basic statistical measures but also allowed me to practice writing and applying functions in a programming environment.

The Dataset

My journey began with a dataset, intriguing in its simplicity yet rich in its potential for analysis. The data points I worked with were as follows: 6, 18, 14, 22, 27, 17,  22, 20, and 22. This dataset, while small, is representative of the kind of numerical data one might encounter in various fields.

The Function: myMean

To analyze this dataset, we used myMean. The purpose of this function is straightforward yet fundamental in statistics: to calculate the mean, or the average, of a set of numbers. In programming terms, the mean is obtained by summing all the numbers in the dataset and then dividing this total by the count of numbers in the dataset.

This function takes a list of numbers (data) as its input. It utilizes two built-in functions: sum() and length(). The sum() function calculates the total of all the numbers in the list, while length() gives us the total count of the numbers in the list. Dividing these two gives us the mean.

Applying the Function

When I applied the myMean function to my dataset (named assignment2), the result was given.

The Result

The mean of my dataset turned out to be 18.7. This number is significant as it represents the central point of the dataset, giving us an idea about the average value around which all other data points are distributed.

Conclusion and Reflection

Today’s exercise was a testament to the power of basic statistical concepts and their implementation in programming. It underscored the importance of understanding and applying functions to real-world data, a skill that is invaluable in the realm of data analysis.


Comments

Leave a comment