It seems that the average of actions of treatment group is lower than that of the control group.

Let us say that treatment also influences the number of individuals who perform some action, and that I am interested in comparing the total of actions that have been performed in each group:

> sum(a)
[1] 3954
> sum(b)
[1] 4087

At first glance it seems that treatment, although associated with a lower average of actions than the control group, has achieved a higher aggregate number of actions than the control group. But it is clear to me that the samples obtained could have been different ones, and that this could obviously influence the sum of actions of each group.

The t-test works because it is carried out with a sample of values (200 and 220) and the distribution of these values is taken into account to calculate whether the difference in means is statistically significant. But in the case of the sum of actions of each group I only have a sample of sums in each group. How can I compare these two sums statistically? Is there an appropriate test for this? Perhaps one could compare the sums of both groups by calculating the confidence intervals for each sum? If so, how would such confidence intervals be calculated?

$\begingroup$"the number of times that individuals have performed a certain action". But in your simulation, Normal distribution was used. The question is your responsible is count (integer) or continuous? # of individuals in two groups are equal or not at the beginning?$\endgroup$
– user158565Dec 11 '18 at 23:00

$\begingroup$I'm sorry, I did not give you enough information. Experimental situations are using different scents that supposedly attract mosquitoes and cause more activity. I measure the activity by counting the actions (integers). I want to answer the following questions: Does the smell used in the treatment situation attract more mosquitoes? Does the odor used in the treatment situation cause a higher activity activity in mosquitoes? The total number of actions performed by mosquitoes is greater in the treatment situation?$\endgroup$
– giltrapoDec 12 '18 at 7:10

$\begingroup$You're right, @user158565, I set my example wrong. I edited my question by changing the normal distribution for a poisson.$\endgroup$
– giltrapoDec 12 '18 at 15:57

$\begingroup$Do you know the total number of mosquitoes in each group? For example, 500 in each group. In group A, 200 of them have some activity, 300 no activity. For group B, 220 have some activity and 280 no activity.$\endgroup$
– user158565Dec 15 '18 at 21:02

$\begingroup$Yes, there are 300 mosquitoes in each group.$\endgroup$
– giltrapoDec 16 '18 at 23:39