Part 1. The (student) t distribution converges to normal distribution as the degrees of freedom increase (beyond 120). Please plot a normal distribution, and a few t distributions on the same chart with 2, 5, 15, 30, 120 degrees of freedom.

# Set seed for repoducibility
set.seed(13)

# Creating the distributions
normal <- rnorm(1000, 0 ,1)  
t_2 <- rt(1000,2)
t_5 <- rt(1000,5)
t_15 <- rt(1000,15)
t_30 <- rt(1000,30)
t_120 <- rt(1000,120)

# Plotting

plot(density(normal),
     xlim = c(-5,5),
     col = "red",
     main = "Normal vs t Distributions",
     xlab = "Random Variable Value",
     lwd = 3)
lines(density(t_2),
      col = "orange",
      lwd = 3
      )
lines(density(t_5),
      col = "green",
      lwd = 3
      )
lines(density(t_15),
      col = "blue",
      lwd = 3
      )
lines(density(t_30),
      col = "orchid",
      lwd = 3
      )
lines(density(t_120),
      col = "wheat4",
      lwd = 3
      )
legend("topright",
       legend = c("Normal", "t (df = 2)", "t (df = 5)", "t (df = 15)", "t (df =
                  30)", "t (df = 120)"),
       col = c("red", "orange", "green", "blue", "orchid", "wheat4"),
       lwd = 3,
       bty = "0")

Part 2. Lets work with normal data below (1000 observations with mean of 108 and sd of 7.2).

# Normal Distribution
set.seed(123)  # Set seed for reproducibility
mu <-  108
sigma <-  7.2
data_values <- rnorm(n = 1000, mean = mu, sd = sigma)

Plot two charts - the normally distributed data (above) and the Z score distribution of the same data. Do they have the same distributional shape ? Why or why not ?

# Computing the Z-score
z_scores <- (data_values - mu) / sigma

# Plotting both distributions

par(mfrow = c(1,2))
hist(data_values,
     main = "Normal Distribution",
     xlab = "Observations",
     col = "blue")
hist(z_scores,
     main = "Z-Score Distribution",
     xlab = "Z-Score",
     col = "red")

The normal distribution and the z-score distribution have the same shape. I assume this is because the z-score only standardizes the normal distribution to have a mean of 0 and standard deviation of 1, it doesn’t change the ratio of distribution within the data. Therefore, the overall bell shape should remain unchanged.

Part 3. In your own words, please explain what is p-value?

The p-value (probability value), is a statistical measurement that is used with hypothesis testing. The p-value tells us the probability of observing data at least as extreme as what was observed, assuming the null hypothesis were true. This article here helped me better understand https://www.simplypsychology.org/p-value.html