How to statistically detect a treshold effect over a dependent variable measured repeated times on the same population I want to identify the level of a predictive variable X (with Gaussian distribution) able to induce a reduction in a variable y (with Poisson distribution), that has been measured over the same population, several times per day and across several days.
Here is a dataframe I am using to think about it, I have been unable to grasp a sound strategy for analysis. One worrying issue that seems to appear is that  the combination of these two variables leads to a scatter that might be confounded with a threshold imposed by x on y.
Would anybody have a suggestion to detect such a threshold reliably, should it exist?
     hour=rep(1:24,30)
     DOY=rep(1:30, each=24)
     x=rnorm(length(hour), mean=15, sd=3)
     y=rpois(length(hour), lambda=10)
     df=data.frame(y, x, hour, DOY)
     plot(y ~ x)


I would suggest a model such as:
glmer(y ~ x + (1 | DOY), family = "poisson")

Following comments on the question:

Do you think that would find the threshold?

When you say "find the threshold", all you can do is to fit  a model which estimates this threshold (effect size). Once fitted you can assess the output as to whether the effect size is meaningful.

or simply tell me whether or not there is a significant change in Y due to X?

It will estimate the effect size. Then you can assess this as to whether it is meaningful or not. Since you mention "significant", if you compute a p-value this will tell you the probability of observing this effect size, or indeed a larger one, if in fact the effect size was zero.
If you want to be able to detect a particular effect size, at a given level of statistical significance, then you should do a power calculation which will inform you of the sample size you need.
