Usage
fastml.lmm(y, subj, pred, xcol, zcol, vmax, occ, start,
maxits=50, eps=0.0001)
Arguments
y
vector of responses. This is simply the individual yi vectors
stacked upon one another. Each element of y represents the
observed response for a particular subject-occasion, or for a
particular unit within a cluster.
subj
vector of same length as y, giving the subject (or cluster)
indicators i for the elements of y. For example, suppose
that y is c(y1,y2,y3,y4) where length(y1)=2, length(y2)=3,
length(y3)=2, and length(y4)=7. Then subj should be
c(1,1,2,2,2,3,3,4,4,4,
pred
matrix of covariates used to predict y. The number of rows
should be length(y). The first column will typically be
constant (one), and the remaining columns correspond to other
variables appearing in Xi and Zi.
xcol
vector of integers indicating which columns of pred will be
used in Xi. That is, pred[,xcol] is the Xi matrices (stacked
upon one another.
zcol
vector of integers indicating which columns of pred will be
used in Zi. That is, pred[,zcol] is the Zi matrices (stacked
upon one another).
vmax
optional matrix of dimension c(max(occ),max(occ)) from which
the Vi matrices will be extracted. In a longitudinal dataset,
vmax would represent the Vi matrix for an individual with
responses at all possible occasions 1,2,...,nmax=max(occ);
for indivi
occ
vector of same length as y indicating the "occasions" for the
elements of y. This argument is relevant only if a
non-identity vmax is specified. In a longitudinal dataset
where each individual is measured on at most nmax distinct
occasions, each eleme
start
optional starting values of the parameters. If this argument
is not given then the function chooses its own starting values.
This argument should be a list of three elements named
"beta", "psi", and "sigma2". Note that "beta" should be a
vector of the
maxits
maximum number of cycles to be performed.
The algorithm runs to convergence or until "maxits"
iterations, whichever comes first.
eps
convergence criterion. The algorithm is considered to have
converged if the relative differences in all parameters from
one iteration to the next are less than eps--that is, if
all(abs(new-old)