I am trying to do a linear regression of 2 columns as grouped by a 3rd column and am stuck. I want a column with slope for that row, and another with intercept for that row.
Short background:
I have 30k different formulations that have each been tested with 13 different levels of an acid. I want to understand the slope of the pH as a function of acid concentration. For my range (and purpose) I can do this as a linear regression.
My data table is set up such as this, but with 30k Formula Combos and 13 acid levels for a total of 390k rows.
| Formula |
Acid Level |
pH |
|---|
|
ComboA
|
5 |
6.7 |
| ComboB |
5 |
6.75 |
| ComboC |
5 |
6.5 |
| ComboA |
10 |
6.4 |
| ComboB |
10 |
6.45 |
I know that I can plot them in Fit Y by X, group the data, and then add linear fits but that 1) takes forever with 30k groups and 2) is a pain to pulls the slopes out of that report
I current have split my table by "Acid Level", splitting "pH", and keeping "Formula". I know have something like this, and want a way to fill in the right 2 columns.
| Formula |
ph 5 |
ph 10 |
ph 15 |
ph 20 |
Slope |
Intercept |
|---|
| ComboA |
data |
data |
data |
data |
|
|
| ComboB |
data |
data |
data |
data |
|
|
| ComboC |
data |
data |
data |
data |
|
|
First preference is to do with a formula. If I need to do a script, I can do that as well.
Thanks