Usage: |
glmfit(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. 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.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.title | string, title for the output. If not given, a default
is set.
|
| opt.xvars | p x 1 string vector, variable names for the output.
Note, that only up to 11 characters are used.
|
Output: |
| glmfitOutput 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 th index
vs. the link function.
|
| glmfitout or opt.name+"out" | string vector, global, containing estimation result
in the left panel as text.
|
| glmfit or opt.name | list, global variable with the components:
|
| glmfit.b | p x 1 vector, estimated coefficients.
|
| glmfit.bv | p x p matrix, estimated covariance matrix for b.
|
| glmfit.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).
|