C Library Functions  - loc (3)

NAME

loc(3f) - [M_datapac:STATISTICS] print the sample mean, midrange, midmean, and median

CONTENTS

Synopsis
Description
Input Arguments
Output
Examples
Author
Maintainer
License
References

SYNOPSIS

SUBROUTINE LOC(X,N)

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

DESCRIPTION

LOC(3f) computes 4 estimates of the location (typical value, measure of central tendency) of the data in the input vector X.

the 4 estimators employed are--

1. the sample midrange;
2. the sample mean;
3. the sample midmean; and
4. the sample median.

The above 4 estimators are near-optimal estimators of location for shorter-tailed symmetric distributions, moderate-tailed distributions, moderate-long-tailed distributions, and long-tailed distributions, respectively.

INPUT ARGUMENTS

X The vector of (unsorted or sorted) observations.
N The integer number of observations in the vector X.

OUTPUT

1/4 page of automatic output consisting of the following 4 estimates of location for the data in the input vector X

1. The sample midrange;
2. The sample mean;
3. The sample midmean; and
4. The sample median.

EXAMPLES

Sample program:

     program demo_loc
     use M_datapac, only : loc, label
     implicit none
     integer ::  i
     real, allocatable ::  x(:), y(:)
        call label(’loc’)
        y=[(real(i)/10.0,i=1,20000)]
        x=y**3.78-6*y**2.52+9*y**1.26
        call loc(y,size(y))
     end program demo_loc

Results:

                                  Estimates of the Location Parameter

(The sample size N = 30)

The sample midrange is
  0.15500000E+01
The sample mean is
  0.15500000E+01
The sample 25 percent trimmed mean is
  0.15500001E+01
The sample median is
  0.15500000E+01

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 Dixon and Massey, pages 14, 70, and 71
o Crow, Journal of the American Statistical Association, pages 357 and 387
o Kendall and Stuart, The Advanced Theory of Statistics, Volume 1, Edition 2, 1963, page 8.


Nemo Release 3.1 loc (3) July 22, 2023
Generated by manServer 1.08 from 1e46fefd-7aba-4337-bd10-1f05cfe0982c using man macros.