This project occurred during the summer of 2023 at the USDA Agricultural Research Services Fort Keogh Livestock and Range Research Laboratory, located in Miles City, MT. The purpose of this study is to determine the effects of prescribed fire on big sagebrush (Artemisia tridentata) in the US Great Northern Plains. Plots 4 and 8 were omitted from the study due to low shrub density.
SagebrushData <-
read_xlsx("NoahTridentataData.xlsx")
df <-
SagebrushData %>%
select(- date) %>%
dplyr::group_by(plot) %>%
dplyr::summarize(frequency = n(),
'μ height' = round(mean(height)))
df %>%
kbl() %>%
kable_styling(full_width = F) %>%
column_spec(1, bold = T, border_right = T)
| plot | frequency | μ height |
|---|---|---|
| 1 | 334 | 65 |
| 2 | 499 | 61 |
| 3 | 242 | 75 |
| 5 | 100 | 69 |
| 6 | 259 | 59 |
| 7 | 70 | 67 |
| 9 | 184 | 69 |
| 10 | 211 | 77 |
| 11 | 211 | 69 |
| 12 | 292 | 65 |
| 13 | 401 | 66 |
| 14 | 175 | 64 |
| 15 | 335 | 65 |
| 16 | 179 | 70 |
| 17 | 130 | 66 |
| 18 | 126 | 67 |
| 19 | 412 | 61 |
| 20 | 98 | 66 |
| 21 | 370 | 56 |
| 22 | 270 | 65 |
| 23 | 293 | 62 |
| 24 | 240 | 61 |
| 25 | 297 | 60 |
| 26 | 366 | 62 |
| 27 | 366 | 69 |
# Descriptive Statistics
stat.desc(SagebrushData$height)
## nbr.val nbr.null nbr.na min max range
## 6.460000e+03 0.000000e+00 0.000000e+00 6.000000e+00 1.510000e+02 1.450000e+02
## sum median mean SE.mean CI.mean.0.95 var
## 4.172963e+05 6.548908e+01 6.459695e+01 2.563626e-01 5.025557e-01 4.245628e+02
## std.dev coef.var
## 2.060492e+01 3.189767e-01
# Ratio between mean and median
knitr::kable(tibble(Mean = mean(SagebrushData$height),
Median = median(SagebrushData$height),
Ratio = Mean/Median))
| Mean | Median | Ratio |
|---|---|---|
| 64.59695 | 65.48908 | 0.9863775 |
# Histograms
meanvline1 <-
SagebrushData %>%
dplyr::summarise(count = n(),
mean = mean(height))%>%
mutate(lab = paste("μ = ", round(mean), "\nn = ", count))
histall <-
ggplot(data = SagebrushData,
aes(x = height)) +
geom_histogram(data = SagebrushData,
aes(y = after_stat(.data[["density"]])),
binwidth = 8,
colour = "black",
fill = "lightyellow") +
geom_density(alpha = .5, fill = "lightblue") +
stat_function(fun = dnorm,
args = list(mean = 64.59695,
sd = 20.60492),
colour = "red",
linewidth = 1.1) +
geom_vline(data = meanvline1,
mapping = aes(xintercept = mean),
linewidth = 1,
color = "black") +
labs(y = "density")
histall + geom_text(data = meanvline1,
aes(label = lab),
x = Inf, y = Inf,
hjust = 1,
vjust = 1.2,
size =15/.pt)
meanvline2 <-
SagebrushData %>%
group_by(plot) %>%
dplyr::summarise(count = n(),
mean = mean(height))%>%
mutate(lab = paste("μ = ", round(mean), "\nn = ", count))
p <-
ggplot(data = SagebrushData,
aes(x = height)) +
geom_histogram(data = SagebrushData,
aes(y = after_stat(.data[["density"]])),
fill = "white",
colour = "black",
binwidth = 8) +
geom_density(data = SagebrushData,
col = "red",
fill = "red",
alpha = 0.1) +
geom_vline(data = meanvline2,
mapping = aes(xintercept = mean),
linewidth = .4,
color = "red") +
facet_wrap(~ plot)+
labs(y = "density")
p + geom_text(data = meanvline2,
aes(label = lab),
x = Inf, y = Inf,
hjust = 1,
vjust = 1.2,
size = 7/.pt)