For plot 1, I can test the association between x and y by doing a simple correlation.

For plot 2, where the relationship is nonlinear yet there is a clear relation between x and y, how can I test the association and label its nature?

|
For plot 1, I can test the association between x and y by doing a simple correlation.
For plot 2, where the relationship is nonlinear yet there is a clear relation between x and y, how can I test the association and label its nature?
|
||||
|
|
|
...the relationship is nonlinear yet there is a clear relation between x and y, how can I test the association and label its nature? One way of doing this would be to fit $y$ as a semi-parametrically estimated function of $x$ using, for example, a generalized additive model and testing whether or not that functional estimate is constant, which would indicate no relationship between $y$ and $x$. This approach frees you from having to do polynomial regression and making sometimes arbitrary decisions about the order of the polynomial, etc. Specifically, if you have observations, $(Y_i, X_i)$, you could fit the model: $$ E(Y_i | X_i) = \alpha + f(X_i) + \varepsilon_i $$ and test the hypothesis $H_{0} : f(x) = 0, \ \forall x$. In
Typing
If your response variable is discrete (e.g. binary), you can accommodate that within this framework by fitting a logistic GAM (in |
|||||||||||||||||
|
|
If the nonlinear relationship had been monotonic rank correlation (Spearman's rho) would be appropriate. In your example there is a clear small region where the curve changes from monotoncally increasing to montonically decreasing like a parabola would do at the point where the first derivative equals $0$. I think if you have some modeling knowledge (beyond the empiricial information) where that change point occurs (say at $x=a$) then you can characterize the correlation as positive and use Spearman's rho on the set of $(x,y)$ pairs where $x < a$ to provide an estimate of that correlation and use another estimate of Spearman's correlation for $x>a$ where the correlation is negative. These two estimates then characterize the correlation structure between $x$ and $y$ and unlike a correlation estimate that would be near $0$ when estimated using all the data these estimates will both be large and opposite in sign. Some might argue that just the empirical information (i.e. the observed $(x,y)$ pairs is enough to justify this. |
|||||||||||||
|