Reputation: 27392
I have a table in excel. The first column is the values for the independent variable. The other columns are sets of data for the dependent variable. I want to fit each data set to the langmuir equation: y=Ax/(1+Bx). Is there a way to write a function that will find A and B for each column?
Upvotes: 2
Views: 4767
Reputation: 5785
You can do this in Excel with the Solver plug-in. You'll need to add the following to your sheet:
=$F$2*A2/(1+$F$3*A2)
, where F2 and F3 are your A and B coefficients, and A2 is the first independent variable value.{=SQRT(AVERAGE((B2:B28-C2:C28)^2))}
(Enter the formula by pressing Ctrl+Shift+Enter.) Here B2:B28 is the dependent variable data you are fitting, and C2:C28 is the data for the regression function.Now you are set up to use Solver to fit your regression function. Set Solver to minimize the residual while changing the A and B coefficients.
You should be able to handle all your data sets programmatically from here on out with a procedure similar to the following:
Upvotes: 3