oahelp_urbmed$ppt_knee <- pmin(oahelp_urbmed$ppt_knee_left, oahelp_urbmed$ppt_knee_right, na.rm = TRUE)
oahelp_urbmed$bmi <- oahelp_urbmed$weight.x / (oahelp_urbmed$height_standing.x/100)^2
summary(oahelp_urbmed$urb_score)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 7.365 23.188 31.848 33.084 43.345 52.438
ggplot(oahelp_urbmed, aes(x = urb_score)) +
geom_histogram(binwidth = 2, fill= "#678096", color="#C5A35933") +
labs(title = "Histogram of Urbanicity Scores",
x = "Urbanicity Score",
y = "Frequency")+
theme(
panel.grid.major = element_blank(),
panel.grid.minor = element_blank()
)
filtered <- oahelp_urbmed %>%
filter(urb_score < 30, !is.na(ppt_knee), bmi < 30)
nrow(filtered)
## [1] 192
ggplot(filtered, aes(x = ppt_knee)) +
geom_histogram(binwidth = 1, fill= "#678096", color="#C5A35933") +
labs(title = "Histogram of Knee PPT",
x = "Pressure pain threshold (kg/cm²)",
y = "Frequency")+
scale_x_continuous(breaks = seq(1, 13, by=1))+
scale_y_continuous(breaks = seq(0, 150, by=40))+
theme(
panel.grid.major = element_blank(),
panel.grid.minor = element_blank()
)
filtered <- oahelp_urbmed %>%
filter(urb_score < 31.848, !is.na(ppt_knee), bmi < 30)
nrow(filtered)
## [1] 215
ggplot(filtered, aes(x = ppt_knee)) +
geom_histogram(binwidth = 1, fill= "#678096", color="#C5A35933") +
labs(title = "Histogram of Knee PPT",
x = "Pressure pain threshold (kg/cm²)",
y = "Frequency")+
scale_x_continuous(breaks = seq(1, 13, by=1))+
scale_y_continuous(breaks = seq(0, 150, by=40))+
theme(
panel.grid.major = element_blank(),
panel.grid.minor = element_blank()
)
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the
plot.