midr(3f) - [M_datapac:STATISTICS] compute the midrange of a data vector
Synopsis
Description
Input Arguments
Output Arguments
Examples
Author
Maintainer
License
References
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
MIDR(3f) computes the sample midrange of the data in the input vector X.The sample midrange = (sample min + sample max)/2.
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.
XMIDR the value of the computed sample midrange.
Sample program:
program demo_midr use M_datapac, only : midr, label implicit none integer :: i real :: xmidr call label(midr)Results: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
The sample MIDRANGE of the 101 observations IS 0.500000000000000E+02 GOOD 50.00000Results:The sample MIDRANGE of the 102 observations is 0.505000000000000E+02 GOOD 50.50000
The original DATAPAC library was written by James Filliben of the Statistical Engineering Division, National Institute of Standards and Technology.
John Urban, 2022.05.31
CC0-1.0
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) | February 23, 2025 |