Q-Q Diagram
Q-Q diagram is a scatter chart, corresponding to the normal distribution of Q-Q diagram, is from the Standard Normal Distribution of quantile for the abscissa, sample value for the ordinate scatter chart. to use the QQ plot to identify whether the sample data is similar to the normal distribution, you only need to check whether the points on the QQ plot are close to a straight line, and the slope of the straight line is the standard deviation, and the intercept is the mean. you can also obtain rough information about sample skewness and peaks using QQ charts.
The Q-Q diagram can be used to test the distribution of data. The difference is that the Q-Q diagram is used to test the relationship curve between the quantile of the variable data distribution and the quantile of the specified distribution. The P-P diagram and Q-Q diagram are used exactly the same, but there are differences in the test method
Since the P-P diagram and Q-Q diagram are used exactly the same, there is only a difference in the test method. To use the QQ plot to identify whether the sample data is similar to the normal distribution, you only need to check whether the points on the QQ plot are close to a straight line, and the slope of the straight line is the standard deviation, and the intercept is the mean.
You can also obtain rough information about sample skewness and peaks using QQ charts.
This article is about the programming of Q-Q diagrams:
Http://www.docin.com/p-44022618.html
There is an example of the r language for Q-Q and P-P graphs:
N = 100
A = rnorm (n) # generate 100 normal Random Variables
P = pnorm (a) # Calculate the positive state distribution function value (normal cumulative probability)
T = rank (a)/n # calculates the cumulative probability of observation.
Q = qnorm (t) # quantiles
Plot (P, T) # Draw a P-P Diagram
Plot (A, q) # Draw a Q-Q Diagram
Concepts about quantile:
Quantile
Quantile fractile
Quantile is also called a percentile or a lower quantile.
Definition
Set the distribution function of continuous random variable X to f (x), and the density function to p (x ). Then, for any 0 <p <1 P, it is called the quantile of f (x) = p x for this distribution, or the lower quantile. In short, quantile refers to a point in the continuous distribution function, which corresponds to probability P.
Other definitions
If the probability is 0 <p <1, the random variable X or the quantile za of its probability distribution. It refers to the real number that satisfies the condition p (x> za) = α.
Quantiles have three different names: Alpha quantile, upper Alpha quantile, and bilateral Alpha quantile. Their definitions are as follows:
When the distribution function of random variable X is f (x) and the real number α satisfies 0 <α <1, the Alpha quantile makes P {x <X α} = f (x α) = Alpha number X α,
The upper Alpha quantile is the number of P {x> λ} = 1-F (λ) = α λ,
Bilateral Alpha quantile is the number of P {x <λ 1} = f (λ 1) = 0.5 α λ 1, so P {x> λ 2} = 1-F (λ 2) = 0.5 α number λ 2, such as the quantile table of the tdistribution. The bilateral quantile values of degrees of freedom F = 20 and α = 0.10 are plus or minus 1.7247.