C Library Functions  - midm (3)

NAME

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

CONTENTS

Synopsis
Description
Input Arguments
Output Arguments
Examples
Author
Maintainer
License
References

SYNOPSIS

SUBROUTINE MIDM(X,N,Iwrite,Xmidm)

       REAL(kind=wp) :: X(:)
       INTEGER       :: N
       INTEGER       :: Iwrite
       REAL(kind=wp) :: Xmidm

DESCRIPTION

MIDM(3f) computes the sample midmean = the sample 25% (on each side) trimmed mean of the data in the input vector X.

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 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.

OUTPUT ARGUMENTS

XMIDM The value of the computed sample midmean.

EXAMPLES

Sample program:

   program demo_midm
   use M_datapac, only : midm, label
   implicit none
   integer :: i
   real :: xmidm
      call label(’midm’)

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

Results:

    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.00000

The 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

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 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) July 22, 2023
Generated by manServer 1.08 from 75e064c7-8722-48f5-b319-d7ac8d7d1a2b using man macros.