CDF2P
Prints a plot of two sample cumulative distribution functions.
Required Arguments
NOBS1 — Size of sample one. (Input)
NOBS2 — Size of sample two. (Input)
X — Vector of length NOBS1 + NOBS2. (Input)
X contains sample one followed by sample two.
FORTRAN 90 Interface
Generic: CALL CDF2P (NOBS1, NOBS2, X)
Specific: The specific interface names are S_CDF2P and D_CDF2P.
FORTRAN 77 Interface
Single: CALL CDF2P (NOBS1, NOBS2, X)
Double: The double precision name is DCDF2P.
Description
Routine CDF2P plots two sample cumulative probability distribution functions (CDFs). Two samples are first merged and then sorted. The cumulative distribution functions are then calculated. On the plots, the characters “1” and “2” indicate the first and second samples, respectively, and the character “M” indicates multiple points.
Comments
1. Workspace may be explicitly provided, if desired, by use of C2F2P/DC2F2P. The reference is:
CALL C2F2P (NOBS1, NOBS2, X, WK, IWK)
The additional arguments are as follows:
WK — Work vector of length 3 * (NOBS1 + NOBS2).
IWK — Work vector of length NOBS1 + NOBS2.
2. Printing starts on a new page with default page width 78 and default page length 60. The user may change page width and length by calling the routine PGOPT in advance.
Example
The first sample consists of pseudo‑random numbers from a uniform (0, 1) distribution. Routines RNSET and RNUN (see Chapter 18, "Random Number Generation") are used to generate this sample. The second sample consists of points of the standard normal (Gaussian) distribution function generated by the routine ANORDF (see Chapter 17, "Probability Distribution Functions and Inverses").
 
USE IMSL_LIBRARIES
 
IMPLICIT NONE
INTEGER I, IPAGE
REAL VAL, X(100)
! Initialize the seed.
CALL RNSET (1234567)
! Generate pseudo-random numbers from
! a uniform (0,1) distribution.
CALL RNUN (X)
! Second sample consists of 50 points of
! the std normal distribution function.
VAL = 0.
DO 10 I=1, 50
VAL = VAL + .02
X(I+50) = ANORDF(VAL)
10 CONTINUE
! Set page width and length.
IPAGE = 78
CALL PGOPT (-1, IPAGE)
IPAGE = 40
CALL PGOPT (-2, IPAGE)
CALL CDF2P (50, 50, X)
END
Output
 
Cumulative Sample Distribution Functions
+::::::::::::::::+::::::::::::::::+::::::::::::22:2+22:M
0.95 + 2 1 +
. 22 1 1 .
. 2 1 1 .
. 2111 .
0.80 + 1 +
. M2 .
. 11M2 .
P . 11 2 .
r 0.65 + 111 2 +
o . 11111 22 .
b . 1 11111 22 .
a . 1 2 .
b 0.50 + 1 2 +
i . 11 22 .
l . 1 1 2 .
i . 1 22 .
t 0.35 + 1 1 2 +
y . 1 2 .
. 11 22 .
. 11 22 .
0.20 + 1 2 +
. 1 2 .
. 1 2 .
. 1 22 .
0.05 +1 1 22 +
M2:22::222:2222::+22:2222::::2::::+:::::::::::::::+::::
0.0 0.3 0.6 0.9
 
Sample values
Sample 1 = 1 Sample 2 = 2