Usage: |
myfit = glmmultlo(x,y{,opt})
|
Input: |
| x | n x r matrix, the predictor variables.
Individual-specific variables form single
columns of x. Alternative-specific variables
must be evaluated for each alternative and
are to be stored in blocks of m subsequent
columns. The optional parameters opt.indiv
and opt.alter define which columns belong
to which group. Without these optional
parameters, all columns of x are interpreted
as individual-specific.
|
| y | n x 1 vector or n x m matrix. If y is vector
(numeric or string), the different
realizations are considered to be the
alternatives. If y is matrix, it should
contain 0/1 dummies, with 1 in the j-th column
indicating that alternative j (in 1 ... m) has
been chosen.
|
| 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.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.indiv | indices of columns of x (=variables) which are
individual-specific, i.e. which are constant
over alternatives. If neither opt.indiv and
opt.alter are given, the model is estimated as
if opt.indiv=1:r. Otherwise, the default is
empty.
|
| opt.alter | indices of columns of x (=variables) which are
alternative-specific, i.e. which vary over
the alternatives (and eventually individuals).
x[,opt.alter] should have a multiple of m
columns, i.e. contain subsequent realizations
for each of the alternatives. The default is empty.
|
Output: |
| myfit | list with the components b, bv, and stat:
|
| b.indiv | p x m vector, estimated coefficients
corresponding to individual-specific variables.
The first column is zero.
|
| b.alter | q x 1 vector, estimated coefficients corresponding
to alternative-specific variables.
|
| bv.indiv | (p*m) x (p*m) matrix, estimated covariance
for b.indiv, matrix of p x p blocks.
|
| bv.alter | q x q matrix, estimated covariance for b.alter.
|
| bv.mixed | (p*m) x q matrix, estimated mixed covariances
between b.alter and b.indiv, vector of p x q
blocks.
|
| mu | n x m vector, estimated response mu=P(y=j)
corresponding to alternatives 1 ... m of y.
|
| stat | list with the following statistics:
|
| stat.serror | standard errors, list containing components
indiv and/or alter, respectively.
|
| stat.tvalues | t-values, list containing components
indiv and/or alter, respectively.
|
| stat.pvalues | p-values, list containing components
indiv and/or alter, respectively.
|
| stat.deviance | deviance,
|
| stat.loglik | log-likelihood,
|
| stat.r2 | (pseudo) R^2.
|
| stat.adr2 | adjusted (pseudo) R^2.
|
| stat.it | scalar, number of iterations needed
|
| stat.ret | scalar, return code:
0 o.k.,
1 maximal number of iterations reached,
-1 missing values have been encountered.
|