9/15/2021

What is a Z-Score?

A z-score, also known as the standard score, is a numerical value that measures the distance of a value from a mean using standard deviations. This value can be either positive or negative, with positive showing the value lies above the mean, and negative showing it lies below the mean.

Calculating Z-Score in LaTex

To calculate the z-score of tree 8’s height in the dataset trees, we first need to find the mean and standard deviation of the heights in the dataset:

# Value, Mean, and Standard Deviation
df$Height[8]

[1] 75

mean(df$Height)

[1] 76

sd(df$Height)

[1] 6.371813

\({75-76\over 6.371813} = -0.1569412\)

Calculating Z-Score in LaTex

To calculate the z-score of tree 26’s volume in the dataset trees, we first need to find the mean and standard deviation of the volumes in the dataset:

# Value, Mean, and Standard Deviation
df$Volume[26]

[1] 55.4

mean(df$Volume)

[1] 30.17097

sd(df$Volume)

[1] 16.43785

\({55.4-30.17097\over 16.43785} = 1.534813\)

Plotly ScatterPlot of Height of Cherry Trees

GGPlot: Girth of Cherry Trees

## `geom_smooth()` using formula 'y ~ x'

GGPlot: Height against Volume

## `geom_smooth()` using formula 'y ~ x'

Plot Code

fig <- plot_ly(data = df, x = c(1:31), y = df$Height,
    marker = list(size = 10, color = "darksalmon",
        line = list(color = "darkred", width = 2)),
    type = "scatter", mode = "markers") %>%
    layout(title = "Height of Cherry Trees")

ggplot(df, aes(c(1:31), Girth)) + geom_point() +
    geom_smooth(method = lm, size = 1, color = "deeppink") +
    labs(x = "Trees", title = "Girth of Cherry Trees")
## `geom_smooth()` using formula 'y ~ x'
ggplot(df, aes(Volume, Height)) + geom_point() +
    geom_smooth(method = lm, size = 1, color = "maroon") +
    labs(title = "Height against Volume of Cherry Trees")
## `geom_smooth()` using formula 'y ~ x'