# Estimating the distribution of a variable

I am trying to estimate (fit) the distribution of a variable. The first step in doing so is to draw a normal probability plot. This is what I have obtained (using R):

qqnorm(x)
qqline(x)


This is the histogram of the data:

As you can see, there is a quadratic pattern in the normal probability plot, but most point fall ABOVE the reference line. The end purpose for this analysis is to detect outliers. Estimating the distribution of this variable would allow me to determine the threshold to set to determine outliers.

What can we deduce from both the normality plot and the histogram, in terms of the distribution of x, and the outliers?

Thank you!

• Is this an exercise for some subject? Commented Apr 11, 2014 at 15:04
• No, I am a research analyst. Commented Apr 11, 2014 at 15:25
• Then could you explain the point of doing these things? Why do you think they're necessary? What is the ultimate aim? Commented Apr 11, 2014 at 15:27
• Great reference for fitting distributions and qq plots in R: statmethods.net/advgraphs/probability.html Commented Apr 11, 2014 at 20:22
• What makes the two components asymptotically chi-square? What is 'asymptotic' here? Are these squared residuals or something? Commented Apr 11, 2014 at 23:44

## 3 Answers

I would plot kernel density distribution, that would give an idea of the shape of the PDF. Then you can think which distribution to try. In Matlab you can use ksdensity function, it will plot empirical probability distribution.

Better yet to think of the phenomenon you're studying and that may give an idea of what distribution is suitable.

Sums of $\chi^2$ r.v.s are $\chi^2$, where d.f. is a sum of d.f.s of constituents, see this note

if $\xi\sim\chi^2_\nu$, then $c\xi\sim\Gamma(\nu/2,2c)$ according to wiki

• Thank you!!! How about the product of chi-square with a constant? Is it a chi-square? How many degrees of freedom does it have? Commented Apr 11, 2014 at 19:06
• product is complicated, take a look at this paper on moments. Commented Apr 11, 2014 at 19:08
• Well I mean the product of a chi-square r.v. with a constant, NOT with another chi-square. Is that complicated too? Commented Apr 11, 2014 at 19:09
• That must be very easy to scale. Commented Apr 11, 2014 at 19:11
• I am not sure how to scale the degrees of freedom. If you are multiplying a chi-square by 1/2, does it mean that the resulting variable has HALF the degrees of freedom? Commented Apr 11, 2014 at 19:12

The data are clearly not normally distributed.

I really don't think there's any point in looking for points that would be outlying if it were normal. None of the points look to be outliers to me.

What is the actual problem being solved here? Why would it be important to identify the distribution of the data? Why would the data have a distribution of simple form?

It might be interesting to consider looking at similar displays for the logs of the data.

A hint: when doing histograms, use relatively more bars (I'd suggests leaning toward roughly doubling the default); the R defaults are too low.

--

If you know your values are close to chi-square, and you're looking at a sum of such, then the combined variable should presumably also be close to chi-square. As such a Q-Q plot against the corresponding chi-square quantiles (with the relevant degrees of freedom) would be the obvious thing to use to identify points that don't fit with that model.

If you don't know the d.f. for these variables, the cube root should be approximately normal (the Wilson-Hilferty transformation), so a QQ plot of the cube roots against normal quantiles could be effective at identifying unusual points in that case.

This is clearly a positive-valued distribution. There are many options to consider, for example, see http://en.wikipedia.org/wiki/Survival_analysis#Distributions_used_in_survival_analysis

In addition to the options listed there, you may try lognormal. To test for it, simply log all your data, and make a qqnorm of the result. Logging might also help with outliers. If the result looks roughly normal, then you can use a traditional procedure for outliers (such as making a boxplot in R and asking it to flag the outliers).

I'm not aware of nice equivalents to normal q-q plot in R. However, Minitab (of which you might get a trial copy) has an easy-to-use battery of q-q plots oriented towards fitting a distribution: Gamma, Weibull etc etc