1.

# Define the range of x values
x <- seq(-4, 4, by = 0.01)

# Generate data for the normal distribution
normal_density <- dnorm(x, mean = 0, sd = 1)

# Generate data for t-distributions with different degrees of freedom
df_values <- c(2, 5, 15, 30, 120)
t_densities <- sapply(df_values, function(df) dt(x, df = df))

# Create the plot
plot(x, normal_density, type = "l", col = "blue", lwd = 2, xlab = "X-Axis", ylab = "Density", 
     main = "Normal and t-Distributions")

# Add lines for t-distributions
colors <- c("red", "green", "purple", "orange", "brown")
for (i in 1:length(df_values)) {
  lines(x, t_densities[, i], col = colors[i], lty = i)
}

# Add a legend
legend("topright", legend = c("Normal", paste("t(", df_values, ")", sep = "")), 
       col = c("blue", colors), lty = c(1, 1, 2, 3, 4))

2.

set.seed(123)

mu <- 108
sigma <- 7.2

# Generate normally distributed data
data_values <- rnorm(n = 1000, mean = mu, sd = sigma)

# Calculate Z-scores
z_scores <- (data_values - mu) / sigma

# Create a layout for side-by-side histograms
par(mfrow = c(1, 2))

# Plot the histogram of the normally distributed data
hist(data_values, main = "Normally Distributed Data", xlab = "Value", col = "lightblue")

# Plot the histogram of Z-scores
hist(z_scores, main = "Z-Score Distribution", xlab = "Z-Score", col = "lightgreen")

They have about same distribution shape, because the regularly distributed data’s Z-score distribution follows a conventional normal distribution with a mean of 0 and a standard deviation of 1. Although the scale parameters of the two distributions differ, they both feature a bell-shaped curve as their form. The form of the Z-score distribution is identical to the original normal distribution, except it is centered at 0 and has a standard deviation of 1. Because of the conversion to Z-scores, they have the same distributional shape—a normal distribution—but differ in scale and location.

3.

The probability value, or p value, indicates the likelihood that your data could have happened in the event of the null hypothesis. It accomplishes this by computing the probability of your test statistic—that is, the value that a statistical test employing your data computes. The P value is the likelihood of getting a result that is as extreme as or more extreme than what was actually observed, assuming that there is no impact or difference (null hypothesis). P, or probability, expresses the likelihood that any observed variation across groups is the result of chance.