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 glmcore glmstat glmout

Quantlet: doglm
Description: doglm provides an interactive menu for preparing data and fitting GLM in XploRe.

Reference(s):

Link:
Usage: doglm(x,y{,opt})
Input:
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.)
opt optional, a list with optional input. "glmopt" can be used to set up this parameter. The order of the list elements is not important.
opt.code text string, the short code for the model (e.g. "bilo" for logit or "noid" for ordinary PLM).
opt.weights string, type of weights. Can be "frequency" for replication counts, or "prior" (default) for prior weights in weighted regression.
opt.wx scalar or n x 1 vector, frequency or prior weights. If not given, set to 1.
opt.off scalar or n x 1 vector, offset in linear predictor. If not given, set to 0.
opt.name string, prefix for the output. If not given, "glm" is used.
opt.xvars p x 1 string vector, variable names for the output. Note, that only up to 15 characters are used.
opt.title string, title for the output. If not given, a default is set.
opt.nopic integer, if exists and =1, output is not shown in displays, but written to XploRe_out.
Output:
doglm or opt.name, list, global variable with the components:
doglm.b p x 1 vector, estimated coefficients.
doglm.bv p x p matrix, estimated covariance matrix for b.
doglm.stat list with components as computed by glmstat: serror (standard errors of coefficients), tvalue (t-values for coefficients), pvalue (p-values for coefficients), df (degrees of freedom), deviance (deviance), pearson (generalized pearson's chi^2), loglik (log-likelihood), dispersion (estimated dispersion =pearson/df), r2 ((pseudo) coefficient of determination), adr2 (adjusted (pseudo) coefficient of determination), aic (Akaike's AIC criterion), bic (Schwarz' BIC criterion), and it (number of iterations needed), ret (return code, 0 if everything went o.k., 1 if maximal number of iterations reached, -1 if missing values have been encountered), nr (number of replications found in x).
doglmSummary or opt.name+"Summary", display, containing summary statistics and show which variables are selected for fit.
doglmsum or opt.name+"sum", string vector, global, containing summary statistics as text.
doglmOutput or opt.name+"Output", display, containing estimation result in the left panel and a plot of the index x*b{+off} vs. y (vs. y./wx for binomials) and a plot of the index vs. the link function.
doglmout or opt.name+"out", string vector, global, containing estimation result in the left panel as text.

Example:
library("glm")
n=100
b=-2|0|0|0|2
p=rows(b)
x=normal(n,p)-1
y=x*b+normal(n) >0
doglm(x,y)

Result:
For the fit you should use "binomial" distribution and e.g.
"gaussian" link.
You may play around with different subsets of the explanatory
variables.



Author: M. Mueller, 20010228
(C) MD*TECH Method and Data Technologies, 05.02.2006