Comparing two users' average number of events per day with a statistical approach I've recently had a test which included a question that was phrased like this:

Compare user A and B; would you conclude their average number of events per day to be different

The dataset was over a period of a month.  It was a relational database where every event a was associated with a user and sent at a datetime.  I'll give an example of what the dataset looked like
user_id,time_of_event,event_name,event_parameters
A,2018-03-01 17:21:44, sign_up, '{"source": "mobile_app"}'
A,2018-03-01 17:21:54, start_tutorial, '{"experiment_group": "control"}'
B,2018-03-02 05:33:17, session_start, '{"session_medium": "webapp"}'
B,2018-03-02 05:36:35, add_to_cart, '{"item_id": 132156, "price": 12.99}'
...

I thought it was a pretty simple question, and my approach was pretty simple.

*

*Get the average number of events that user A over the month, adding in 0's for days on which they sent no events.

*Repeat 1 but for B.

*Compare the averages.

When I was given feedback on this test, I was told that this response was unsatisfactory because it lacked a "statistical approach" to coming to the answer.
What statistical approach could I have used to come to a higher quality answer?

What was probably meant by the feedback was that you didn't consider the possibility that, because of stochastic variations, the averages you computed could be deceiving. Even if e.g. the average number for A was larger than the average number for B, the real rate for A could still be smaller than that of B, just by chance. So what they were probably looking for was some kind of significance test.
The problem is that it is not really possible to properly apply such a test if we don't know more about how the data was generated. The way your test question is phrased might suggest that they expect you to presume a Poisson process. But from the description of the events in your data set excerpt, I could imagine that e.g. independence of the events is violated, which would, however, be required for the Poisson process.
Nevertheless, presuming that your test was not meant to be too difficult, I proceed assuming that the process is, indeed, a Poisson process. Thus we presume that the count of the events follows in both cases a Poisson distribution. The question now is whether there is significant evidence that the event rates are different. Fortunately, there exists for this situation an exact significance test, sometimes called the Poisson test, and the stats package in R even conveniently provides an implementation.
