<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <!--Converted with LaTeX2HTML 98.1p1 release (March 2nd, 1998) originally by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds * revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan * with significant contributions from: Jens Lippmann, Marek Rouchal, Martin Wilck and others --> <HTML> <HEAD> <TITLE>Operations on Tables</TITLE> <META NAME="description" CONTENT="Operations on Tables"> <META NAME="keywords" CONTENT="vol1"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> <LINK REL="STYLESHEET" HREF="vol1.css"> <LINK REL="next" HREF="node65.html"> <LINK REL="previous" HREF="node59.html"> <LINK REL="up" HREF="node55.html"> <LINK REL="next" HREF="node65.html"> </HEAD> <BODY > <!--Navigation Panel--> <A NAME="tex2html1286" HREF="node65.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="icons.gif/next_motif.gif"></A> <A NAME="tex2html1282" HREF="node55.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="icons.gif/up_motif.gif"></A> <A NAME="tex2html1276" HREF="node63.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="icons.gif/previous_motif.gif"></A> <A NAME="tex2html1284" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="icons.gif/contents_motif.gif"></A> <A NAME="tex2html1285" HREF="node216.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="icons.gif/index_motif.gif"></A> <BR> <B> Next:</B> <A NAME="tex2html1287" HREF="node65.html">Command Overview</A> <B> Up:</B> <A NAME="tex2html1283" HREF="node55.html">Table File System</A> <B> Previous:</B> <A NAME="tex2html1277" HREF="node63.html">Interactive Editing of Tables</A> <BR> <BR> <!--End of Navigation Panel--> <H1><A NAME="SECTION00850000000000000000"> </A> <A NAME="operations-on-tables"> </A> <BR> Operations on Tables </H1> <P> In this section we describe several of the mathematical operations that can be performed on table data. More specialised topics are described in Chapter <A HREF="node127.html#fitting-of-data">8</A>, "Fitting of Data", and in Chapter 11 Vol B, "Multivariate Analysis Methods". <P> Arithmetic operations between columns in a table are done with the command <BR> <TT>COMPUTE/TABLE</TT>. The selection flag is reset by this command. Special functions, named according to the FORTRAN mathematical library, are also available. <P> Simple statistical descriptors are displayed with the command <TT>STATISTICS/ TABLE</TT>. These descriptors are stored in output keywords for further usage in a procedure. <P> A set of histogram-related commands, with qualifier <TT>HISTOGRAM</TT>, allow the graphic display of the histogram of a column (<TT>PLOT</TT> and <TT>OVERPLOT</TT> commands), the printout of histogram values (<TT>READ</TT> and <TT>PRINT</TT> commands), or the generation of a 1D image with the histogram of a column (command <TT>COMPUTE/HISTOGRAM</TT>). <P> Linear or polynomial fits in one or two dimensions can be performed on table columns with the command <TT>REGRESSION</TT>, qualifiers <TT>LINEAR</TT> and <TT>POLY</TT> respectively. The coefficients and error estimations are kept in output keywords that can be stored as table descriptors with the command <TT>SAVE/REGRESSION</TT>. Fitted values are calculated with <TT>COMPUTE/REGRESSION</TT>. <P> A topic of special interest is the generation of table data from an image and vice versa. A transformation was already described in section <A HREF="node62.html#modification-of-tables">5.4.3</A>, and consists in copying the data from one format to the other, using the commands <TT>COPY/IT</TT> and <TT>COPY/TI</TT>. Tabular data can be converted into 1D or 2D image data with the command <TT>CONVERT/TABLE</TT>. This command works in several modes controlled by a parameter. In all cases the sampling domain of the result is defined by a reference image. The modes currently available are : POLY (polynomial fit to table data), SPLINE (spline approximation), PLOT (scattergram of the data in the table) and FREQ (2D histogram of the data in the table). <P> For more specific resampling and interpolating algorithms, the commands <TT>REBIN</TT> and <TT>INTERPOLATE</TT> will provide full conversion between image and table formats (qualifiers <TT>TT, TI, IT</TT> and <TT>II</TT>). <P> <BR> <DIV ALIGN="CENTER"><A NAME="6301"> </A> <TABLE> <CAPTION><STRONG>Table 5.8:</STRONG> Operations on Table Data</CAPTION> <TR><TD> <DIV ALIGN="CENTER"> <TABLE CELLPADDING=3 BORDER="1" ALIGN="CENTER"> <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><B> Command</B></TD> <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><B> Description</B></TD> </TR> <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><TT>COMPUTE/TABLE </TT></TD> <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1>Compute numeric expression of columns.</TD> </TR> <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><TT>COMPUTE/HISTOGRAM </TT></TD> <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1>Compute column histogram, result in table or image format.</TD> </TR> <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><TT>REBIN </TT></TD> <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1>Resampling data in table/image formats.</TD> </TR> <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><TT>INTERPOLATE </TT></TD> <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1>Spline interpolation of data.</TD> </TR> <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><TT>REGRESSION/LINEAR </TT></TD> <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1>Compute linear regression.</TD> </TR> <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><TT>REGRESSION/POLY </TT></TD> <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1>Compute polynomial fit.</TD> </TR> <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><TT>SAVE/REGRESSION </TT></TD> <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1>Store regression coefficients as table descriptors.</TD> </TR> <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><TT>COMPUTE/REGRESSION </TT></TD> <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1>Compute fitted values using the regression coefficients.</TD> </TR> <TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1><TT>STATISTICS/TABLE </TT></TD> <TD ALIGN="LEFT" VALIGN="TOP" WIDTH=1>Simple statistics on a table column.</TD> </TR> </TABLE></DIV> <A NAME="operations-on-table-data"> </A></TD></TR> </TABLE> </DIV> <BR> <P> <HR> <!--Navigation Panel--> <A NAME="tex2html1286" HREF="node65.html"> <IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="icons.gif/next_motif.gif"></A> <A NAME="tex2html1282" HREF="node55.html"> <IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="icons.gif/up_motif.gif"></A> <A NAME="tex2html1276" HREF="node63.html"> <IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="icons.gif/previous_motif.gif"></A> <A NAME="tex2html1284" HREF="node1.html"> <IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="icons.gif/contents_motif.gif"></A> <A NAME="tex2html1285" HREF="node216.html"> <IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index" SRC="icons.gif/index_motif.gif"></A> <BR> <B> Next:</B> <A NAME="tex2html1287" HREF="node65.html">Command Overview</A> <B> Up:</B> <A NAME="tex2html1283" HREF="node55.html">Table File System</A> <B> Previous:</B> <A NAME="tex2html1277" HREF="node63.html">Interactive Editing of Tables</A> <!--End of Navigation Panel--> <ADDRESS> <I>Petra Nass</I> <BR><I>1999-06-09</I> </ADDRESS> </BODY> </HTML>