mtm.lag2 {mtm} | R Documentation |
Fit a lag-2 marginal transition model for longitudinal binary outcome data.
mtm.lag2(marginal, trans1, trans2, id, beta=NULL, alpha1=NULL, alpha2=NULL, tol = 1e-4, iter = 50, data=sys.frame(sys.parent()))
marginal |
a symbolic description of the model to be fit that generally takes the form y ~ x . Further details of model specification are provided below.
|
trans1 |
covariates used to estimate the dependence of y(t) on y(t-1) . The model specification of the z1 is a subset of covariates x .
|
trans2 |
covariates used to estimate the dependence of y(t) on y(t-2) . In general, z2 is a subset of covariates x .
|
id |
a vector that identifies the clusters which correspond to the binary response vector given by y .
|
beta |
initial parameter estimate(s) optionally provided by the user of how the covariates x(t) influence the average response y(t) . The number of estimates provided in beta should correspond to the number of covariates in x , including an intercept.
|
alpha1 |
initial estimate(s) optionally provided by the user of how the dependence of y(t) on y(t-1) varies as a function of covariate(s) z1 . The number of estimates provided in alpha1 should correspond to the number of covariates in z1 used to assess the serial dependence in the outcome measure.
|
alpha2 |
initial estimate(s) optionally provided by the user of how the dependence of y(t) on y(t-2) varies as a function of covariate(s) z2 . The number of estimates provided in alpha2 should correspond to the number of covariates in z2 used to assess the serial dependence in the outcome measure.
|
tol |
tolerance is a measure used in the numerical calculations to determine whether or not convergence of the point estimates has occurred. The default is 1e-4. |
iter |
number of iterations to obtain convergence of estimates with the limits specified by tol . The default is 50 iterations.
|
data |
an optional data frame containing the variables in the model. If not found in data , the variables are taken from environment(formula) , typically the environment from which mtm.lag2 is called.
|
Returns an object of class mtm.lag2
. The function print.mtm2
is used to obtain and print a summary of the results. See below for an example.
mtm.lag2
assumes that the longitudinal measurements of y
and x
are collected at equally spaced intervals, though each of the N
clusters or individuals need not have measurements at every interval. y
is the longitudinal (binary) response vector measured on clusters or individuals specified by id
.
The marginal
model is specified symbolically as a formula. A typical model has the form y ~ x
The covariates x
are a series of terms separated by +
which specify the marginal linear predictor for y
. The parameter(s) beta
denote the marginal dependence of y(t)
on covariates x(t)
The user may provide initial estimate(s) for beta
.
The transitional model statement (trans1
) has the form ~ z1
where trans1
. The parameter(s) alpha1
determine how the dependence of y(t)
on y(t-1)
varies as a function of covariates z1(t-1)
. The covariates z1
are generally a subset of x
, possibly just an intercept. An initial estimate of alpha1
may be provided by the user.
The transitional model statement (trans2
) has the form ~ z2
where trans2
. The parameter(s) alpha2
determine how the dependence of y(t)
on y(t-2)
varies as a function of covariates z2(t-2)
. The covariates z2
are generally a subset of x
, possibly just an intercept. An initial estimate of alpha2
may be provided by the user.
All formulas have an implied intercept term. To remove this include -1
on the right-hand side of the formula statement. See formula
for more details.
P. Heagerty (2002), Marginalized transition models and likelihood inference for longitudinal categorical data. Biometrics, 58, 342-51.
A. Azzalini (1994), Logistic regression for autocorrelated data with application to repeated measures. Biometrika, 81, 767-75 (correction: 1997. 84, 989).
# ## Data for this example may be found in the dataset 'madras.rda'. # data(madras) attach(madras) # ## lag-2 MTM model call -- Model 5 of Heagerty (2002): # model2 <- mtm.lag2(marginal = y ~ month + age + gender + monthXage + monthXgender, trans1 = ~ initial + month, trans2 = ~ 1, id=id, beta=NULL, alpha1=NULL, alpha2=NULL, data=madras) print.mtm2(model2)