I have a table in one of my MySQL databases with two columns of data that are correlated with each other. I'm trying to find out how to create the best-fit logarithmic equation of the form y = A * ln(x) - B for this data, basically trying to calculate A and B.
The data is below, and Excel says that the equation should be y = 0.021ln(x) - 0.089, but I want to calculate it inside MySQL since I'll have a lot of these and I'd like it to automate the process.
Any help would really be appreciated. Thanks!
01 | -0.23
02 | -0.04
03 | -0.05
04 | -0.05
05 | 0.03
06 | -0.01
07 | -0.05
08 | 0.00
09 | -0.03
10 | -0.03
11 | -0.04
12 | -0.04
13 | 0.01
14 | -0.03
15 | -0.04
16 | -0.02
17 | 0.01
18 | -0.03
19 | -0.05
20 | -0.01
21 | -0.04
22 | -0.07
23 | 0.00
24 | -0.06
25 | 0.02
26 | -0.04
27 | -0.01
28 | -0.08
29 | 0.00
30 | -0.03
31 | 0.01
32 | 0.02
33 | -0.18
34 | -0.12
35 | 0.02
36 | 0.06
37 | 0.02
Our community of experts have been thoroughly vetted for their expertise and industry experience.