Page Numbers: Yes X: 527 Y: -.4 First Page: 65 Not-on-first-page
Margins: Top: 1.1" Bottom: 1" Binding: 5
Odd Heading: Not-on-first-page
APPENDIX B: THE IDL LIBRARY
Even Heading: Not-on-first-page
IDL REFERENCE MANUAL
Appendix B
The IDL Library
Although the user of IDL is encouraged to use the flexibility of the system to construct his own analysis tools, the IDL system provides a library which contains some useful combinations of IDL operators as functions. Often the real benefit of these functions is simply that they provide more detailed labelling than the user immersed in a specific problem would be willing to provide or that they make use of operator combinations which, although simple, would require some amount of thought to derive.
As they are expressed as IDL programs, the user is encouraged to study the text of these definitions as indication of how the IDL primitives may be combined together to produce new functionality. The descriptions here are correspondingly brief.
The Library may be LOADed from <IDL>LIBRARY (source code for perusal) and <IDL>LIBRARY.COM (compiled code for unreflective execution). This listing is for convenience only, and the contents of the Library are subject to change without notice.
apool[atable;lines]
Pools the specified lines of the ANOVA table atable, producing a vector of the SS, df, and MS.
freq[a;wt]
Computes frequency distribution of the values in an arbitrary array a, weighted by wt. Not extended, because there might be different numbers of values for different slices.
freqhist[a;file;wt]
Produces frequency histograms of the values of a, weighted by wt, for each level of its kept dimensions. Returns file.
friedman[m]
Computes the Friedman 2-way analysis-of-variance by ranks. Columns are the repeated measure. The sign test is essentially the special case where there are only two columns. Produces the Chi-square/r statistic, which may be looked up in Segal, or referred to the chi-square distribution with C-1 degrees of freedom, for C the number of columns.
hmean[a]
Computes the harmonic mean of the non-NIL elements of a.
kruskal-wallis[values;attribs]
Computes the Kruskal-Wallis analysis-of-variance by ranks. Produces the H statistic, which may be looked up in Segal, or referred to the chi-square distribution with K-1 degrees of freedom, for K the number of groups. values can be a grouped array, with the treatment dimension the only kept dimension, or it can be a vector of values, with the classification indicated by attribs.
mann-whitney[values;attribs]
Essentially the special case of the Kruskal-Wallis analysis-of-variance by ranks where there are only two groups.
nfroms[m]
Returns the N on which a swept cross-product matrix m is based, no matter what the pattern of sweeping has been, by sweeping in all the variables that are swept out. Doesn’t work if anything has been swept out or in twice.
pct[a;keeps]
Returns an image of a with elements indicating the percentage that the corresponding element a is of the margin formed by collapsing across all dimensions not in keeps. For example, for a matrix, keeps=1 gives row percentages; keeps=2 gives column percentages.
regress[pre;post;dv;n]
Produces a more-or-less standard regression table for the dependent variables in the selector dv, given a pre-swept matrix pre and a post-swept matrix post. If dv=NIL, then tables for all unswept variables in post are constructed. If n is not NIL, then it is the total number of observations on which the regression should be based. Otherwise, the n is computed using NFROMS. The user should provide the n if the constant is not present in the array, e.g., because it was NORMed.
rmse[x;y]
Computes the root-mean-square-error of the conformable arrays x and y.
signtest[v1;v2]
Produces a frequency table to which chi-square can be applied for the sign-test.
wilcoxen[v1;v2]
Produces the Wilcoxon statistic to be looked up in tables (for N<25), or computes the correct probability using ANOVA.
yhat[m;sw;dv]
Computes predicted values for variables in m, given the swept matrix sw and the dependent variable selector dv. If dv is NIL, then predictors for all unswept variables in sw are computed.
zscore[a;mom]
Computes the image of a under the zscore mapping. mom, if given, is the MOMENTS table for a. Otherwise, zscore will compute them for itself.