Question

For this assignment I asked myself, “what impact do animal shelters have on the cats and how effective are shelters at replacing cats with new residencies?”

I first want to see if there is a strong correlation between stray cat intake for animal shelters in the United States and see if it correlates with the number of live outcomes.

A live outcome is any case such that an animal leaves the animal shelter alive.

Dataset

To answer my question I found the ASPCA Shelter Animals Count dataset.

This dataset “contains state-level reporting from over 13,000 animal welfare

organizations located in the United States.” According to

https://www.shelteranimalscount.org/request-the-data/.

Regression Pt. 1

First, I plotted the gross number of live outgoing cats (leaving the shelter) from animal shelters by the total number of incoming cats.

What this plot seems to show is a positive linear association with these two variables. This information is shows that cats that enter a shelter have a high likelyhood of finding new residency.

Now I would like to make a linear regression model for this plot to quantify the correlation.

plot = ggplot(filter(data, data$Year == 2025), aes(x=`Gross Intakes`, y=gross_live_outcomes)) +
  geom_point() +
  labs(title = "Gross Intakes vs. Gross live ourcomes (2025)", y = "Gross Live Outcomes")
plot

Regression Pt. 2

To quantify this relation I will make a linear regression model using the Least Squares.

To calculate a least squares line, first calculate the rate of change, m, and then the intercept, b.

\(m = r\frac{S_y}{S_x}\)

S sub x, and y are the standard deviations of each variable and r is the coefficient of correlation.

\(b \rightarrow \hat{y} = m \hat{x} + b\)

Where x and y hat are the averages for the x and y variables, and you then solve for b.

data2025 = filter(data, data$Year == 2025)
xhat = mean(data2025$`Gross Intakes`)
yhat = mean(data2025$gross_live_outcomes)
sdx = sd(data2025$`Gross Intakes`)
sdy = sd(data2025$gross_live_outcomes)
r = cor(x=data2025$`Gross Intakes`, y=data2025$gross_live_outcomes)

Now that we have our required numbers we may calculate m and b.

Regression pt. 3

Let us start by calculating m

m = r * (sdy / sdx)
m
## [1] 0.6806066

And now we may calculate b.

b = yhat - xhat * m
b
## [1] 4477.412

Therefore our Least Squares Regression function will be:

\(\hat{y} = 0.68x - 4477.412\)

Regression Pt. 5

From our linear Regression Model we can see that there is a strong linear association with the gross number of cats taken into a shelter, and the gross number of cats leaving the shelter.

Residual Plot

Here is the residual plot of the model. We can use this to analyze accuracy of the model.

ggplot(data2025, aes(x=data2025$`Gross Intakes`, y=data2025$residual)) +
  geom_point() + 
  labs(title = "Residual plot for Regression Model", x="Gross Intakes", y="Residual distance from model")

Residual Plot Conclusion

To create this Residual plot I used this formula: $e = - y $

From the Residual plot I created for my Regression model there are several observations one could make.

  1. There are some apparent outliers with vast distance from the model.
  2. The points are not exactly scattered randomly around 0 which begs the question of linearity.

However, other than these observations the model is somewhat accurate.

The End

In the 2025 state-level data, higher gross cat intake counts were associated with higher net/community live-outcome counts. This suggests higher-volume systems report more live outcomes, but the aggregate data does not establish shelter effectiveness or show that the same cats entering shelters later had live outcomes.

Data Source: https://www.shelteranimalscount.org/request-the-data/