The function ELCIC.wgee.single
to calculate ELCIC value for a given candidate mean model with specified working correlation structure. It is able to simultaneously evaluate mean model and working correlation structure. The data is dropout missing and missing at random.
ELCIC.wgee.single(x,y,x_mis,r,id,time,index.var=NULL,
name.var=NULL,dist,corstr,joints=TRUE,lag=1)
A matrix containing values of calculated estimating equations.
A matrix containing covariates. The first column should be all ones corresponding to the intercept if the intercept is considered in the marginal mean. Covariate matrix should be complete. See more in details section.
A vector containing outcomes. Use NA to indicate missing outcomes.
A matrix containing covariates for the missing data model. The first column should be all ones corresponding to the intercept. This covariate matrix should be complete and all observed. See more in details section.
A vector indicating the observation of outcomes: 1 for observed records, and 0 for unobserved records.
A vector indicating subject id.
The number of observations in total for each subject
A vector containing index corresponding to candidate covariates. See more in details section.
A vector containing names of candidate covariates. The names should be subset of column names of x matrix. See more in details section.
A specified distribution. It can be "gaussian", "poisson",and "binomial".
A candidate correlation structure. It can be "independence","exchangeable", and "ar1".
A logic value for joint selection of marginal mean and working correlation structure. The default is TRUE. See more in details section.
A numeric value indicating lag-response involved in the missing data model. It can be one of 0, 1, and 2. The default is 1.
Covariate matrix "x" should be complete. If missing data are present in "x", the elements in covariate vector will be replaced by zeros for individuals who have missing covariates.
The argument "x_mis" includes all covariates to fit the missing data model. It does not contains a lag variable based on the outcome y. The argument "lag" in this function will automatically add lag-response variables to indicate the data missing at random.
Either arguments "index.var" or "name.var" is used to identify the candidate mean model. If both arguments are provided, only the argument "name.var" will be used.
When the argument "joints" is TRUE, ELCIC.wgee.single
will calculate ELCIC value based on the function lambda.find.wgee
and ee.wgee
, which involve estimating equations for both marginal mean and correlation coefficient. When the argument "joints" is FALSE, ELCIC.wgee.single
will calculate ELCIC value based on the function lambda.find.wgee.mean
and ee.wgee.mean
, which only involve estimating equations for marginal mean.
## tests
# load data
data(wgeesimdata)
corstr<-"exchangeable"
dist<-"binomial"
x<-wgeesimdata$x
y<-wgeesimdata$y
x_mis<-wgeesimdata$x_mis
r<-wgeesimdata$obs_ind
id<-wgeesimdata$id
time<-3
index.var<-c(1,2,3)
ELCIC_value<-ELCIC.wgee.single(x,y,x_mis,r,id,time,index.var,name.var=NULL,
dist,corstr,joints=TRUE)
ELCIC_value
Run the code above in your browser using DataLab