mannwhitneyu(x, y) or wilcoxon(x, avg(y)) Let's say I measure the happyness of my dog over 100 consecutive days. The happyness is measured continuously, and then averaged over 4 bins - (Morning, Afternoon, Evening, Night). This gives us a 2D dataset of shape (4 x 100). I would like to test if my dog is most happy in the evening compared to the other three daily phases. What is the correct way to do that?
My ideas are:

*

*Concatenate the remaining 3 phases, and use MannWhitneyU test of 100 vs 300 samples.

*Average over the remaining 3 phases, and use Wilcoxon test of 100 vs 100 samples.

I feel that my null hypothesis is a bit sloppy. When there are only two phases, it is clear what to do, but when there are more I get a bit confused
 A: If your joint null hypothesis that happines is equal over all four times of day (i.e., over all four bins), and you do not want to make distributional assumptions about the happiness variable, then a Kruskal Wallis test kruskal.test() would be a test of choice to test exactly that. It is a generealization of the Wilcoxon/Mann-Whitney-U test for more than two groups.
Note that, in your example, measurements between day times are nested within days, which is variance component you might want to explicitly consider in your analysis: there might be days, for example at the weekends, which are overall a bit nicer for your dog. One way to achieve this in a (generalized) linear modelling framework with fixed or random intercepts for day. A simpler approach is to subtract the mean happiness of the day from each measurement before running your analysis, but note that you then implicitly make distributional assumptions.
By the way, depending on the data generating process and distribution you expect for your outcome, running a parametric test/model (ANOVA, GLM, ...) could be a way to lose less information. For example, if your dog rates happines on a scale from 1 to 5, a cumulative logit model could be a good choice.
