# Confused! Two tailed t-test in r with equal variance

I am a complete novice in this but just trying to have a go. I have a dataset which has the number of birds in my garden each day for one month in June 2020 and June 2021. I would like to see if there is a significant difference in my total. As far as I can work out, a two-tailed t-test with equal variances would work for this (however, please correct me if I'm wrong).

H0: there is no significant difference between the number of birds visiting my garden in June 2020 and June 2021.

Please could someone help to write the code for this in R?

• I'm think that that test in Excel is a test of equal variances, not a test of equal means (like what people usually think of two sample t-test). Commented Mar 3, 2023 at 16:31
• But it sounds like you are looking for a test of means, or a test for another location measure. It's not clear what you have in mind when you say "difference in my total". Commented Mar 3, 2023 at 16:33

In R you can simply do (thanks @COOLSerdash for the remark!)
t.test(Jun20, Jun21, var.equal = TRUE)

but there is a fundamental problem with this approach. Your variables are counts and, for the worse, with quite small numbers. They surely violate the normality assumption behind the t.test.
• The default in t.test is to do an unequal (Welch) $t$-test though. The option var.equal = FALSE needs to be added to get the $t$-test with equal variances. Commented Mar 3, 2023 at 15:46
• @COOLSerdash , that is, var.equal = TRUE for equal variances. Commented Mar 3, 2023 at 16:26