Learn R Programming

JGEE (version 1.1)

JGee2: Function to fit a joint generalized estimating equation model with response-specific regression coefficients

Description

This function fits a joint generalized estimating equation model to multivariate longitudinal data with mono-type or mixed responses where the regression coefficients are response-specific.

Usage

JGee2(formula, id, data, nr, na.action = NULL, family = list(gaussian(link = "identity"), gaussian(link = "identity")), corstr1 = "independence", Mv = NULL, corstr2 = "independence", beta_int = NULL, R1 = NULL, R2 = NULL, scale.fix = FALSE, scale.value = 1, maxiter = 25, tol = 10^-3, silent = FALSE)

Arguments

formula
A formula expression in the form of cbind(res1,...,resnr)~predictors.
id
A vector for identifying subjects.
data
A data frame which stores the variables in formula with id variable.
nr
Number of multiple responses.
na.action
A function to remove missing values from the data. Only na.omit is allowed here.
family
A family object: a list of functions and expressions for defining link and variance functions. Families supported in JGee2 are binomial, gaussian, gamma and poisson. The links, which are not available in gee, is not available here. The default family is gaussian.
corstr1
A character string, which specifies the type of within-subject correlation structure. Structures supported in JGee2 are "AR-1","exchangeable", "fixed", "independence","stat_M_dep","non_stat_M_dep", and "unstructured". The default corstr1 type is "independence".
Mv
If either "stat_M_dep", or "non_stat_M_dep" is specified in corstr1, then this assigns a numeric value for Mv. Otherwise, the default value is NULL.
corstr2
A character string, which specifies the type of multivariate response correlation structure. Structures supported in JGee2 are "exchangeable", "independence", and "unstructured". The default corstr2 type is "independence".
beta_int
User specified initial values for regression parameters. The default value is NULL.
R1
If corstr1="fixed" and corstr2="fixed" are specified, then R1 is a square matrix of dimension maximum cluster size containing the user specified correlation. Otherwise, the default value is NULL.
R2
If corstr1="fixed" and corstr2="fixed" are specified, then R2 is a square matrix of dimension nr size containing the user specified correlation. Otherwise, the default value is NULL.
scale.fix
A logical variable; if true, the scale parameter is fixed at the value of scale.value. The default value is FALSE.
scale.value
If scale.fix=TRUE, this assignes a numeric value to which the scale parameter should be fixed.
maxiter
The number of iterations that is used in the estimation algorithm. The default value is 25.
tol
The tolerance level that is used in the estimation algorithm. The default value is 10^-3.
silent
A logical variable; if true, the regression parameter estimates at each iteration are printed. The default value is FALSE.

Value

JGee2 representing the fit.

See Also

JGee1

Examples

Run this code
## Not run: 
# 
# #check the data
# data(MSCMsub)
# 
# #rename it
# mydata=MSCMsub
# 
# #check the column labels for formula object
# head(mydata)
# 
# #prepare formula object before model fitting
# formulaj2=cbind(stress,illness)~chlth+csex+education+employed+housize+married+mhlth+race
# 
# #prepare family object before model fitting
# familyj2=list(binomial(link="logit"),binomial(link="logit"))
# 
# #fit the model
# fitjgee2=JGee2(formula=formulaj2,id=mydata[,1],data=mydata,nr=2,na.action=NULL, 
# family=familyj2, corstr1="exchangeable", Mv=NULL, corstr2="unstructured", 
# beta_int=rep(0,18), R1=NULL, R2=NULL, scale.fix=FALSE, scale.value=1, maxiter=30, 
# tol=10^-3, silent=FALSE)
# 
# #check the object names returned by fitjgee2
# names(fitjgee2)
# 
# #check the object names returned by summary(fitjgee2)
# names(summary(fitjgee2))
# 
# #get the coefficients
# summary(fitjgee2)$coefficients
# 
# #get the within-subject correlation matrix
# summary(fitjgee2)$working.correlation1
# 
# #get the multivariate response correlation matrix
# summary(fitjgee2)$working.correlation2
# 
# #get the overall working correlation matrix
# summary(fitjgee2)$working.correlation
# 
# ## End(Not run)

Run the code above in your browser using DataLab