Means: Difference between revisions
Jump to navigation
Jump to search
imported>Jeremy (Importing text file) |
imported>Donal |
||
(2 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
===Purpose=== | ===Purpose=== | ||
Calculates the | |||
Calculates the arithmetic, harmonic, and geometric mean of a vector. | |||
===Synopsis=== | ===Synopsis=== | ||
:vals = means(x) | :vals = means(x) | ||
==== | |||
====Inputs==== | |||
* '''x''' = matrix (column vector) in which the sample data is stored. | * '''x''' = matrix (column vector) in which the sample data is stored. | ||
==== | |||
====Outputs==== | |||
The return value is a structure with fields: | The return value is a structure with fields: | ||
* '''amean''' = arithmetic mean. | * '''amean''' = arithmetic mean. | ||
* '''na''' = number of obs used in amean calculation. | * '''na''' = number of obs used in amean calculation. | ||
* '''hmean''' = harmonic mean. | * '''hmean''' = harmonic mean. | ||
* '''nh''' = number of obs used in hmean calculation. | * '''nh''' = number of obs used in hmean calculation. | ||
* '''gmean''' = geometric mean. | * '''gmean''' = geometric mean. | ||
* '''ng''' = number of obs used in gmean calculation. | * '''ng''' = number of obs used in gmean calculation. | ||
===Examples=== | ===Examples=== | ||
mns = means(x); | mns = means(x); | ||
===See Also=== | ===See Also=== | ||
[[summary]] | [[summary]] |
Latest revision as of 15:56, 5 September 2012
Purpose
Calculates the arithmetic, harmonic, and geometric mean of a vector.
Synopsis
- vals = means(x)
Inputs
- x = matrix (column vector) in which the sample data is stored.
Outputs
The return value is a structure with fields:
- amean = arithmetic mean.
- na = number of obs used in amean calculation.
- hmean = harmonic mean.
- nh = number of obs used in hmean calculation.
- gmean = geometric mean.
- ng = number of obs used in gmean calculation.
Examples
mns = means(x);