Muskan Mini Project
Muskan Mini Project
AIM:- Analyze a dataset related to student grades, calculating and comparing the arithmetic mean,
median, and mode.
Solution:-
we have the following dataset of student grades ( 85, 72, 90, 68, 78, 82, 95, 63, 77, 88, 70, 84,
92, 79, 73, 87, 91, 67, 81, 75, 89, 76, 86, 94 )
CODE:
# Define the dataset
Grade = c(85, 72, 90, 68, 78, 82, 95, 63, 77, 88, 70, 84, 92, 79, 73, 87, 91, 67, 81, 75, 89, 76, 86, 94)
# Create a histogram
hist(grades_data$Grade, breaks = 10, main = "Distribution of Student Grades", xlab = "Grade", ylab
= "Frequency", col = "skyblue")
str(grades_data)
# Create a histogram
hist(grades_data$Grade, breaks = 10, main = "Distribution of Student Grades", xlab = "Grade", ylab
= "Frequency", col = "skyblue")
# Add legend
legend("topright", legend = c("Mean", "Median", "Mode"), col = c("red", "blue", "green"), lwd = 2,
lty = 2)
OUTPUT:
i) Arithmetic Mean (Average):
The arithmetic mean is calculated by adding up all the values in the dataset and
then dividing by the total number of values.
The mean, also known as the average, is calculated by adding up all the values in
a dataset and then dividing by the total number of values. It gives us a sense of
the central value around which the data points tend to cluster. The mean is
sensitive to outliers, meaning that extreme values can significantly influence its
value.
ii) Median:
The median is the middle value of a dataset when the values are arranged in
ascending order. If there is an even number of values, the median is the average
of the two middle values.
The median is the middle value of a dataset when the values are arranged in
ascending order. If there is an even number of values, the median is the average
of the two middle values. The median is less affected by extreme values (outliers)
compared to the mean, making it a robust measure of central tendency, especially
in skewed distributions.
iii) Mode:
The mode is the value that appears most frequently in a dataset. Unlike the mean
and median, the mode is not affected by the actual values of the dataset; it only
reflects the frequency of occurrence of values. A dataset can have one mode,
more than one mode (multimodal), or no mode at all (if all values occur with
equal frequency).
Sensitivity to
Measure Definition Outliers Calculation Method
Highly sensitive to
The average value of a dataset, outliers. Extreme
obtained by dividing the sum of values can
all values by the total number of significantly affect Mean = (Sum of all values) /
Mean values. its value. (Number of values)
Not affected by
outliers. Reflects the
frequency of The mode is determined by
The value that appears most occurrence of identifying the value(s) with the
Mode frequently in a dataset. values. highest frequency of occurrence.