Description
Internal function for extracting design matrix from call to phmm
. Code adapted from bayesurvreg.design
function in the bayesSurv
package.Usage
phmm.design(m, formula, random, data)
Arguments
m
match.call
from call to phmm
.
formula
formula component from call to phmm
.
random
random component from call to phmm
.
data
data component from call to phmm
.
Value
- nnumber of observations (in the case of bivariate data, this
is a number of single observations, i.e. $2\times \mbox{sample
size}$) included in the dataset
- nclusternumber of clusters included in the dataset. In the
case of bivariate data this is equal to the number of bivariate
observations. If there are no random effects included in the model
and if the observations are not bivariate then
ncluster = n
- nwithina~vector of length equal to
ncluster
with
numbers of observations within each cluster. In the case of
bivariate observations this is a~vector filled with 2's, if there are
no random effects and if the observations are not bivariate then
this is a~vector filled with 1's - nYnumber of columns in the response matrix $Y$. This is
equal to 2 if there are no interval-censored observations and equal
to 3 if there is at least one interval censored observation in the
dataset
- nZnumber of columns in the design matrix $Z$. Note that
the matrix $Z$ contains covariates for both fixed and random
effects
- nfixednumber of fixed effects involved in the model. Note that
possible intercept is always removed from the model
- nrandomnumber of random effects in the model, possible random
intercept included
- randomInt
TRUE
/FALSE
indicating whether the
random intercept is included in the model - Yresponse matrix. Its last column is always equal to the
status indicator (1 for exactly observed event times, 0 for
right-censored observations, 2 for left-censored observations, 3 for
interval-censored observations).
- Zdesign matrix containing covariates for fixed effects.
- Wdesign matrix containing covariates for random effects.
- Yinitresponse matrix extracted from
formula
using model.extract
- Zinitdesign matrix extracted from
formula
using
model.matrix
function - clustera~vector of length
n
with identifications of
clusters (as given by cluster
in formula
) - indba~vector of length
nZ
identifying fixed and random
effects. indb[j] = -1
if the $j$th column of matrix
$Z$ is a fixed effects. it is equal to $l$ if the
$j$th column of matrix $Z$ corresponds to the
$l$th random effect (in C++ indexing) - rnames.Zrow names of
Zinit
- names.randomcolumn names of the $Z$ matrix corespning
to the random effects. If there is the random intercept in the
model, the first component of this vector is equal to "(Intercept)"
References
Arnost Komarek (2007). bayesSurv: Bayesian Survival Regression with Flexible Error and Random Effects Distributions. R package version 0.5-9. http://www.karlin.mff.cuni.cz/~komarek