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 glmcore glmest glmlrtest glmll glmlink glmdiagh

Macro: glmstat
Description: glmstat provides some statistics for a fitted GLM.

Link:
Usage: stat = glmstat(code,x,y,b,bv{,opt})
Input:
code text string, the short code for the model (e.g. "bilo" for logit or "noid" for ordinary PLM).
x n x p matrix, the predictor variables.
y n x 1 vector, the response variables. (In the case of replicated data, the number of replications should be given in opt.wx and y should contain the sums of all responses for a replication.)
b p x 1 vector, estimated coefficients.
bv p x p matrix, inverse Hessian of optimization procedure. This is the estimated covariance of b, as it comes out of "glmcore", i.e. not yet corrected for dispersion!
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, all weights are set to 1.
opt.off scalar or n x 1 vector, offset in linear predictor. If not given, set to 0.
opt.pow scalar, power for power link. If not given, set to 0 (logarithm).
opt.nbk scalar, extra parameter k for negative binomial distribution. If not given, set to 1 (geometric distribution).
Output:
stat list with the following statistics:
stat.serror standard errors of parameter estimates.
stat.tvalue t-values for parameter estimates.
stat.pvalue p-values for significance of parameter estimates.
stat.df degrees of freedom.
stat.deviance deviance.
stat.pearson generalized pearson's chi^2.
stat.loglik log-likelihood.
stat.dispersion dispersion parameter estimate =pearson/df.
stat.r2 (pseudo) R^2.
stat.adr2 adjusted (pseudo) R^2.
stat.aic AIC criterion.
stat.bic BIC criterion.

Example:
library("glm")
;==========================
;  simulate data 
;==========================
n=100
b=1|2
p=rows(b)
bv=0.*matrix(p,p)
x=2.*uniform(n,p)-1
y=( 1./(1+exp(-x*b)).>uniform(n) )
;==========================
;  compute statistics
;==========================
glmstat("bilo",x,y,b,bv)
Result:
This result cannot be improved by any estimate :-)

Library: glm
See also: glmopt glmcore glmest glmlrtest glmll glmlink glmdiagh

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