Description Usage Arguments Value Note See Also Examples
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.
1 2 3 4 5 6 |
formula |
A formula expression in the form of |
id |
A vector for identifying subjects. |
data |
A data frame which stores the variables in |
nr |
Number of multiple responses. |
na.action |
A function to remove missing values from the data. Only |
family |
A |
corstr1 |
A character string, which specifies the type of within-subject correlation structure.
Structures supported in |
Mv |
If either |
corstr2 |
A character string, which specifies the type of multivariate response correlation structure.
Structures supported in |
beta_int |
User specified initial values for regression parameters. The default value is |
R1 |
If |
R2 |
If |
scale.fix |
A logical variable; if true, the scale parameter is fixed at the value of |
scale.value |
If |
maxiter |
The number of iterations that is used in the estimation algorithm. The default value is |
tol |
The tolerance level that is used in the estimation algorithm. The default value is |
silent |
A logical variable; if true, the regression parameter estimates at each iteration are
printed. The default value is |
An object class of JGee1
representing the fit.
The structures "non_stat_M_dep"
and "unstructured"
are valid only when the data is balanced.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.