StatsChiTest
StatsChiTest [/NCON=nCon /S/Z] srcWave1, srcWave2
The StatsChiTest operation computes a
statistic for comparing two distributions or a
statistic for comparing a sample distribution with its expected values. In both cases the comparison is made on a bin-by-bin basis. Output is to the W_StatsChiTest wave in the current data folder or optionally to a table.
Flags
| /ALZR | Allows zero entries in source waves. If you are using /S zero entries in srcWave2 are skipped. | ||||||
| /DEST=sWave | Specify the output wave for StatsChiTest. If you do not specify this flag, the operation stores the output in the wave W_StatsChiTest in the current data folder. | ||||||
| This flag was added in Igor Pro 10.00. | |||||||
| /FREE | Creates the specified destination wave as a free wave. | ||||||
| /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. | |||||||
| /NCON=nCon | Specifies the number of constraints (0 by default), which reduces the number degrees of freedom and the critical value by nCon. | ||||||
| /S | Sets the calculation mode to a single distribution where srcWave1 represents an array of binned measurements and srcWave2 represents the corresponding expected values. | ||||||
| /T=k | Displays results in a table. k specifies the table behavior when it is closed. | ||||||
| |||||||
| /Z | Ignores errors. V_flag will be set to -1 for any error and to zero otherwise. | ||||||
Details
The source waves, srcWave1 and srcWave2, must have the same number of points and can be any real numeric data type. Any nonpositive values (including NaN) in either wave removes the entry from consideration in both waves and reduces the degrees of freedom by one. The number degrees of freedom is initially the number of points in srcWave1-1-nCon. By default it is assumed that srcWave1 and srcWave2 represent two distributions of binned data.
When you specify /S, srcWave1 must consist of binned values of measured data and srcWave2 must contain the corresponding expected values. The calculation is:
Here Yi is the sample point from srcWave1, Vi is the expected value of Yi based on an assumed distribution (srcWave2 ), and n is the number of points in the each wave. If you do not use /S, it calculates:
where Y1i and Y2i are taken from srcWave1 and srcWave2 respectively.
V_flag will be set to -1 for any error and to zero otherwise.
See Also
Statistical Analysis, StatsContingencyTable