Introduction

For this tutorial I sourced my data set from Kaggle. (link: https://www.kaggle.com/datasets/thedevastator/austin-animal-center-data) This data reflects the intakes and outcomes of shelter animals at the Austin Animal Center located in Austin, Texas.

I cleaned the data first by removing all animals besides dogs and cats. I also limited the data to the first 100 observations (50 dogs + 50 cats). With this information, I plan to create a stacked bar chart comparing the outcomes of dogs and cats at this particular animal shelter to address any discrepancies between the two types of animals. In addition, I am going to add percentages to the chart for easy visualization and analysis.

Analysis

# Load necessary libraries
library(ggplot2)
library(readxl)
library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
# Step 1: Load the clean data
data <- read_excel("adoption_outcome.xlsx")

# Step 2: Filter for necessary columns - Since we are comparing the animal type (dogs and cats) to outcome, we will filter these two categories
data_filtered <- data %>%
  select(`Animal Type`, `Outcome Type`) %>%
  filter(!is.na(`Outcome Type`))

# Step 3: Count how many of each outcome type per animal type
outcome_counts <- data_filtered %>%
  group_by(`Animal Type`, `Outcome Type`) %>%
  summarise(count = n(), .groups = "drop")

# Step 4: Add a percentage column
outcome_counts <- outcome_counts %>%
  group_by(`Animal Type`) %>%
  mutate(percentage = count / sum(count))
# Step 5: Create the stacked bar chart
ggplot(outcome_counts, aes(x = `Animal Type`, y = count, fill = `Outcome Type`)) +
  geom_bar(stat = "identity") +
  geom_text(aes(label = paste0(round(percentage * 100, 1), "%")),
            position = position_stack(vjust = 0.5),
            color = "white", size = 3) +
  labs(title = "Outcome Types for Cats vs. Dogs",
       x = "Animal Type",
       y = "Count",
       fill = "Outcome Type") +
  theme_minimal()

Interpretation and Conclusion

Based on my tutorial, I was able to create a stacked bar chart that displayed the outcomes of dogs vs. cats at the Austin Animal Center. Based on the chart we know that the adoption rate for dogs (56%) is much higher than the adoption rate for cats (38%). In addition, the transfer rate for cats is also much higher, likely due to the lack of adoptions to free up space in the shelter. From our analysis, we can also determine that dogs are more likely to be returned to the owners (26% vs. 2%). Lastly, 8% of cats were euthenized whereas 0% of dogs were euthenized. 
In contrast to the Austin Animal Center, the American Society for the Prevention of Cruelty to Animals' statistics show that cats are more frequently adopted than dogs in total in the United States. In addition, about 60,000 more dogs than cats were euthenized in the USA in 2024. (ASPCA, 2024)
A marketer for the Austin Animal Center should utilize different promotional materials and marketing channels to encourage cat adoptions to increase adoptions, reduce transfers, and most importantly reduce the chance of euthenazia. In adition, marketers should utilize the information we found in this tutorial to create hypotheses and conduct research about why cats are being adopted less at this particular shelter in comparison to dogs.

**Note: While the idea for this tutorial was mine, I utilized Chat GPT to create the syntax for the stacked bar chart with percentiles added to it by asking Chat GPT the following prompts “create a stacked bar chart utilizing this data set comparing the outcomes of dogs vs. cats” and “what line of code can I add to this to put percentiles on my bar chart?”

References: American Society for the Prevention of Cruelty to Animals. (n.d.). U.S. animal shelter statistics. ASPCA. https://www.aspca.org/helping-shelters-people-pets/us-animal-shelter-statistics