Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I imported data from an Excel package and used LinearModelFit to return a FittedModel:

FittedModel[6.90762 - 0.999573 x]

How do I now calculate the RSquared value for my data and this model?

Similarly, I imported data from an Excel package and used NonlinearModelFit to return

FittedModel[1.0000321558268463` E^(-0.9990618380928935` time)]

How do I calculate RSquared for this as well?

share|improve this question

closed as off-topic by s0rce, Michael E2, Sjoerd C. de Vries, Ajasja, Verbeia Jan 14 at 22:26

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – s0rce, Michael E2, Sjoerd C. de Vries, Ajasja, Verbeia
If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

model["RSquared"]. Or if you prefer, model["AdjustedRSquared"]. NonlinearModelFit provides the same measures.

As described in the documentation for FittedModel (which is the output produced by these fitting commands), you can find the available properties for your fitted model using model["Properties"]

Typing "RSquared" into the documentation search will bring up this useful guide as one of the hits.

share|improve this answer

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