# Non-linear Relationship between two variables

Please allow me to explain the background for my questions first. I ran a specific test comprising of adding various doses of a certain chemical and then measuring the effect of these various doses on the cleanliness of a liquid product. I repeated the same test about 30 times, with the same doses each time (i.e., for each time I ran the test), and I would every time measure the same parameter related to the cleanliness of my product. Knowing that the relationship is non-linear, how can I see if there is a correlation between my dose and my cleanliness parameter? And if there is a correlation (strong, week, or non-existent), how do I find out from this correlation what would be the best dose to use in the future? Let me give you an example of what I am doing:

Let's say I have 5 jars. I add 10, 20, 30, 40 and 50 spoons of chemical to different jars. I add 10 to the first, 20 to the second, etc. Each jar contains the same volume of my liquid product to start with. These 5 doses (the 10, 20, 30, 40, 50) would be my first variable. After I am done my reaction time, I measure how clean the liquid product is (let's say how many sand particles there are). That measurement is my second variable (or the result of he experiment). Knowing that by adding more chemical does not mean cleaner product (it is a non-linear relationship), how can I see what the correlation is (if there is one), and how can I predict which dose of chemical will give me the cleaner liquid product? Remember that I also repeated the same experiment 30 or so times to see if the results are repeatable.

Please bare in mind that I am not a statistician, nor I understand statistics that well. It is important for me therefore to keep it simple and preferably do this in Excel.

When you say correlation, we usually think about Pearson's correlation that determines the strength of a linear relationship between two variables. If you have some unknown non-linear relationship between the variables - you shouldn't use Pearson's correlation! You will need to make some assumptions to proceed: is it a polynomial? is it periodic (sin,cos)? Then you can fit a family of functions with regression to the first variable and see how well you can approximate the second. For example use can use Root Mean Squared Error as a measure.

But if you have just a few data points, first thing to do is just to plot the variables and try to see some obvious pattern.

• There are clearly not just a few datapoints, and this answer misses the other core part of the question: the repeated measures. Commented Apr 27 at 2:52
• @ShawnHemelstrand the core part is the use of correlation in the case of a non-linear relationship. Commented Apr 28 at 9:13
• I don't think either point outweighs the other, the OP seemed to distinctly highlight both issues as important, hence my response. Commented Apr 28 at 11:31

You can use linear regression here. The equation you are estimating does not have to be linear, but the coefficients you estimate do.

For example, you can estimate B and A in y=B(x^2)+A but you cannot estimate them in y=x^B+A. If you wanted to estimate B and A in y=B(x^2)+A you would just square all your x values and run the linear regression.

In your case you may want to try a log transform on one of your variables, as such.

While asking for 'correlation', you might be looking for 'coefficient of determination' instead.

You could fit a non-linear model to your data (a simple way would be to just take the mean at each concentration) and compute the correlation between predictions and the measurements. It's square is the well known $$R^2$$.

• As I mentioned in my own answer, while I think you can average the measures at each dosage, this still comes at an information loss unless the measures are very precise. Commented Apr 28 at 11:32
• @ShawnHemelstrand isn't that what correlation is all about when it is used as a coefficient of determination? It is expressing the information loss when we use one variable to predict another. Commented Apr 28 at 13:07
• Thinking about it further, I think my original thoughts don't make sense here and your answer is probably more sensible. Commented Apr 28 at 13:22