      PROGRAM STATSDEM
      INCLUDE 'STDHDR.FOR'
      REAL storedata(0:maxr, 0:maxc)
      REAL minima(0:maxc), maxima(0:maxc)
      REAL range(0:maxc), sumxx(0:maxc)
      REAL mean(0:maxc), variance(0:maxc), stddev(0:maxc)
      REAL semean(0:maxc), mode(0:maxc)
      INTEGER numobs, numiv

      storedata(0, 0) = 305.0
      storedata(0, 1) = 35.0
      storedata(1, 0) = 130.0
      storedata(1, 1) = 98.0
      storedata(2, 0) = 189.0
      storedata(2, 1) = 83.0
      storedata(3, 0) = 175.0
      storedata(3, 1) = 76.0
      storedata(4, 0) = 101.0
      storedata(4, 1) = 93.0
      storedata(5, 0) = 269.0
      storedata(5, 1) = 77.0
      storedata(6, 0) = 421.0
      storedata(6, 1) = 44.0
      storedata(7, 0) = 195.0
      storedata(7, 1) = 57.0
      storedata(8, 0) = 282.0
      storedata(8, 1) = 31.0
      storedata(9, 0) = 203.0
      storedata(9, 1) = 92.0

      numobs = 10
      numiv = 2

      CALL SummaryStats(storedata, numobs, numiv, minima,
     + maxima, range, sumxx, mean, variance, stddev, semean, mode)

      WRITE (*,*) 'Summary statistics for storedata'
      DO i = 0, numiv - 1
        WRITE (*,*) '        Variable #', i + 1
        WRITE (*,*) 'Number of observations =', numobs
        WRITE (*,10)  'minima =                  ', minima(i)
        WRITE (*,10)  'maxima =                  ', maxima(i)
        WRITE (*,10)  'range =                   ', range(i)
        WRITE (*,10)  'mean =                    ', mean(i)
        WRITE (*,10)  'sum =                     ', sumxx(i)
        WRITE (*,10)  'variance =                ', variance(i)
        WRITE (*,10)  'standard deviation =      ', stddev(i)
        WRITE (*,10)  'standard error of mean =  ', semean(i)
        WRITE (*,10)  'mode =                    ', mode(i)
10      FORMAT (A28,f9.2)
      END DO
      WRITE (*,*) 'Press carriage return to end program. '
      READ (*,*)


      END



