Program g08aefe
! G08AEF Example Program Text
! Mark 26.1 Release. NAG Copyright 2016.
! .. Use Statements ..
Use nag_library, Only: g08aef, nag_wp, x04caf
! .. Implicit None Statement ..
Implicit None
! .. Parameters ..
Integer, Parameter :: nin = 5, nout = 6
! .. Local Scalars ..
Real (Kind=nag_wp) :: fr, p
Integer :: i, ifail, k, ldx, n
! .. Local Arrays ..
Real (Kind=nag_wp), Allocatable :: w1(:), w2(:), x(:,:)
! .. Executable Statements ..
Write (nout,*) 'G08AEF Example Program Results'
Write (nout,*)
! Skip heading in data file
Read (nin,*)
! Read in the problem size
Read (nin,*) k, n
ldx = k
Allocate (x(ldx,n),w1(k),w2(k))
! Read in data
Read (nin,*)(x(i,1:n),i=1,k)
! Display title
Write (nout,*) 'Friedman test'
Write (nout,*)
Flush (nout)
! Display input data
ifail = 0
Call x04caf('General',' ',k,n,x,ldx,'Data values',ifail)
! Perform ANOVA
ifail = 0
Call g08aef(x,ldx,k,n,w1,w2,fr,p,ifail)
! Display results
Write (nout,*)
Write (nout,99999) 'Test statistic ', fr
Write (nout,99998) 'Degrees of freedom ', k - 1
Write (nout,99999) 'Significance ', p
99999 Format (1X,A,F6.3)
99998 Format (1X,A,I6)
End Program g08aefe