Skip to main content

StatsQuantiles

StatsQuantiles [/ALL/BOX/iNaN/IW/TM/Z/Q/QM=method /STBL/TRIM=tValue ] srcWave

The StatsQuantiles operation computes quantiles and elementary univariate statistics for a set of data in srcWave.

Flags

/ALLInvokes all flags except /Q, /QM, and /Z.
/BOXComputes parameters necessary to construct a box plot.
/DSTI=qiWaveSpecify the output wave for the quantile index (see /IW flag). If you do not specify this flag, the operation stores the output in the wave W_QuantilesIndex in the current data folder.
This flag was added in Igor Pro 10.00.
/DSTQ=qWaveSpecify the output wave for the quantile value wave (see /QW flag). If you do not specify this flag, the operation stores the output in the wave W_QuantileValues in the current data folder.
This flag was added in Igor Pro 10.00.
/DEST=tWaveSpecify the output wave for the statistical output that is normally displayed in a table. If you do not specify this flag, the operation saves the output in the wave W_StatsQuantiles in the current data folder.
This flag was added in Igor Pro 10.00.
/FREECreates the specified destination waves as free waves.
/FREE is allowed only in functions, and only if the destination waves are simple names or wave reference structure fields.
See Free Waves for more discussion.
The /FREE flag was added in Igor Pro 10.00.
/iNaNIgnores NaNs, which are sorted to the end of the array by default.
/IWCreates an index wave W_QuantilesIndex. W_QuantilesIndex[i ] corresponds to the position of srcWave [i ] when sorted from minimum to maximum.
/QNo information printed in the history area.
/QM=qMethodSpecifies the method for computing quartiles.
qMethod =0:Tukey (default).
qMethod =1:Minitab.
qMethod =2:Moore and McCabe.
qMethod =3:Mendenhall and Sincich.
See Details for more information.
/QWCreates a single precision wave W_QuantileValues containing the quantile value corresponding to each entry in srcWave.
/STBLUses a stable sort, which may require significant computation time for multiple entries with the same value.
/T=kDisplays the result wave W_StatsQuantiles in a table and specifies window behavior when the user attempts to close the table.
k =0:Normal with dialog (default).
k =1:Kills with no dialog.
k =2:Disables killing.
If you use /K=2 you can still kill the window using the KillWindow operation.
This flag was added in Igor Pro 7.00.
/TMComputes the tri-mean: 0.25*(V_Q25+2*median+V_Q75).
/TRIM=tValComputes the trimmed mean which is the mean value of the entries between the quantiles tVal (in %) and 100-tVal. By default tVal=25 and the trimmed mean corresponds to the midmean.
/ZIgnores any errors.

Details

StatsQuantiles produces quick five-number summaries or more detailed results for univariate data. Values are returned in the wave W_StatsQuantiles and in the variables:

V_minMinimum value.
V_maxMaximum value.
V_MedianMedian value of the data.
V_Q25Lower quartile.
V_Q75Upper quartile.
V_IQRInter-quartile range V_Q75-VQ25, which is also known as the H-spread.
V_MADMedian absolute deviation.
V_ModeThe most frequent value.
If there is a tie and several values have the highest frequency then the lowest value among them is returned as the mode.
If all values in srcWave are unique or if the number of points in srcWave is less than 3, V_Mode is set to NaN.
This output was added in Igor Pro 7.00.

Entries in the wave W_StatsQuantiles depend on your choice of flags. Each row has a row label explicitly defining its value. If you use the /ALL flag, W_StatsQuantiles will contain the following row labels:

  • minValue
  • maxValue
  • Median
  • Q25
  • Q75
  • IQR
  • lowerInnerFence
  • lowerOuterFence
  • upperInnerFence
  • upperOuterFence
  • triMean
  • trimmedMean
  • MedianAbsoluteDeviation

Otherwise, W_StatsQuantiles will contain the first five entries and any additionally requested value. You should always access values using the Dimension Labels.

There is frequently some confusion in comparing statistical results computed by different programs because each may use a different definition of quartiles. You can specify the method of computing the quartiles as you prefer with the /QM flag. If you neglect to choose a method, StatsQuantiles uses Tukey's method, which computes quartiles (also called hinges) as the lower and upper median values between the median of the data and the edges of the array. The Moore and McCabe method is similar to Tukey's method except you do not include the median itself in computing the quartiles. Mendenhall and Sincich compute the quartiles using 1/4 and 3/4 of (numDataPoints+1) and round to the nearest integer (if the fraction part is exactly 0.5 they round up for the lower quartile and down for the upper quartile). Minitab uses the same expressions but instead of rounding it uses linear interpolation.

StatsQuantiles uses a stable index sorting routine so that

IndexSort W_QuantilesIndex,srcWave

is a monotonically increasing wave.

References

Tukey, J. W., Exploratory Data Analysis, 688 pp., Addison-Wesley, Reading, Massachusetts, 1977.

Mendenhall, W., and T. Sincich, Statistics for Engineering and the Sciences, 4th ed., 1008 pp., Prentice Hall, Englewood Cliffs, New Jersey, 1995.

See Also

Statistical Analysis, WaveStats, StatsMedian, median, Sort, MakeIndex