* G02BYF Example Program Text * Mark 17 Release. NAG Copyright 1995. * .. Parameters .. INTEGER NIN, NOUT PARAMETER (NIN=5,NOUT=6) INTEGER LDX, MMAX, LDP, LDR PARAMETER (LDX=20,MMAX=10,LDP=MMAX,LDR=MMAX) * .. Local Scalars .. INTEGER IFAIL, J, K, M, N, NX, NY * .. Local Arrays .. DOUBLE PRECISION P(LDP,MMAX), R(LDR,MMAX), STD(MMAX), + WK(MMAX*MMAX), WT(LDX), X(LDX,MMAX), XBAR(MMAX) INTEGER ISZ(MMAX) * .. External Subroutines .. EXTERNAL G02BXF, G02BYF, X04CAF * .. Executable Statements .. WRITE (NOUT,*) 'G02BYF Example Program Results' * Skip heading in data file READ (NIN,*) READ (NIN,*) N, M IF (M.LE.MMAX .AND. N.LE.LDX) THEN READ (NIN,*) ((X(J,K),K=1,M),J=1,N) * * Calculate correlation matrix * IFAIL = 1 * CALL G02BXF('U',N,M,X,LDX,WT,XBAR,STD,R,LDR,P,IFAIL) * IF (IFAIL.EQ.0) THEN * * Print the correlation matrix * WRITE (NOUT,*) CALL X04CAF('Upper','Non-unit',M,M,P,LDP, + 'Correlation matrix',IFAIL) READ (NIN,*) NY, NX READ (NIN,*) (ISZ(J),J=1,M) * * Calculate partial correlation matrix * IFAIL = 1 * CALL G02BYF(M,NY,NX,ISZ,R,LDR,P,LDP,WK,IFAIL) * IF (IFAIL.EQ.0) THEN * * Print partial correlation matrix * WRITE (NOUT,*) CALL X04CAF('Upper','Unit',NY,NY,P,LDP, + 'Partial Correlation matrix',IFAIL) ELSE WRITE (NOUT,*) WRITE (NOUT,99999) ' ** G02BYF returned with IFAIL = ', + IFAIL END IF ELSE WRITE (NOUT,*) WRITE (NOUT,99999) ' ** G02BXF returned with IFAIL = ', + IFAIL END IF END IF * 99999 FORMAT (1X,A,I5) END