work on PRINT encoding
[pspp] / doc / expressions.texi
index 345e59669d36ad6f0cc08a8f95251e3b0760fdbc..77908e35ed5a1ba51510d7389912cc8c67a5df85 100644 (file)
@@ -1,9 +1,15 @@
+@c Use @func when refering to a function.
+@c Use @deftypefn for their definitions 
+@macro func{NAME}
+@code{/NAME/}
+@end macro
+
 @node Expressions
 @chapter Mathematical Expressions
 @cindex expressions, mathematical
 @cindex mathematical expressions
 
 @node Expressions
 @chapter Mathematical Expressions
 @cindex expressions, mathematical
 @cindex mathematical expressions
 
-Expressions share a common syntax each place they appear in PSPP
+Expressions share a common syntax each place they appear in @pspp{}
 commands.  Expressions are made up of @dfn{operands}, which can be
 numbers, strings, or variable names, separated by @dfn{operators}.
 There are five types of operators: grouping, arithmetic, logical,
 commands.  Expressions are made up of @dfn{operands}, which can be
 numbers, strings, or variable names, separated by @dfn{operators}.
 There are five types of operators: grouping, arithmetic, logical,
@@ -30,7 +36,7 @@ full-fledged expressions in themselves.
 @cindex Boolean
 @cindex values, Boolean
 
 @cindex Boolean
 @cindex values, Boolean
 
-Some PSPP operators and expressions work with Boolean values, which
+Some @pspp{} operators and expressions work with Boolean values, which
 represent true/false conditions.  Booleans have only three possible
 values: 0 (false), 1 (true), and system-missing (unknown).
 System-missing is neither true nor false and indicates that the true
 represent true/false conditions.  Booleans have only three possible
 values: 0 (false), 1 (true), and system-missing (unknown).
 System-missing is neither true nor false and indicates that the true
@@ -238,15 +244,15 @@ True if @var{a} is not equal to @var{b}.
 @cindex @code{(}
 @cindex @code{)}
 @cindex names, of functions
 @cindex @code{(}
 @cindex @code{)}
 @cindex names, of functions
-PSPP functions provide mathematical abilities above and beyond
+@pspp{} functions provide mathematical abilities above and beyond
 those possible using simple operators.  Functions have a common
 syntax: each is composed of a function name followed by a left
 parenthesis, one or more arguments, and a right parenthesis.
 
 Function names are not reserved.  Their names are specially treated
 those possible using simple operators.  Functions have a common
 syntax: each is composed of a function name followed by a left
 parenthesis, one or more arguments, and a right parenthesis.
 
 Function names are not reserved.  Their names are specially treated
-only when followed by a left parenthesis, so that @code{EXP(10)}
-refers to the constant value @code{e} raised to the 10th power, but
-@code{EXP} by itself refers to the value of variable EXP.
+only when followed by a left parenthesis, so that @samp{EXP(10)}
+refers to the constant value @math{e} raised to the 10th power, but
+@samp{EXP} by itself refers to the value of a variable called @code{EXP}.
 
 The sections below describe each function in detail.
 
 
 The sections below describe each function in detail.
 
@@ -273,7 +279,7 @@ Advanced mathematical functions take numeric arguments and produce
 numeric results.
 
 @deftypefn {Function} {} EXP (@var{exponent})
 numeric results.
 
 @deftypefn {Function} {} EXP (@var{exponent})
-Returns @i{e} (approximately 2.71828) raised to power @var{exponent}.
+Returns @math{e} (approximately 2.71828) raised to power @var{exponent}.
 @end deftypefn
 
 @cindex logarithms
 @end deftypefn
 
 @cindex logarithms
@@ -283,12 +289,12 @@ not positive, the result is system-missing.
 @end deftypefn
 
 @deftypefn {Function} {} LN (@var{number})
 @end deftypefn
 
 @deftypefn {Function} {} LN (@var{number})
-Takes the base-@i{e} logarithm of @var{number}.  If @var{number} is
+Takes the base-@math{e} logarithm of @var{number}.  If @var{number} is
 not positive, the result is system-missing.
 @end deftypefn
 
 @deftypefn {Function} {} LNGAMMA (@var{number})
 not positive, the result is system-missing.
 @end deftypefn
 
 @deftypefn {Function} {} LNGAMMA (@var{number})
-Yields the base-@i{e} logarithm of the complete gamma of @var{number}.
+Yields the base-@math{e} logarithm of the complete gamma of @var{number}.
 If @var{number} is a negative integer, the result is system-missing.
 @end deftypefn
 
 If @var{number} is a negative integer, the result is system-missing.
 @end deftypefn
 
@@ -349,7 +355,7 @@ results.
 @deftypefnx {Function} {} ACOS (@var{number})
 Takes the arccosine, in radians, of @var{number}.  Results in
 system-missing if @var{number} is not between -1 and 1 inclusive.
 @deftypefnx {Function} {} ACOS (@var{number})
 Takes the arccosine, in radians, of @var{number}.  Results in
 system-missing if @var{number} is not between -1 and 1 inclusive.
-This function is a PSPP extension.
+This function is a @pspp{} extension.
 @end deftypefn
 
 @cindex arcsine
 @end deftypefn
 
 @cindex arcsine
@@ -381,7 +387,7 @@ Takes the sine of @var{angle} which should be in radians.
 @deftypefn {Function} {} TAN (@var{angle})
 Takes the tangent of @var{angle} which should be in radians.
 Results in system-missing at values
 @deftypefn {Function} {} TAN (@var{angle})
 Takes the tangent of @var{angle} which should be in radians.
 Results in system-missing at values
-of @var{angle} that are too close to odd multiples of pi/2.
+of @var{angle} that are too close to odd multiples of @math{\pi/2}.
 Portability: none.
 @end deftypefn
 
 Portability: none.
 @end deftypefn
 
@@ -443,7 +449,7 @@ String comparisons are performed according to the rules given in
 Results in true if @var{value} is equal to any of the @var{set}
 values.  Otherwise, results in false.  If @var{value} is
 system-missing, returns system-missing.  System-missing values in
 Results in true if @var{value} is equal to any of the @var{set}
 values.  Otherwise, results in false.  If @var{value} is
 system-missing, returns system-missing.  System-missing values in
-@var{set} do not cause ANY to return system-missing.
+@var{set} do not cause @func{ANY} to return system-missing.
 @end deftypefn
 
 @deftypefn {Function} {} RANGE (@var{value}, @var{low}, @var{high} [, @var{low}, @var{high}]@dots{})
 @end deftypefn
 
 @deftypefn {Function} {} RANGE (@var{value}, @var{low}, @var{high} [, @var{low}, @var{high}]@dots{})
@@ -452,7 +458,7 @@ Results in true if @var{value} is in any of the intervals bounded by
 Each @var{low} must be less than or equal to its corresponding
 @var{high} value.  @var{low} and @var{high} must be given in pairs.
 If @var{value} is system-missing, returns system-missing.
 Each @var{low} must be less than or equal to its corresponding
 @var{high} value.  @var{low} and @var{high} must be given in pairs.
 If @var{value} is system-missing, returns system-missing.
-System-missing values in @var{set} do not cause RANGE to return
+System-missing values in @var{set} do not cause @func{RANGE} to return
 system-missing.
 @end deftypefn
 
 system-missing.
 @end deftypefn
 
@@ -475,10 +481,10 @@ using the @code{@var{var1} TO @var{var2}} syntax.
 Unlike most functions, statistical functions can return non-missing
 values even when some of their arguments are missing.  Most
 statistical functions, by default, require only 1 non-missing value to
 Unlike most functions, statistical functions can return non-missing
 values even when some of their arguments are missing.  Most
 statistical functions, by default, require only 1 non-missing value to
-have a non-missing return, but CFVAR, SD, and VARIANCE require 2.
+have a non-missing return, but @func{CFVAR}, @func{SD}, and @func {VARIANCE} require 2.
 These defaults can be increased (but not decreased) by appending a dot
 and the minimum number of valid arguments to the function name.  For
 These defaults can be increased (but not decreased) by appending a dot
 and the minimum number of valid arguments to the function name.  For
-example, @code{MEAN.3(X, Y, Z)} would only return non-missing if all
+example, @subcmd{MEAN.3(X, Y, Z)} would only return non-missing if all
 of @samp{X}, @samp{Y}, and @samp{Z} were valid.
 
 @cindex coefficient of variation
 of @samp{X}, @samp{Y}, and @samp{Z} were valid.
 
 @cindex coefficient of variation
@@ -698,7 +704,7 @@ Returns @var{string}, changing lowercase letters to uppercase letters.
 @cindex dates
 
 @cindex dates, valid
 @cindex dates
 
 @cindex dates, valid
-For compatibility, PSPP considers dates before 15 Oct 1582 invalid.
+For compatibility, @pspp{} considers dates before 15 Oct 1582 invalid.
 Most time and date functions will not accept earlier dates.
 
 @menu
 Most time and date functions will not accept earlier dates.
 
 @menu
@@ -717,8 +723,8 @@ Most time and date functions will not accept earlier dates.
 
 @cindex time, concepts
 @cindex time, intervals
 
 @cindex time, concepts
 @cindex time, intervals
-Times and dates are handled by PSPP as single numbers.  A
-@dfn{time} is an interval.  PSPP measures times in seconds.
+Times and dates are handled by @pspp{} as single numbers.  A
+@dfn{time} is an interval.  @pspp{} measures times in seconds.
 Thus, the following intervals correspond with the numeric values given:
                 
 @example
 Thus, the following intervals correspond with the numeric values given:
                 
 @example
@@ -731,9 +737,9 @@ Thus, the following intervals correspond with the numeric values given:
 @cindex dates, concepts
 @cindex time, instants of
 A @dfn{date}, on the other hand, is a particular instant in the past
 @cindex dates, concepts
 @cindex time, instants of
 A @dfn{date}, on the other hand, is a particular instant in the past
-or the future.  PSPP represents a date as a number of seconds since
+or the future.  @pspp{} represents a date as a number of seconds since
 midnight preceding 14 Oct 1582.  Because midnight preceding the dates
 midnight preceding 14 Oct 1582.  Because midnight preceding the dates
-given below correspond with the numeric PSPP dates given:
+given below correspond with the numeric @pspp{} dates given:
 
 @example
               15 Oct 1582                86,400
 
 @example
               15 Oct 1582                86,400
@@ -773,7 +779,7 @@ vice versa.
 @cindex examination, of times
 @cindex time, lengths of
 
 @cindex examination, of times
 @cindex time, lengths of
 
-These functions take numeric arguments in PSPP time format and
+These functions take numeric arguments in @pspp{} time format and
 give numeric results.
 
 @cindex days
 give numeric results.
 
 @cindex days
@@ -886,18 +892,18 @@ Results in a date value corresponding to the day
 @cindex date examination
 
 @cindex arguments, of date extraction functions
 @cindex date examination
 
 @cindex arguments, of date extraction functions
-These functions take numeric arguments in PSPP date or time
+These functions take numeric arguments in @pspp{} date or time
 format and give numeric results.  These names are used for arguments:
 
 @table @var
 @item date
 format and give numeric results.  These names are used for arguments:
 
 @table @var
 @item date
-A numeric value in PSPP date format.
+A numeric value in @pspp{} date format.
 
 @item time
 
 @item time
-A numeric value in PSPP time format.
+A numeric value in @pspp{} time format.
 
 @item time-or-date
 
 @item time-or-date
-A numeric value in PSPP time or date format.
+A numeric value in @pspp{} time or date format.
 @end table
 
 @cindex days
 @end table
 
 @cindex days
@@ -1025,7 +1031,7 @@ accuracy of some procedures may be affected.  If necessary, convert
 times or dates in seconds to some other unit, like days or years,
 before performing analysis.
 
 times or dates in seconds to some other unit, like days or years,
 before performing analysis.
 
-PSPP supplies a few functions for date arithmetic:
+@pspp{} supplies a few functions for date arithmetic:
 
 @deftypefn {Function} {} DATEDIFF (@var{date2}, @var{date1}, @var{unit})
 Returns the span of time from @var{date1} to @var{date2} in terms of
 
 @deftypefn {Function} {} DATEDIFF (@var{date2}, @var{date1}, @var{unit})
 Returns the span of time from @var{date1} to @var{date2} in terms of
@@ -1077,7 +1083,8 @@ yields the value of that variable for the case @var{n} before the
 current one.  Results in system-missing (for numeric variables) or
 blanks (for string variables) for the first @var{n} cases.
 
 current one.  Results in system-missing (for numeric variables) or
 blanks (for string variables) for the first @var{n} cases.
 
-@code{LAG} obtains values from the cases that become the new active file
+@code{LAG} obtains values from the cases that become the new active
+dataset
 after a procedure executes.  Thus, @code{LAG} will not return values
 from cases dropped by transformations such as @cmd{SELECT IF}, and
 transformations like @cmd{COMPUTE} that modify data will change the
 after a procedure executes.  Thus, @code{LAG} will not return values
 from cases dropped by transformations such as @cmd{SELECT IF}, and
 transformations like @cmd{COMPUTE} that modify data will change the
@@ -1097,7 +1104,7 @@ use of a large value will increase memory consumption.
 @cindex Julian date
 @deftypefn {Function} {} YRMODA (@var{year}, @var{month}, @var{day})
 @var{year} is a year, either between 0 and 99 or at least 1582.
 @cindex Julian date
 @deftypefn {Function} {} YRMODA (@var{year}, @var{month}, @var{day})
 @var{year} is a year, either between 0 and 99 or at least 1582.
-Unlike other PSPP date functions, years between 0 and 99 always
+Unlike other @pspp{} date functions, years between 0 and 99 always
 correspond to 1900 through 1999.  @var{month} is a month between 1 and
 13.  @var{day} is a day between 0 and 31.  A @var{day} of 0 refers to
 the last day of the previous month, and a @var{month} of 13 refers to
 correspond to 1900 through 1999.  @var{month} is a month between 1 and
 13.  @var{day} is a day between 0 and 31.  A @var{day} of 0 refers to
 the last day of the previous month, and a @var{month} of 13 refers to
@@ -1120,7 +1127,7 @@ associated label, then this function returns the empty string.
 @node Statistical Distribution Functions
 @subsection Statistical Distribution Functions
 
 @node Statistical Distribution Functions
 @subsection Statistical Distribution Functions
 
-PSPP can calculate several functions of standard statistical
+@pspp{} can calculate several functions of standard statistical
 distributions.  These functions are named systematically based on the
 function and the distribution.  The table below describes the
 statistical distribution functions in general:
 distributions.  These functions are named systematically based on the
 function and the distribution.  The table below describes the
 statistical distribution functions in general:
@@ -1143,7 +1150,7 @@ a probability.
 Tail probability function for @var{dist}, that is, the probability
 that a random variate drawn from the distribution is greater than
 @var{x}.  The domain of @var{x} depends @var{dist}.  The result is a
 Tail probability function for @var{dist}, that is, the probability
 that a random variate drawn from the distribution is greater than
 @var{x}.  The domain of @var{x} depends @var{dist}.  The result is a
-probability.  Only a few distributions include an SIG function.
+probability.  Only a few distributions include an @func{SIG} function.
 
 @item IDF.@var{dist} (@var{p}[, @var{param}@dots{}])
 Inverse distribution function for @var{dist}, the value of @var{x} for
 
 @item IDF.@var{dist} (@var{p}[, @var{param}@dots{}])
 Inverse distribution function for @var{dist}, the value of @var{x} for
@@ -1159,7 +1166,7 @@ distribution.
 Noncentral probability density function.  The result is the density of
 the given noncentral distribution at @var{x}.  The domain of @var{x}
 depends on @var{dist}.  The range is nonnegative real numbers.  Only a
 Noncentral probability density function.  The result is the density of
 the given noncentral distribution at @var{x}.  The domain of @var{x}
 depends on @var{dist}.  The range is nonnegative real numbers.  Only a
-few distributions include an NPDF function.
+few distributions include an @func{NPDF} function.
 
 @item NCDF.@var{dist} (@var{x}[, @var{param}@dots{}])
 Noncentral cumulative distribution function for @var{dist}, that is,
 
 @item NCDF.@var{dist} (@var{x}[, @var{param}@dots{}])
 Noncentral cumulative distribution function for @var{dist}, that is,
@@ -1235,7 +1242,7 @@ Exponential distribution with scale parameter @var{a}.  The inverse of
 Exponential power distribution with positive scale parameter @var{a}
 and nonnegative power parameter @var{b}.  Constraints: @var{a} > 0,
 @var{b} >= 0, @var{x} >= 0, 0 <= @var{p} <= 1.  This distribution is a
 Exponential power distribution with positive scale parameter @var{a}
 and nonnegative power parameter @var{b}.  Constraints: @var{a} > 0,
 @var{b} >= 0, @var{x} >= 0, 0 <= @var{p} <= 1.  This distribution is a
-PSPP extension.
+@pspp{} extension.
 @end deftypefn
 
 @deftypefn {Function} {} PDF.F (@var{x}, @var{df1}, @var{df2})
 @end deftypefn
 
 @deftypefn {Function} {} PDF.F (@var{x}, @var{df1}, @var{df2})
@@ -1340,7 +1347,7 @@ Equivalent to RV.NORMAL(0, @var{sigma}).
 @deftypefn {Function} {} PDF.NTAIL (@var{x}, @var{a}, @var{sigma})
 @deftypefnx {Function} {} RV.NTAIL (@var{a}, @var{sigma})
 Normal tail distribution with lower limit @var{a} and standard
 @deftypefn {Function} {} PDF.NTAIL (@var{x}, @var{a}, @var{sigma})
 @deftypefnx {Function} {} RV.NTAIL (@var{a}, @var{sigma})
 Normal tail distribution with lower limit @var{a} and standard
-deviation @var{sigma}.  This distribution is a PSPP extension.
+deviation @var{sigma}.  This distribution is a @pspp{} extension.
 Constraints: @var{a} > 0, @var{x} > @var{a}, 0 < @var{p} < 1.
 @end deftypefn
 
 Constraints: @var{a} > 0, @var{x} > @var{a}, 0 < @var{p} < 1.
 @end deftypefn
 
@@ -1358,14 +1365,14 @@ parameter @var{b}.  Constraints: @var{a} > 0, @var{b} > 0, @var{x} >=
 @deftypefnx {Function} {} IDF.RAYLEIGH (@var{p}, @var{sigma})
 @deftypefnx {Function} {} RV.RAYLEIGH (@var{sigma})
 Rayleigh distribution with scale parameter @var{sigma}.  This
 @deftypefnx {Function} {} IDF.RAYLEIGH (@var{p}, @var{sigma})
 @deftypefnx {Function} {} RV.RAYLEIGH (@var{sigma})
 Rayleigh distribution with scale parameter @var{sigma}.  This
-distribution is a PSPP extension.  Constraints: @var{sigma} > 0,
+distribution is a @pspp{} extension.  Constraints: @var{sigma} > 0,
 @var{x} > 0.
 @end deftypefn
 
 @deftypefn {Function} {} PDF.RTAIL (@var{x}, @var{a}, @var{sigma})
 @deftypefnx {Function} {} RV.RTAIL (@var{a}, @var{sigma})
 Rayleigh tail distribution with lower limit @var{a} and scale
 @var{x} > 0.
 @end deftypefn
 
 @deftypefn {Function} {} PDF.RTAIL (@var{x}, @var{a}, @var{sigma})
 @deftypefnx {Function} {} RV.RTAIL (@var{a}, @var{sigma})
 Rayleigh tail distribution with lower limit @var{a} and scale
-parameter @var{sigma}.  This distribution is a PSPP extension.
+parameter @var{sigma}.  This distribution is a @pspp{} extension.
 Constraints: @var{a} > 0, @var{sigma} > 0, @var{x} > @var{a}.
 @end deftypefn
 
 Constraints: @var{a} > 0, @var{sigma} > 0, @var{x} > @var{a}.
 @end deftypefn
 
@@ -1398,14 +1405,14 @@ distribution takes an additional parameter @var{lambda}.  Constraints:
 @deftypefnx {Function} {} CDF.T1G (@var{x}, @var{a}, @var{b})
 @deftypefnx {Function} {} IDF.T1G (@var{p}, @var{a}, @var{b})
 Type-1 Gumbel distribution with parameters @var{a} and @var{b}.  This
 @deftypefnx {Function} {} CDF.T1G (@var{x}, @var{a}, @var{b})
 @deftypefnx {Function} {} IDF.T1G (@var{p}, @var{a}, @var{b})
 Type-1 Gumbel distribution with parameters @var{a} and @var{b}.  This
-distribution is a PSPP extension.  Constraints: 0 < @var{p} < 1.
+distribution is a @pspp{} extension.  Constraints: 0 < @var{p} < 1.
 @end deftypefn
 
 @deftypefn {Function} {} PDF.T2G (@var{x}, @var{a}, @var{b})
 @deftypefnx {Function} {} CDF.T2G (@var{x}, @var{a}, @var{b})
 @deftypefnx {Function} {} IDF.T2G (@var{p}, @var{a}, @var{b})
 Type-2 Gumbel distribution with parameters @var{a} and @var{b}.  This
 @end deftypefn
 
 @deftypefn {Function} {} PDF.T2G (@var{x}, @var{a}, @var{b})
 @deftypefnx {Function} {} CDF.T2G (@var{x}, @var{a}, @var{b})
 @deftypefnx {Function} {} IDF.T2G (@var{p}, @var{a}, @var{b})
 Type-2 Gumbel distribution with parameters @var{a} and @var{b}.  This
-distribution is a PSPP extension.  Constraints: @var{x} > 0, 0 <
+distribution is a @pspp{} extension.  Constraints: @var{x} > 0, 0 <
 @var{p} < 1.
 @end deftypefn
 
 @var{p} < 1.
 @end deftypefn
 
@@ -1475,7 +1482,7 @@ Constraints: 0 <= @var{p} < 1, @var{x} >= 1.
 @deftypefn {Function} {} PDF.NEGBIN (@var{x}, @var{n}, @var{p})
 @deftypefnx {Function} {} CDF.NEGBIN (@var{x}, @var{n}, @var{p})
 @deftypefnx {Function} {} RV.NEGBIN (@var{n}, @var{p})
 @deftypefn {Function} {} PDF.NEGBIN (@var{x}, @var{n}, @var{p})
 @deftypefnx {Function} {} CDF.NEGBIN (@var{x}, @var{n}, @var{p})
 @deftypefnx {Function} {} RV.NEGBIN (@var{n}, @var{p})
-Negative binomial distribution with number of successes paramter
+Negative binomial distribution with number of successes parameter
 @var{n} and probability of success parameter @var{p}.  Constraints:
 integer @var{n} >= 0, 0 < @var{p} <= 1, integer @var{x} >= 1.
 @end deftypefn
 @var{n} and probability of success parameter @var{p}.  Constraints:
 integer @var{n} >= 0, 0 < @var{p} <= 1, integer @var{x} >= 1.
 @end deftypefn