EZ

Eduzan

Learning Hub

Eduzan
Eduzan / Data Science

Exploratory Data Analysis (EDA)

Descriptive Statistics

Descriptive statistics provide a way to summarize and describe the main features of a dataset. They help in understanding the distribution, central tendency, and variability of the data.

Key Descriptive Statistics:

Measures of Central Tendency:

  • Mean: The average of all data points.
  • Median: The middle value when data points are sorted.
  • Mode: The most frequent value in the dataset.

Measures of Dispersion:

  • Range: The difference between the maximum and minimum values.
  • Variance: Measures the spread of data points around the mean.
  • Standard Deviation: The square root of the variance, indicating how much data points deviate from the mean.
  • Interquartile Range (IQR): The range between the 25th and 75th percentiles, used to identify the spread of the middle 50% of data.

Shape of Distribution:

  • Skewness: Measures the asymmetry of the data distribution.
  • Kurtosis: Indicates the “tailedness” of the distribution (i.e., how heavy the tails are).

Example in Python:

import pandas as pd

# Example dataset
data = {'Scores': [70, 85, 78, 92, 88, 75, 60, 95, 83, 72]}
df = pd.DataFrame(data)

# Descriptive statistics
mean = df['Scores'].mean()
median = df['Scores'].median()
std_dev = df['Scores'].std()
summary = df['Scores'].describe()

print("Mean:", mean)
print("Median:", median)
print("Standard Deviation:", std_dev)
print(summary)

Example in R:

# Example dataset
scores <- c(70, 85, 78, 92, 88, 75, 60, 95, 83, 72)

# Descriptive statistics
mean <- mean(scores)
median <- median(scores)
std_dev <- sd(scores)
summary <- summary(scores)

print(paste("Mean:", mean))
print(paste("Median:", median))
print(paste("Standard Deviation:", std_dev))
print(summary)
End of lesson.