C Library Functions  - midr (3)

NAME

midr(3f) - [M_datapac:STATISTICS] compute the midrange of a data vector

CONTENTS

Synopsis
Description
Input Arguments
Output Arguments
Examples
Author
Maintainer
License
References

SYNOPSIS

SUBROUTINE MIDR(X,N,Iwrite,Xmidr)

       REAL(kind=wp),intent(in)  :: X(:)
       INTEGER,intent(in)        :: N
       INTEGER,intent(in)        :: Iwrite
       REAL(kind=wp),intent(out) :: Xmidr

DESCRIPTION

MIDR(3f) computes the sample midrange of the data in the input vector X.

The sample midrange = (sample min + sample max)/2.

INPUT ARGUMENTS

X The vector of (unsorted or sorted) observations.
N The integer number of observations in the vector X.
IWRITE An integer flag code which (if set to 0) will suppress the printing of the sample midrange as it is computed; or (if set to some integer value not equal to 0), like, say, 1) will cause the printing of the sample midrange at the time it is computed.

OUTPUT ARGUMENTS

XMIDR the value of the computed sample midrange.

EXAMPLES

Sample program:

   program demo_midr
   use M_datapac, only : midr, label
   implicit none
   integer :: i
   real :: xmidr
      call label(’midr’)

call midr([real :: (i,i=0,100) ],101,1,xmidr) write(*,*)merge(’GOOD’,’BAD ’,xmidr == 50.0),xmidr

call midr([real :: (i,i=0,101) ],102,1,xmidr) write(*,*)merge(’GOOD’,’BAD ’,xmidr == 50.5),xmidr

end program demo_midr

Results:

    The sample MIDRANGE of the 101 observations IS  0.500000000000000E+02
    GOOD   50.00000

The sample MIDRANGE of the 102 observations is 0.505000000000000E+02 GOOD 50.50000

Results:

AUTHOR

The original DATAPAC library was written by James Filliben of the Statistical Engineering Division, National Institute of Standards and Technology.

MAINTAINER

John Urban, 2022.05.31

LICENSE

CC0-1.0

REFERENCES

o Kendall and Stuart, The Advanced Theory of Statistics, Volume 1, Edition 2, 1963, page 338.
o Kendall and Stuart, The Advanced Theory of Statistics, Volume 2, Edition 1, 1961, page 91.
o David, Order Statistics, 1970, page 97.
o Dixon and Massey, Introduction to Statistical Analysis, Edition 2, 1957, page 71.


Nemo Release 3.1 midr (3) July 22, 2023
Generated by manServer 1.08 from 10ebc630-3d2c-4720-a976-4db682779ad8 using man macros.