I am looking for a good software for fitting curves and would like to hear what software other people recommend. I want to be able to fit 4- and 5- parameter logistic curves and linear regression. Any suggestions?
Hi Anette, I would suggest using R, which will also allow you to learn some more about the statistical background of "curve fitting", which is usually a regression analysis.
R is definetily the best option, though it requires some training / practising time. SPSS is also an option but rather obscure (my opinion) when it comes to logistic regression. For nonlinear fitting, Matlab apps in the newest versions of the software are user-friendly and a good option as well, though I'm not sure how the R-squared values are computed in these apps.
well I suggest the very accessible soft ware ..... Microsoft -excel.... irrespective of certain drawback its good for determination of curve fitting. Even graph pad is also a good alternative
Learning to use R for this is probably the best choice you could make. When I first started using R for curve fitting, I found the book "An R Companion to Applied Regression" by Fox and Weisberg to be a tremendous tool to jump start my learning process. This book contains code and instruction to do much of what you could want to do with linear and generalized linear models. Good luck!
Besides R, which is unambiguously a great choice and my personal choice of preference, Matlab's "Curve Fitting Toolbox" is also another good choice; the latter provides a nice graphical interface (GUI), which facilitates curve fitting. You may find more information here http://www.mathworks.com/products/curvefitting/.
Dear Anette, since you are going to work in fitting logistic curves, do not forget that by using R you have the option to compute also their inflection point without doing any kind of regression: Just take the (xi,yi) data, use R package 'inflection':
Excel is fine and it's much more transparent than specialist packages for simple jobs. Matlab is super expensive and is not easy to master. R, similarly, is really for specialists, it has a steep learning curve. So, Excel.
All that is required is to create a chart (scatterplot) from your datapoints. Then go to Chart Tools - Layout - Trendline and select More trendline options. You will be given options for Trend/Regression type: Exponential, Linear, Logarithmic, Polynomial, Power and Moving Average.
Another quick option is Graphmatica (a free download from Graphmatica.com). This program provides the option for plotting data points (dataplot) and fitting a curve. The curve fitting options are: polynomial, sinusoidal, exponential, logisitic, power, and logarithmic.
I'd say R is your best bet. Other than that, look at SAS, Stata, and SPSS; even Excel will give you some capability to start, but don't get stuck in Excel...
I agree that the built in trendlines in Excel are worse than useless, but there's nothing to stop you fitting any model you can dream of using the Solver Add-In to minimize a sum of squared errors.
You can also try Graph Pad Prism, there is available a 4 week test version for free. I recommend it to my students, who don't have too much time to learn SAS, SPSS or R and need to do a fitting curve, area under curve or decay analysis. It is easy to handle especially if you need to do more than one curve at the same time.
A nice software is called MicroCase, it is normally used by Political Scientists but it's a simple yet elegant and interactive way of exploring curves, observations that influence the model fittness and how the model would be without influential data. It is a nice software but according to the persons who introduced me to it, it is frowned upon for publication purposes.
I am going to agree with Dan Gwinn here. I started using R for curve fitting as well and its a great little problem to get to grips with and also end up learning R in the bargain. You would be wasting this opportunity to learn a really powerful analytical software if you settle to do this in Excel.
If you have candidate models to fit, I would start of by using the 'nls' function in R (non-linear least squares) and then progressing to more complex methods. The syntax is quite similar to fitting a linear or generalized linear model, but like in all curve fitting exercises figuring out the starting parameters which the function uses to make initial guesses of the true parameter values is critical. The more number of parameters you have, the trickier it gets. But there are some built in methods in the nls function which you may want to explore.
Varun, i agree, but I wouldn't start with nls() as a familiarization tool. Go with lm() instead: the linearity is in parameters, not in independent variables, and it very nicely covers a huge landscape of regressions. The nls() is very powerful, but it requires that you provide it with initial values; it may fail to converge on the solution, it will mistake a non-normal distribution for an effect of nonlinearity, etc. It's much more complicated than lm() or even rq () of the quantreg package in R.
100% agree with Alex and apologies to the followers of this discussion.
If the candidate models/equations to fit the data to can be linearised, lm() should be your starting point.
As I have pointed out in my previous post and reiterated by Alex, nls() does require the user to specify the starting values of the parameters to estimate. If the equation for the curve is simple (e.g. low number of parameters) this can even be left to the nls() function (in most cases such equations can be solved using lm() anyway). However, the more complex the equation gets, the user needs to specify a function to make the initial guesses, or else nls() will not converge. This can be quite a task for a beginner in R.
For Linear regression curves you can use simple Microsoft Excel workbook. To fit 4- and 5- parameter logistic curves i strongly recommend to use "SigmaPlot" software (30 day free trial / Paid version). Alternatively you can use predesigned Excel for 4 and 5-P logistric curves as said by Mr.Shailesh. Apart from these you can use online or off-line add-in tools from MyAssays for Microsoft Excel.
I am not a professional statistician but have had great success with Graph Pad Prism. It is quite flexible and has a much shorter learning curve than R, SAS, SPSS etc.
However, if you need a quick answer, with a some flexibility of the model, then you can use
http://www.mycurvefit.com – it is free and very easy to use.
For assays such as ELISA another free webpage from the same group is http://www.myassays.com. This will easily do 4PL or 5PL curve fits from microplate data
It depends on the complexity of your work. Excel is able to do simple fitting jobs, but I recommend Matlab for more complicated fittings. You can define your desired fitting method specifically there.
@sapna this video shows how to do it: https://www.youtube.com/watch?v=DOCzyB8zj-8
Basically the steps are:
- put your data in two columns, one of x values and one of y values
- write down your model - e.g. logistic has the form y = L/(1+exp(-k*(x-h)))
- put your model parameters (initial guess values of L,k,h) in separate cells off to the side (e.g. $A$1, $A$2, $A$3)
- add a "ymodel" column which calculates the model equation for each x value, using the parameter cells (the dollar signs prevent the cell address from changing) e.g. = $A$1/(1+exp(-$A$2*(-$A$3))) where is the cell in the x column.
- you can plot x against y and ymodel
- add a "sqe" column which is the squared error of the difference, = (-)^2. In the video he uses relative squared error (divides by y), which I don't recommend for most problems.
- add a "ssqe" cell (e.g. $A$5) which is the sum of the sqe column
- open the Solver Add-in (make sure it is installed under File|Options|Add-ins).
- put the variable cells ($A$1, $A$2, $A$3) and objective ($A$5) is the appropriate boxes and check "Min" for minimise.
- Click "Solve", which changes $A$1, $A$2, $A$3 until $A$5 is minimised.
This method works for a wide variety of models. There are a few tricks, like making sure that the model equation doesn't give an error for any parameter values. You can also add constraints on the parameter values in the Solver dialogue box.