Usage: |
myfit = glmest(code,x,y{,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.
|
| 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. Can be used for
constrained estimation. If not given, set to 0.
|
| opt.shf | integer, if exists and =1, some output is produced
which indicates how the iteration is going on.
|
| opt.norepl | integer, if exists and =1, the data are assumed to
have no replications in x. Otherwise, the data
are searched for replications to fasten the
algorithm.
|
| opt.miter | integer, maximal number of iterations. The default
is 10.
|
| opt.cnv | scalar, convergence criterion. The default is 0.0001.
|
| opt.fscor | integer, if exists and =1, a Fisher scoring is
performed (instead of the default Newton-Raphson
procedure). This parameter is ignored for
canonical links.
|
| opt.pow | scalar, power for power link. If not given,
set to 0.
|
| opt.nbk | scalar, extra parameter k for negative binomial
distribution. If not given, set to 1 (geometric
distribution).
|
Output: |
| myfit.b | p x 1 vector, estimated coefficients.
|
| myfit.bv | p x p matrix, estimated covariance matrix
for coefficients.
|
| myfit.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).
|