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 have estimated the distribution for a set of data as LogisticDistribution[3.5, 1.037]. How can I calculate and plot the coefficient of determination (R squared) with the PDF of the distribution?

Here is the quantile-quantile plot:

q-q plot

share|improve this question
$R^2$ isn't really the appropriate thing to compute here, since that's intended for regression with independent and dependent variables. However, you might want to look at DistributionFitTest[], which provides a number of tests for seeing how well a particular distribution conforms to your variates. –  Guess who it is. Jun 8 '13 at 17:23
@0x4A4D I want to have R2 .I have the visual PDF plot cover the histogram very well but the DistributionFitTest[] shows near zero.How could it possible?How can have R2 anyway? –  Alex Jun 8 '13 at 17:29
If you're talking about the $p$-values, then it's a good sign that your $p$-values are near zero. You might want to read up on them... –  Guess who it is. Jun 8 '13 at 17:33
@0x4A4D actually all of the test results are zero but it still shows strenge numbers like exp(-740) .How can I report them? still I think showing plot with R2 would be helpful? –  Alex Jun 8 '13 at 17:55
It fits quite poorly in the tails of the distribution. Most of the tests available to DistributionFitTest are particularly sensitive to departures in the tail which would explain the small p-values. It also appears that you have a lot of data so it isn't surprising that you would get near zero p-values with a departure that is visible to the eye like this. –  Andy Ross Jun 8 '13 at 21:01

Your Answer


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

Browse other questions tagged or ask your own question.