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 genbilo

Macro: glmbilo
Description: glmbilo fits a generalized linear model where y|x is binomial distributed and E[y|x] and x*b are linked via the logistic function (canonical link)

Reference(s):

Link:
Usage: myfit = glmbilo(x,y{,opt})
Input:
x n x p matrix, the predictor variables
y n x 1 vector, the response variables, y[i] may have (integer) values between 0 and opt.wx[i] or opt.wx (if opt.wx is scalar).
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, usually the binomial index vector. If not given, set to 1.
opt.shf integer, if exists and =1, some output is produced which indicates how the iteration is going on.
opt.miter integer, maximal number of iterations. The default is 10.
opt.cnv scalar, convergence criterion. The default is 0.0001.
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 maximal number of iterations reached, -1 missing values have been encountered.

Note:

Example:
library("glm") 
x = read("lizard")
x = paf(x,(x[,6]!=0))
y = x[,5]
opt=glmopt("wx",x[,6])
x = matrix(rows(x))~x[,1:3]~(x[,4]==1)~(x[,4]==2)
g = glmbilo(x,y,opt)
g.b
g.bv
Result:
A logit 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 genbilo

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, 940516 & Marlene Mueller, 970523
(C) MD*TECH Method and Data Technologies, 28.6.1999