# Comparing proportions of two samples in time

I am trying to compare if the proportion of one bird subspecies in a roosting area is different now from over 20 years ago.

My dataset looks like following:

-In 1996 birds were counted at a roosting site and were identified as one of two possible subspecies. These counts were done during 3 two-week periods.

-In 2019 birds were again counted at the same roosting site and the same 3 two-week periods, and were also identified as one of two subspecies.

I want to know if:

a) Are the subspecies' proportions different for the different two time periods?

b) Are the subspecies' proportions different in 2019 from 1996?

c) Is there an interaction between a) and b)? I do not expect this but I don't know if this should be included in any potential model.

I have considered using a GLM, but I'm not very familiar with how they work so I thought I'd better double check first. I am trying to do the statistics using R.

So, the straight-forward approach would be to perform a proportion comparison test. Let's say you want to compare two groups with estimated proportions $$\hat{p}$$ and $$\hat{q}$$ with sample sizes of $$m$$ and $$n$$ respectively. Let $$r$$ be the overall proportion (when considering both groups together). Then, under the null hypothesis of both groups being equal:
$$Z:= \frac{\hat{p} - \hat{q}}{\sqrt{r(1-r) (\frac{1}{m} + \frac{1}{n}) }}$$
Follows a standard normal distribution $$N(0,1)$$. Typically, values outside the $$(-2, 2)$$ interval are considered enough for rejecting the null hypothesis. There are plenty of charts/software that will enable you to transform the $$Z$$-score into a $$p$$-value.