estimlimits(x, confLevel), REAL vector or matrix x with no MISSING elements, 0 < confLevel < 1 a REAL scalar estimlimits(NULL,factorValues, confLevel), REAL vector or matrix factorValues with no MISSING elements estimalimits(x,factorValues, confLevel) |

Macro estimlimits() computes confidence limits for the expected value E(y|x) after a regression. You can also use it to compute limits for the expectation of y after anova() when the model includes one or more factors. Before using estimlimits(), you must have run regress("y=x") or regress("y=x1 + x2 + ... xk") or more generally anova(Model) where Model may contain both one or more predictors (covariates) and/or one or more factors When the arguments to estimlimits() specify a single condition under which limits are wanted for E(y), the result is vector(lower,upper), where lower and upper are the limits. When the arguments specify several conditions (several values of x and/or several factor levels), the result is hconcat(lower,upper), where lower and upper are vectors with length(lower) = length(upper) = number of conditions. Usage after regress() estimlimits(x, confLevel), where REAL variable x is a scalar (simple linear regression) or a vector (multiple regression) returns vector(lower, upper), the confidence limits for E(y|x) for the specified value of of the predictor variable(s). x can contain no MISSING elements and confLevel must be a real scalar between 0 and 1. When there is more than one predictor variable, length(x) = number of predictors. When there is only one predictor (simple linear regression), x can be a vector. When there is more than one predictor, x can be a matrix with ncols(x) = number of predictors. In both cases, the result is hconcat(lower,upper). When confLevel < .5, a warning message is printed and the confidence level is assumed to be 1 - confLevel. Usage after anova() with factors in the model estimlimits(NULL,FactorValues,confLevel) is appropriate after anova() with a model with no variates (covariates). When there is just one factor ("y = a"), FactorValues should be a scalar or vector of permissible factor levels. When there are nFactors > 1 factors, FactorValues should be a vector with length(FactorValues) = nFactors, or a matrix with ncols(FactorValues) = nFactors. estimlimits(x,FactorValues,confLevel) is appropriate after anova() with a model containing both factors and (co)variates. x and FactorValues are as in the no factor case and no variate case, respectively. Examples: After regress("y=x1 + x2 + x3"): estimlimits(vector(2,3,4),.95) returns where lower and upper are the limits when x1 = 2, x2 = 3 and x3 = 4. estimlimits(hconcat(x01, x02, x03),.95), returns hconcat(lower,upper), where lower[I] and upper[I] are limits whenx1 = x01[I], x2 = x02[I] and x3 = x03[I]. x01, x02, and x03 must all be vectors of the same length. After anova("y = a + b") estimlimits(NULL,vector(1,2),.95) returns vector(lower,upper), where lower and upper are limits when a = 1 and b = 2 After anova("y = x + a + b") estimlimits(vector(3,4),vconcat(vector(1,2)',vector(1,3)'),.95) returns hconcat(lower,upper), where lower[1] and upper[1] are limits when x = 3, a = 1 and b = 2 and lower[2] and upper[2] are limits when x = 4, a= 1 and b = 3. See also predlimits(), regpred(), glmpred().

Gary Oehlert 2003-01-15