Usage Note 44415: Harmonic mean estimate, confidence interval, and test for lognormal data
The usual moment estimator of the harmonic mean is 1/mean(1/xi), the reciprocal of the mean of the reciprocals of the xi. This is a nonparametric estimator and is produced by the HARMEAN function in the DATA step. Limbrunner et. al. (2000) indicate that this moment estimator can be significantly biased especially for data with large coefficient of variation. They show that the maximum likelihood (ML) estimator "is nearly unbiased and [is] generally more efficient (lower RMSE) than the alternative estimators for lognormal observations."
The ML estimator is easily produced using the ESTIMATE statement in PROC NLMIXED. In addition to a point estimate, the PREDICT statement provides a standard error, confidence interval, and test of the harmonic mean as shown in the following example.
These statements use the HARMEAN function to produce the moment estimate of the harmonic mean of the values 1, 2, and 4.
data a;
input y @@;
harmean = harmean(1, 2, 4);
datalines;
1 2 4
;
proc print data=a(obs=1) noobs;
var harmean;
title "Moment estimator of Harmonic Mean";
run;
PROC NLMIXED is used to fit a lognormal model to the data. The variable LL is the log likelihood for the lognormal. The mean, MU, and variance, V, are estimated by PROC NLMIXED. The maximum likelihood estimator, exp(μ - ½σ2), is computed in the ESTIMATE statement.
proc nlmixed data=a;
ll=-((log(y)-mu)**2)/v - log(v);
model y~general(ll);
estimate "ML estimator of Harmonic Mean" exp(mu-.5*v);
run;
| ML estimator of Harmonic Mean |
1.7040 |
0.4241 |
3 |
4.02 |
0.0277 |
0.05 |
0.3544 |
3.0536 |
|
_____
Limbrunner J.F., Vogel R.M., and Brown L.C. (2000), "Estimation of Harmonic Mean of a Lognormal Variable", J. Hydrologic Engineering, 5(1), 59-66.
Operating System and Release Information
| SAS System | SAS/STAT | z/OS | | |
| OpenVMS VAX | | |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | | |
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | | |
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | | |
| Microsoft Windows XP 64-bit Edition | | |
| Microsoft® Windows® for x64 | | |
| OS/2 | | |
| Microsoft Windows 95/98 | | |
| Microsoft Windows 2000 Advanced Server | | |
| Microsoft Windows 2000 Datacenter Server | | |
| Microsoft Windows 2000 Server | | |
| Microsoft Windows 2000 Professional | | |
| Microsoft Windows NT Workstation | | |
| Microsoft Windows Server 2003 Datacenter Edition | | |
| Microsoft Windows Server 2003 Enterprise Edition | | |
| Microsoft Windows Server 2003 Standard Edition | | |
| Microsoft Windows Server 2003 for x64 | | |
| Microsoft Windows Server 2008 | | |
| Microsoft Windows Server 2008 for x64 | | |
| Microsoft Windows XP Professional | | |
| Windows 7 Enterprise 32 bit | | |
| Windows 7 Enterprise x64 | | |
| Windows 7 Home Premium 32 bit | | |
| Windows 7 Home Premium x64 | | |
| Windows 7 Professional 32 bit | | |
| Windows 7 Professional x64 | | |
| Windows 7 Ultimate 32 bit | | |
| Windows 7 Ultimate x64 | | |
| Windows Millennium Edition (Me) | | |
| Windows Vista | | |
| Windows Vista for x64 | | |
| 64-bit Enabled AIX | | |
| 64-bit Enabled HP-UX | | |
| 64-bit Enabled Solaris | | |
| ABI+ for Intel Architecture | | |
| AIX | | |
| HP-UX | | |
| HP-UX IPF | | |
| IRIX | | |
| Linux | | |
| Linux for x64 | | |
| Linux on Itanium | | |
| OpenVMS Alpha | | |
| OpenVMS on HP Integrity | | |
| Solaris | | |
| Solaris for x64 | | |
| Tru64 UNIX | | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Type: | Usage Note |
| Priority: | |
| Topic: | Analytics ==> Descriptive Statistics SAS Reference ==> Procedures ==> NLMIXED SAS Reference ==> Functions ==> Descriptive Statistics ==> HARMEAN
|
| Date Modified: | 2011-11-14 16:59:52 |
| Date Created: | 2011-09-26 16:50:56 |