JGee1: Function to fit a joint generalized estimating equation model...

Description Usage Arguments Value Note See Also Examples

View source: R/JGee1.R

Description

This function fits a joint generalized estimating equation model to multivariate longitudinal data with mono-type responses where the regression coefficients are shared by the different response types.

Usage

1
2
3
4
5
6
JGee1(formula, id, data, nr, na.action = NULL, 
family = 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 response~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 JGee1 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 JGee1 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 JGee1 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

An object class of JGee1 representing the fit.

Note

The structures "non_stat_M_dep" and "unstructured" are valid only when the data is balanced.

See Also

JGee2

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
## Not run: 
data(MSCMsub)
mydata=MSCMsub

#MSCM stduy data layout requires some arrangement for model fitting.

N=167
nt=4
nr=2

yvec=matrix(0,N*nt*nr,1)
xmat=matrix(0,N*nt*nr,8)

for(i in 1:N) {
for(j in 1:nt){
yvec[j+(i-1)*nr*nt]=mydata[j+(i-1)*nt,2]
yvec[j+(i-1)*nr*nt+nt]=mydata[j+(i-1)*nt,3]
}
}

for(i in 1:N) {
for(j in 1:nt){
for(k in 4:11){
xmat[j+(i-1)*nr*nt,(k-3)]=mydata[j+(i-1)*nt,k]
xmat[j+(i-1)*nr*nt+nt,(k-3)]=mydata[j+(i-1)*nt,k]
}
}
}

id=rep(1:N, each=(nt*nr))
mydatanew=data.frame(id,yvec,xmat)
head(mydatanew)
colnames(mydatanew)=c("id","resp","chlth","csex","education","employed",
"housize","married","mhlth","race")
head(mydatanew)

formulaj1=resp~chlth+csex+education+employed+housize+married+
mhlth+race

fitjgee1=JGee1(formula=formulaj1,id=mydatanew[,1],data=mydatanew, nr=2, 
na.action=NULL, family=binomial(link="logit"), corstr1="exchangeable", 
Mv=NULL, corstr2="independence", beta_int=NULL, R1=NULL, R2=NULL, 
scale.fix= FALSE, scale.value=1, maxiter=25, tol=10^-3, 
silent=FALSE)

summary(fitjgee1)

names(summary(fitjgee1))

summary(fitjgee1)$working.correlation1

## End(Not run)

JGEE documentation built on May 2, 2019, 11:51 a.m.