Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: glm
See also: glmopt glmest glmout doglm linreg gls

Macro: glmnoid
Description: glmnoid fits a generalized linear model where y|x is normally distributed and E[y|x] and x*beta are linked via the identity function (canonical link)

Reference(s):

Link:
Usage: myfit = glmnoid(x,y{,opt})
Input:
x n x p matrix, the predictor variables
y n x 1 vector, the response variables,
opt optional, a list with optional input. The macro "glmopt" can be used to set up this parameter. The order of the list elements is not important. Parameters which are not given are replaced by defaults (see below).
opt.wx scalar or n x 1 vector, prior weights. If not given, set to 1.
opt.off scalar or n x 1 vector, offset in linear predictor.
Output:
myfit.b p x 1 vector, estimated coefficients.
myfit.bv p x p matrix, estimated covariance matrix for b.
myfit.mu n x 1 vector, estimated response mu.
myfit.w n x 1 vector, contains the final weights.
myfit.h n x 1 vector, diagonal elements of 'hat' matrix.
myfit.stat list with the following statistics:
myfit.stat.df degrees of freedom.
myfit.stat.deviance deviance.
myfit.stat.pearson generalized pearson's chi^2.
myfit.stat.loglik log-likelihood.
myfit.stat.dispersion dispersion parameter estimate =pearson/df.
myfit.stat.r2 (pseudo) R^2.
myfit.stat.adr2 adjusted (pseudo) R^2.
myfit.stat.aic AIC criterion.
myfit.stat.bic BIC criterion.
myfit.stat.it scalar, number of iterations needed
myfit.stat.ret scalar, return code: 0 o.k., -1 missing values have been encountered.

Note:

Example:
library("glm") 
x = read("motcyc")
x = (x-min(x))./(max(x)-min(x))
y = x[,2]
x = matrix(rows(x))~x[,1]~x[,1]^2
g = glmnoid(x,y)
g.b
g.bv
Result:
A quadratic fit for E[y|x] is computed. 'g.b' gives the
coefficients, 'g.bv' their estimated covariance.

Library: glm
See also: glmopt glmest glmout doglm linreg gls

Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Author: Berwin Turlach, Isabel Proenca, 930726 & Marlene Mueller, 970523
(C) MD*TECH Method and Data Technologies, 28.6.1999