* G02BHF Example Program Text * Mark 14 Revised. NAG Copyright 1989. * .. Parameters .. INTEGER M, N, NVARS, LDX, LDSSP, LDR PARAMETER (M=4,N=5,NVARS=3,LDX=N,LDSSP=NVARS,LDR=NVARS) INTEGER NIN, NOUT PARAMETER (NIN=5,NOUT=6) * .. Local Scalars .. INTEGER I, IFAIL, J, MISTYP, NCASES * .. Local Arrays .. DOUBLE PRECISION R(LDR,NVARS), SSP(LDSSP,NVARS), STD(NVARS), + X(LDX,M), XBAR(NVARS), XMISS(M) INTEGER KVAR(NVARS), MISS(M) * .. External Subroutines .. EXTERNAL G02BHF * .. Executable Statements .. WRITE (NOUT,*) 'G02BHF Example Program Results' * Skip heading in data file READ (NIN,*) READ (NIN,*) ((X(I,J),J=1,M),I=1,N) KVAR(1) = 4 KVAR(2) = 1 KVAR(3) = 2 MISTYP = 0 WRITE (NOUT,*) WRITE (NOUT,99999) 'Number of variables (columns) =', M WRITE (NOUT,99999) 'Number of cases (rows) =', N WRITE (NOUT,*) WRITE (NOUT,*) 'Data matrix is:-' WRITE (NOUT,99998) (J,J=1,M) WRITE (NOUT,99997) (I,(X(I,J),J=1,M),I=1,N) WRITE (NOUT,*) * * Set up missing values before calling routine * MISS(1) = 0 MISS(2) = 1 MISS(3) = 0 MISS(4) = 1 XMISS(2) = 0.0D0 XMISS(4) = 0.0D0 IFAIL = 1 * CALL G02BHF(N,M,X,LDX,MISS,XMISS,MISTYP,NVARS,KVAR,XBAR,STD,SSP, + LDSSP,R,LDR,NCASES,IFAIL) * IF (IFAIL.LT.0) THEN WRITE (NOUT,*) WRITE (NOUT,99999) ' ** G02BHF returned with IFAIL = ', IFAIL ELSE IF (IFAIL.NE.0) THEN WRITE (NOUT,99999) 'Routine fails, IFAIL =', IFAIL ELSE WRITE (NOUT,*) 'Variable Mean St. dev.' WRITE (NOUT,99995) (KVAR(I),XBAR(I),STD(I),I=1,NVARS) WRITE (NOUT,*) WRITE (NOUT,*) + 'Sums of squares and cross-products of deviations' WRITE (NOUT,99998) (KVAR(I),I=1,NVARS) WRITE (NOUT,99996) (KVAR(I),(SSP(I,J),J=1,NVARS),I=1,NVARS) WRITE (NOUT,*) WRITE (NOUT,*) 'Correlation coefficients' WRITE (NOUT,99998) (KVAR(I),I=1,NVARS) WRITE (NOUT,99996) (KVAR(I),(R(I,J),J=1,NVARS),I=1,NVARS) WRITE (NOUT,*) WRITE (NOUT,99999) 'Number of cases actually used:', NCASES END IF END IF * 99999 FORMAT (1X,A,I5) 99998 FORMAT (1X,4I12) 99997 FORMAT (1X,I3,4F12.4) 99996 FORMAT (1X,I3,3F12.4) 99995 FORMAT (1X,I5,2F11.4) END