Next: regcoefs() Up: Regression Macros Help File Previous: estimlimits()   Contents

predlimits()

Usage:
predlimits(x, confLevel), x REAL scalar, vector or matrix with no
  MISSING elements, 0 < confLevel < 1 scalar



Keywords: regression, prediction limits
You can use macro predlimits() to compute prediction limits for y =
E(y|x) + epsilon or y = E(y | x1, x2 ...) + epsilon after running
regress("y=x") or regress("y=x1+x2+..+xk").  These are limits on the a
future value of y for specified values of the predictor variable or
variables.

predlimits(x, confLevel), where x is a REAL vector with length(x) =
number of predictors (1 for simple linear regression), returns
vector(lower,upper), where lower and upper are prediction limit with
confidence level confLevel.  Argument confLevel must be a REAL scalar
between 0.5 and 1.

When confLevel < .5, a warning message is printed and 1 - confLevel is
used.

Example:
  After regress("y=x1 + x2 + x3"), predlimits(vector(2,3,4), .95)
  returns vector(lower,upper) where lower and upper are the limits when
  x1=2, x2=3 and x3=4

You can use predlimits() to get limits for several values at once,
returning hconcat(lower,upper), where lower and upper are vectors of
limits for the various values.

For simple linear regression, x should be a vector containing the
values for which you want prediction limits.

When there are k predictors, x should be a matrix with k columns, and
lower and upper will have length(nrows(x)).

Example:
  After regress("y = x1 + x2"), predlimits(vconcat(vector(1,2)',
  vector(2,1.5)',vector(3,3.2)'), .95) returns hconcat(lower,upper)
  where, for example, lower[2] and upper [2] are the limits when x1 = 2
  and x2 = 1.5.

See also estimlimits(), regpred(), glmpred().


Gary Oehlert 2003-01-15