"LISHAN RAN" <ranlishan@gmail.com> wrote in message <i4vioi$qcu$1@fred.mathworks.com>...
> Hello,
>
> I have 2 variables (precipitation and temperature) and plot them on a LogLog axes using matlab, now I want to use linear regression method to calculate the slope (the change rate of precipitation with increasing temperature). So I use the ezyfit toolbox to fit the plots, but I could not get a straight line but rather a curve. Could someone help how to do a linear regression on a LogLog plot? Thanks a lot in advance!
What do you mean by a loglog plot? are transforming your variables to log scales? let say that x = precepitation and y = temp, so g = log(x) and p = log(y) and it is g and p what you are plotting and what you want to do a regression analysis? it this is the case, then you need to use 'regress' function in matlab. you will need to specify your design matrix, and remember to include your vector of ones in it (i believe that you would like to include the intercept). then you will need to plot a scatter graph of g and p and over impose the fitted line given by the coefficients in 'regress'. You find many example of how to use 'regress' in the help browser of matlab.
