BMD_data <- read.csv(“~/statistics1/bmd.csv”)

head(BMD_data, 5)

print(dim(BMD_data))

The first value of 169 represents the number of individuals in the data set while the second value of 9 represents the various variables about the individuals.

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.

I have acted with honesty and integrity in producing this work and am unaware of anyone who has not. - Lasya Mutluru