nagdmc predict reg

NAG DMC

Regression Predictions: nagdmc predict reg
Purposenagdmc predict reg gives the linear predictor, standard error of the linear predictor, a backtransformed prediction and the standard error of the back transformation calculated from apreviously fitted regression model. The regression model must be fitted using one of the following
functions: nagdmc linear reg, nagdmc binomial, nagdmc poisson, nagdmc basic reg, nagdmc logit,
nagdmc probit, nagdmc loglinear or nagdmc stepwise reg.

Declaration#include <nagdmc.h>void nagdmc predict reg(double model[], double data[], double *eta, double *seeta,
double *pred, double *sepred, int vfob, int *info);

Parameters
1:model[] – double
Input
On entry: information on the fitted model obtained from one of the regression functions describedin ‘See Also’.
Constraint: model must not be 0.

2:

data[] – double
Input
On entry: the data for a single observation. The data must be in the same format as used in thecall to the analysis routine which created the model array.
Constraint: data must not be 0.

3:

eta – double *On exit: if not 0, the estimated linear predictor.

Output4:

seeta – double *On exit: if not 0, then the standard error of the linear predictor.

Output5:pred – double *On exit: if not 0, then the predicted value.

Output6:

sepred – double *On exit: if not 0, then the standard error of the predicted value.

Output7:

vfob – int
Input
On entry: If vfob = 1 then the variance of future observations is used when calculating the standarderrors reported in sepred; otherwise the variance of future observations is not used and vfob = 0.
Constraint: vfob = 0 or 1.

8:

info – int *On exit: info gives information on the success of the function call:

Output0: the function successfully completed its task.
i; i = 1, 2, 7: the specification of the ith formal parameter was incorrect.
46: information in model has been corrupted.
99: the function failed to allocate enough memory.

Notation
dataetaseeta
predvector of independent variables, {Xi : i = 2, · · · , p}.
linear predictor, η.
standard error of the linear predictor, se(η).
predicted value of the response variable, ŷ.

nagdmc predict reg.1

nagdmc predict reg

NAG DMC

sepred standard error of the predicted value, se(ŷ).
vfob
indicator variable showing whether to use variance of future observations, Iy .
model all the model information from previous model fit including β, C, g(.)
and the error structure used.

Description
Let β = {βi : i = 1, · · · , p} be a row vector of p parameter estimates, with covariance matrix C,
obtained from a generalized linear model with link function g(.) and a known error structure. Thengiven a row vector of p independent variables, X = {Xi : i = 1, · · · , p, X1 = 1} the linear predictor,
η, and its standard error, se(η), corresponding to X, are given byη = βX 0 , se(η) =√XCX 0 .

and the predicted value of the response variable, ŷ, and its standard error, se(ŷ), are given byvuu−1ŷ = g (η), se(ŷ) = t!2dg −1 (x)se(η) + Iy σy2 .
dxηWhere Iy = 0 if the variance of future observations is not taken into account, and one otherwise.
The variance of the future observations, σy depends on the error structure used, with(i) Gaussian (Normal) error: σy2 = residual mean square error (rms)(ii) binomial error: σy2 = ŷ(1 − ŷ)(iii) poisson error: σy2 = ŷReferences and Further Reading
McCullagh P and Nelder J A (1983) Generalized Linear Models Chapman and Hall.

See Also
nagdmc basic reg
nagdmc binomial reg
nagdmc extr regnagdmc linear reg
nagdmc logit reg
nagdmc loglinear reg
nagdmc poisson reg
nagdmc probit reg
nagdmc stepwise regbinomial reg ex.clinear reg ex.cpoisson reg ex.c
stepwise reg ex.c

simplified version of nagdmc reg using a restricted set of parameters.
generalized linear model with binomial errors.
computes fitted values, residuals and leverages for a regression.
linear model with Normal errors.
simplified version of nagdmc binomial reg using a logit link and a
and a restricted set of parameters.
simplified version of nagdmc poisson reg using a log link and a
restricted set of parameters.
generalized linear model with poisson errors.
simplified version of nagdmc binomial reg using a probit link and a
restricted set of parameters.
stepwise linear regression with Normal errors.
the example calling program for a generalized linear model with binomial
the example calling program for linear regression.
the example calling program for a generalized linear model with Poissonerrors.
the example calling program for stepwise linear regression.
errors.

nagdmc predict reg.2