Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a LogLog plot, and i'm unsure about how to fit a line to it. The data represents a calibration curve.

 calibdata = {{1, 39270.4}, {0.01, 4982.57}, {0.001, 1153.55}}
 ListLogLogPlot[calibdata, PlotMarkers -> {Automatic, Medium}]
share|improve this question
LinearModelFit[Log10@calibdata, x, x]? – Kuba Feb 17 '14 at 7:02

There a number of approaches. This is a start (amplifying Kuba's comment):

lm = LinearModelFit[Log10@calibdata, {1, x}, x];
param = lm["ParameterTableEntries"]
coeff = First@Transpose@param
fun[x_] := 10^#1 x^#2 &@@ coeff

The parameters:

{{4.6208, 0.0963769, 47.945, 0.0132762}, {0.501766, 0.046298, 10.8378,

Note the linear relationship is of borderline significance (slope coefficient is second row with p-value as last entry of this row). You can display the formatted table using lm["ParameterTable"].

The coefficient (point estimates):

{4.6208, 0.501766}

The power law fit can be displayed:



41763.4 a^0.501766

Visualizing fit:

enter image description here

Show[p1, LogLogPlot[fun[x], {x, 0.001, 1}]]

where p1 is original ListogLogPlot.

You can explore other "diagnostics" and standard errors (will need to be back transformed) for prediction bands (try lm["Properties"] or whatever you name you model object and review documentation: LinearModelFit)

share|improve this answer
calibdata = {{1, 39270.4}, {0.01, 4982.57}, {0.001, 1153.55}};
fit = LinearModelFit[Log10@calibdata, x, x];
% // Normal

4.6208 + 0.501766 x

Plot[Normal@fit, {x, -4, 1}, Axes -> False, Frame -> True, 
                             Epilog -> {PointSize@.02, Point@Log10@calibdata}]

enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.