BMD_data <- read.csv(“~/statistics1/bmd.csv”)
head(BMD_data, 5)
print(dim(BMD_data))
BMD_data <- read.csv("~/statistics1/bmd.csv")
table(BMD_data$medication)
##
## Anticonvulsant Glucocorticoids No medication
## 9 24 136
barplot.default(table(BMD_data$medication)
, main = "Bar graph for meds", xlab= "medication", col = c("pink", "purple", "steelblue"), legend =rownames(table(BMD_data$medication)
), beside = TRUE)
BMD_data <- read.csv("~/statistics1/bmd.csv")
hist(BMD_data$bmd,
main = "Distribution of bmd",
xlab = "bmd",
ylab = "ages of patients",
col = "pink",
breaks = 3,
labels = TRUE,
ylim = c(0, 50))
# Question 4: For this type of data the median would be the preferable
measure of center to counteract outliers
median(BMD_data$bmd)
library(ggplot2)
BMD_data <- read.csv("~/statistics1/bmd.csv")
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.5.3
ggplot(BMD_data, aes(x = sex, fill = sex)) + geom_bar()
# According to the graph, men are more likely to have higher bone mass
density.