midm(3f) - [M_datapac:STATISTICS] compute the midmean of a data vector
Synopsis
Description
Input Arguments
Output Arguments
Examples
Author
Maintainer
License
References
SUBROUTINE MIDM(X,N,Iwrite,Xmidm)
REAL(kind=wp) :: X(:) INTEGER :: N INTEGER :: Iwrite REAL(kind=wp) :: Xmidm
MIDM(3f) computes the sample midmean = the sample 25% (on each side) trimmed mean of the data in the input vector X.
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 midmean 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 midmean at the time it is computed.
XMIDM The value of the computed sample midmean.
Sample program:
program demo_midm use M_datapac, only : midm, label implicit none integer :: i real :: xmidm call label(midm)Results:call midm([real :: (i,i=0,100) ],101,1,xmidm) write(*,*)merge(GOOD,BAD ,xmidm == 50.0),xmidm
call midm([real :: (i,i=0,101) ],102,1,xmidm) write(*,*)merge(GOOD,BAD ,xmidm == 50.5),xmidm
end program demo_midm
The sample MIDMEAN of the 101 observations is 0.50000000E+02 25.0000 PERCENT (=25 observations) of the data were trimmed from below 25.0000 PERCENT (=25 observations) of the data were trimmed from above 50.0000 PERCENT (=51 observations) of the data remain in the middle ... after the trimming GOOD 50.00000The sample MIDMEAN of the 102 observations is 0.50500000E+02 25.0000 PERCENT (=25 observations) of the data were trimmed from below 25.0000 PERCENT (=25 observations) of the data were trimmed from above 50.0000 PERCENT (=52 observations) of the data remain in the middle ... after the trimming 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 David, Order Statistics, 1970, pages 129, 136. o Crow and Siddiqui, Robust Estimation of Location, Journal of the American Statistical Association, 1967, pages 357, 387. o Filliben, Simple and Robust Linear Estimation of the Location Parameter of a Symmetric Distribution (Unpublished PH.D. Dissertation, Princeton University, 1969).
Nemo Release 3.1 | midm (3) | February 23, 2025 |