Mathematica Asked on September 5, 2021
With
data = {{0.002, 2.51053}, {0.004, 2.54217}, {0.006, 2.55543}, {0.008, 2.54247}};
I obtain a linear fit 2.51038 + 5.454 x
; now I want to get the 95% confidence interval from linear regressions. when I do it with Mathematica, it gives me a pair of data set for the CI. I want to add the CI to x -> 0.000717263
, but I don’t know how to interpret that.
Is this what you want?
data = {{0.002, 2.51053}, {0.004, 2.54217}, {0.006, 2.55543}, {0.008, 2.54247}};
lm = NonlinearModelFit[data, a x + b, {a, b}, x]
bands[x_] = lm["MeanPredictionBands", ConfidenceLevel -> .95]
Show[ListPlot[data],
Plot[{lm[x], bands[x]}, {x, 0, 0.01}, Filling -> {2 -> {1}}],
Frame -> True, Axes -> False, PlotRange -> All]
bands[0.000717263]
{2.44077, 2.58781}
Answered by corey979 on September 5, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP