loc(3f) - [M_datapac:STATISTICS] print the sample mean, midrange, midmean, and median
Synopsis
Description
Input Arguments
Output
Examples
Author
Maintainer
License
References
SUBROUTINE LOC(X,N)
REAL(kind=wp),intent(in) :: X(:) INTEGER,intent(in) :: N
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.
X The vector of (unsorted or sorted) observations. N The integer number of observations in the vector X.
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.
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_locResults:
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
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 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) | February 23, 2025 |