I need to compare attendance measurements within the same facility, taken each last day of the month in the year 2019 and the year 2020. So I have 12 measurements in 2019 e 12 measurements in 2020.

The question I am trying to answer is whether there was a significant reduction in the average number of individuals present within the facility in 2020.

Is it a paired t.test sufficient to answer this question or a non parametric test like Wilcoxon Mann Whitney would be better? Or am I completely off the track?

Thanks in advance. As maybe you can tell I am new to the field of statistics, so you will forgive a basic question.

These are the data

month 2019 2020
Jan 778 871
Feb 787 891
Mar 818 781
Apr 803 690
May 827 656
Jun 855 674
Jul 853 706
Aug 842 822
Sep 855 735
Oct 879 722
Nov 870 731
Dec 851 671

There may be a seasonal effect, so you should consider a paired test. If the 12 paired differences d = x.19 - d.20 are nearly normal, then a paired t test should be OK. But of there is a Covid effect after the first few months of 2020, data may not be normal. In that case, perhaps data will be far from normal, and you might want to use a nonparametric Wilcoxon signed rank test on the differences.

If the point is to illustrate a Covid effect maybe compare only nine months April through December for the two years.

If you know that there were attendance restrictions because of Covid, so that attendance was greatly reduced, you might not need any statistical test to confirm the obvious.

If you want a less-speculative answer, perhaps post the data.

Fake data to illustrate:

x.19 = c(521,526,552, 560,548,436, 388,290,383, 490,524,517)
x.20 = c(532,529,650, 334,357,240, 211,205,241, 220,346,309)
d = x.19 - x.20

  Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
 -98.0    63.0   177.5   130.1   199.0   270.0 

A boxplot shows marked skewness and a median very far from 0.

boxplot(d, horizontal=T)

enter image description here

A normal probability plot is far from linear. With such a small sample size I would not trust to the P-value of a paired t test to be accurate.

qqnorm(d);  qqline(d, col="green")

enter image description here


        One Sample t-test

data:  d
t = 4.0056, df = 11, p-value = 0.002066
alternative hypothesis: true mean is not equal to 0
95 percent confidence interval:
   58.60574 201.56093
sample estimates:
mean of x 


        Wilcoxon signed rank test

data:  d
V = 71, p-value = 0.009277
alternative hypothesis: true location is not equal to 0

There is a clear difference between the two years, which may not require a test to be obvious. For what it's worth, I would prefer the nonparametric test.

  • 1
    $\begingroup$ The study is conducted on people inside a prison during the year 2019 and the year 2020. There were no attendance restrictions present, so the point I want to try to prove is that covid has reduced the number of arrests, especially in the spring and has greatly reduced the number of inmates present in the facility. In any case, I have edited the question by including the data. Thank you very much $\endgroup$ – n_cer Apr 4 at 10:32
  • $\begingroup$ Thanks for the explanation and the real data. I would show a bar chart by month, with different colored bars for the two years at each month, to illustrate what you say in your comment. If the audience for your report is statistically literate, maybe results of the paired Wilcoxon test to confirm the conclusion. // Are you sure the effect is due to arrests, not to the behavior of judges reluctant to overload prisons in a pandemic? $\endgroup$ – BruceET Apr 4 at 10:47
  • 1
    $\begingroup$ Side-note: Physically a crime (usually) needs a victim, an offender and a place. Lockdowns and social distancing measurements in general, greatly reduced the "place". Not necessarily the pool of victims or offenders. Building on what Bruch suggested, maybe it would be good explore if the rate of convictions changed. $\endgroup$ – usεr11852 Apr 4 at 11:38
  • 1
    $\begingroup$ Thanks for all the suggestions, I will take into consideration all the aspects you have pointed out. I'm certainly going to look at what the reasons may have been for the reduction in the number of detainees, whether it was the reduction in convictions or the implementation of release policies, or both. Thanks again, you have been very helpful. $\endgroup$ – n_cer Apr 5 at 9:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.