Anemia

Author

Lindsey Utterback

Quarto

Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see https://quarto.org.

Running Code

When you click the Render button a document will be generated that includes both content and the output of embedded code. You can embed code like this:

You can add options to executable code like this

#1.1 "Are women are more likely to have b12 anemia?"
# I find this interesting because I do not know any males that have B12 anemia.

#1.2 I plan on using the GENDER, B12, B12_Anemia_class, and HGB. This data is
# suitable because it shows the gender of the person in the data set, what their
# B12 level is on blood work, and whether or not they are considered have B12 
# anemia. The last variable, HGB is the hemoglobin level. Low hemoglobin is 
# often another sign of B12 anemia so I included it in analysis. 
# Below I created another column that counts that number of people that have 
# anemia. I plan to use this to show the counts by gender in a visualization. 


# count who has B12 Anemia

anemia$count_of_b12 <-
  sum(anemia$B12_Anemia_class, na.rm = TRUE)

# Convert B12_anemia_class from number to true or false

anemia$b12class <- ifelse(anemia$B12_Anemia_class > 0, TRUE, FALSE)

#1.3 Data Analysis:

# Counting how many people have B12 anemia where 0= Male and 1= Female
anemia %>% 
  ggplot(aes(x= as.factor(GENDER), fill = b12class, 
             )) +
  geom_bar(position = "dodge") +
  labs(title = "Count of B12 anemia based on Gender", x= "Gender", 
       color = "Legend")

# Interpretation: This graph shows that the count of men who do not have B12 
# anemia was a lot larger than the count of woman who do not have B12 anemia. 
# The count of men and woman who do have B12 anemia was relatively the same
# in this visualization. 

The echo: false option disables the printing of code (only output is displayed).