nagdmc extr reg

NAG DMC

Regression Results: nagdmc extr reg
Purposenagdmc extr reg extracts the linear predictor, fitted value, residual and leverage for a single data
record and a previously fitted regression model. The regression model must be fitted by using oneof the functions: nagdmc linear reg, nagdmc binomial reg, nagdmc poisson reg, nagdmc basic reg,nagdmc logit reg, nagdmc probit reg, nagdmc loglinear reg or nagdmc stepwise reg.

Declaration#include <nagdmc.h>void nagdmc extr reg(double model[], double data[], double *eta, double *fv,double *res, double *h, int *info);

Parameters1:

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:

fv – double *On exit: if not 0, the estimated fitted value for the model.

Output5:

res – double *On exit: if not 0, the residual.

Output6:

h – double *On exit: if not 0, the leverage.

Output7:

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: the specification of the ith formal parameter was incorrect.
46: information in model has been corrupted.
99: the function failed to allocate enough memory.

Notationetafv
reshlinear predictor, ηi .
fitted value, fi .
residual, ri .
leverage, hi .

Description
The nag extr reg function is a utility function that extracts the linear predictor (ηi ), fitted values(fi = µ̂), residuals (ri ) and leverage (hi ) for a single data record, based on a generalized linear
model fitted previously.
Details on the calculation of the ηi , fi , ri and hi can be found in the description sections of themodel fitting routines nagdmc linear reg, nagdmc binomial reg and nagdmc poisson reg.

nagdmc extr reg.1

nagdmc extr reg

NAG DMC

References and Further Reading
Cook R D and Weisberg S (1982) Residuals and Influence in Regression Chapman and Hall.
McCullagh P and Nelder J A (1983) Generalized Linear Models Chapman and Hall.

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

simplified version of nagdmc reg using a restricted set of parameters.
generalized linear model with binomial errors.
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.
computes predictions given a fitted regression model.
simplified version of nagdmc binomial reg using a probit link and arestricted 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 Poisson
errors.
the example calling program for stepwise linear regression.

nagdmc extr reg.2