mmm2: Function to fit multivariate marginal models with shared...

Description Usage Arguments Details Value Note Author(s) References See Also Examples

Description

fits multivariate marginal models with shared regression parameters for both continous and discrete responses

Usage

1
2
3
mmm2(formula, id, data = NULL, rtype = TRUE, interaction = NULL, R = NULL, 
b = NULL, tol = 0.001, maxiter = 25, family = "gaussian", corstr = "independence", 
Mv = 1, silent = TRUE, scale.fix = FALSE, scale.value = 1)

Arguments

formula

a formula expression, see the examples given below.

id

a vector for identification of the clusters or a single sided formula, see examples.

data

an optional data frame.

rtype

a logical variable which determines the inclusion of response type indicator variables as new covariates. The default is set to TRUE which corresponds to the inclusion of response types by placing them right after the last covariate in the design matrix. For k multiple responses, k-1 indicator variables are to be created and mmm2 has a systematic way of creating these variables: The first response takes 0 for all the k-1 indicator variables and jth response ( j = 2, ..., k) takes 1 only for the (k-j+1)th indicator variable and takes 0 otherwise.

interaction

expects a vector of integers which includes the column number of the covariates (by considering only the covariate matrix, not the whole data) which are to be interacted with the response type indicator variables. These interactions are added as new covariates right after the last response type indicator variable. If rtype is set to FALSE, mmm2 ignores interaction even if it is set to a vector of column numbers of some covariates.

R

a user specified square matrix for the working correlation matrix, appropriate when corstr="fixed".

b

user specified initials for the parameter estimates.

tol

the tolerance which specifies the convergency of the algorithm.

maxiter

the maximum number of iterations to be consumed by the algorithm.

family

an object which defines the link and variance function. The possible choices are same with the ones in the "gee" package. For details see the gee documentation. Note that family=binomial handles multivariate longitudinal binary data, family=poisson handles multivariate longitudinal count data, family=gaussian handles multivariate longitudinal (normal type) continous data and family=gamma handles multivariate longitudinal (gamma type) continous data.

corstr

a character string which defines the structure of the working correlation matrix. For details see the gee documentation.

Mv

specifies the lag value, e.g. specification of "corstr=AR-M" and "Mv=1" indicates AR(1).

silent

a logical variable which decides the print of the iterations.

scale.fix
scale.value

Details

The mmm2 function utilizes the gee package within.

Value

Returns an onject of the results. See the examples given below.

Note

This is the version 1.2 of this user documentation file.

Author(s)

Ozgur Asar, Ozlem Ilk

References

Asar, O. (2012). On multivariate longitudinal binary data models and their applications in forecasting. MS Thesis, Middle East Technical University. Available at http://www.lancaster.ac.uk/pg/asar/thesis_Ozgur

Asar, O., Ilk, O. (2013). mmm: an R package for analyzing multivariate longitudinal data with multivariate marginal models. Computer Methods and Programs in Biomedicine, 112 649–654.

Ilk, O., Daniels, M. (2007). Marginalized transition random effects models for multivariate longitudinal binary data. Canadian Journal of Statistics, 35, 105-123.

Liang, K. L., Zeger, S. L. (1986). Longitudinal data analysis using generalized linear models. Biometrika, 73, 13-22.

Shelton, B. J., Gilbert, G. H., Liu, B., Fisher, M. (2004). A SAS macro for the analysis of multivariate longitudinal binary outcomes. Computer Methods and Programs in Biomedicine, 76, 163-175.

Zeger, S. L., Liang, K. L. (1986). Longitudinal data analysis for discrete and continous outcomes. Biometrics, 42, 121-130.

See Also

gee

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## binary data application
data(Kenya_morbidity)
fit1 <- mmm2(cbind(poor_appetite, headache) ~ visit_num + age_at_onset + boy + 
             as.factor(treatment), id = ~ ID, data = Kenya_morbidity, interaction = 1 : 6, 
             family = binomial(link = logit), corstr = "unstructured")
summary(fit1)$coef

## count data application
data(mlcd)
fit2<-mmm2(formula=cbind(mlcd$resp1,mlcd$resp2)~mlcd$X+mlcd$time+
mlcd$X.time,id=mlcd$ID,rtype=TRUE,interaction=1:3,family=poisson,corstr="unstructured")
summary(fit2)$coef

## continuous data application
data(mlgd)
fit3<-mmm2(formula=cbind(mlgd$resp1,mlgd$resp2)~mlgd$X+mlgd$time+
mlgd$X.time,id=mlgd$ID,rtype=TRUE,interaction=1:3,family=gaussian,corstr="unstructured")
summary(fit3)$coef

mmm2 documentation built on May 2, 2019, 5:41 a.m.