I have a dataset consisting of pairs of real numbers. For example:

(1.2, 3.4), (3.2, 2.7), ..., (4.2, 1.0)


(x1, y1), (x2, y2), ..., (xn, yn)

I want to know if the second variable depends on the first one (it is known in advance that if there is a dependency, it is very weak, so it is hard to detect).

I split the data set into two parts using the first number (Xs). Then I use the mean of Ys for the first and the second sub-sets as "predictions". If find such a split that the squared deviation between the predictions and real values of Ys is minimal. Basically I do what is done by decision trees.

Now I wont to know if the found split and the corresponding difference between the two means is significant. I could use some standard test to check if the means of two sets are statistically significantly different but, I think, it would be incorrect because we did the split that maximise this difference. What would be the way to count for that?

  • 2
    $\begingroup$ It is nearly always inadvisable to split, even moreso when dependency is weak, since it loses information, inflates variances and biases effects $\endgroup$
    – Glen_b
    Apr 9, 2019 at 2:10
  • $\begingroup$ @Glen_b, I need to split to have a "predictive model". With this simple "model" and can tell something about Y given X. However, in the end, I need to know if the model does something (if results are significant). $\endgroup$
    – Roman
    Apr 9, 2019 at 7:18
  • $\begingroup$ It sounds like you have 2 variables, $X$ and $Y$, with $n$ total observations, and you wish to uncover a hypothesiszed association between them. Is this correct ? $\endgroup$ Apr 11, 2019 at 8:48
  • 1
    $\begingroup$ " the question is specifically about "predictive power" of the step function" - your question doesn't mention the step function at all. You question states "I want to know if the second variable depends on the first one" but then you talk about splitting the data without any reasoning why you do so. As stated by @Glen_b, this rarely makes sense. I think you need to add a lot more detail into the question about what you are doing, and why. $\endgroup$ Apr 12, 2019 at 10:12
  • 3
    $\begingroup$ I would call that, subsetting, not a step function, anyway, thanks for clarifying that, but I note you have chosen not to explain why you are doing this. If you can provide the motivation behind the question it is easier for people to understand and give advice. $\endgroup$ Apr 12, 2019 at 11:11

1 Answer 1


You have two continuous variables and you want to quantify the relationship between them. This is a classic regression problem, and no splitting is needed (or useful) based on the information presented. Depending on the nature of the relationship, you could instead use linear regressions, nonlinear regressions, GAMs, random forests, or one of a number of other methods to describe and quantify the bivariate relationship.


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.