View source: R/model_selection.R
ELCIC.gee.single | R Documentation |
The function ELCIC.gee.single
calculates ELCIC value for a given marginal mean candidate model with a specified working correlation structure. It is able to simultaneously evaluate mean model and working correlation structure.
ELCIC.gee.single(x, y, r, id, time, index.var=NULL, name.var = NULL, dist, corstr, joints=TRUE)
x |
A matrix containing covariates. The first column should be all ones corresponding to the intercept. If y and x are missing completely at random, use NA to indicate missingness and specify argument "r". |
y |
A vector containing outcomes. If y and x are missing completely at random, use NA to indicate missing outcomes and specify argument "r". |
r |
A vector indicating the observation of data: 1 for observed records (both outcome and covariates are observed for a given subject), and 0 for unobserved records. The default setup is that all data are observed. |
id |
A vector indicating subject id. |
time |
The number of observations in total for each subject |
index.var |
A vector containing index corresponding to candidate covariates. See more in details section. |
name.var |
A vector containing names of candidate covariates. The names should be subset of column names of x matrix. See more in details section. |
dist |
A specified distribution. It can be "gaussian", "poisson",and "binomial". |
corstr |
A candidate correlation structure. It can be either of "independence","exchangeable", and "ar1". |
joints |
A logic value for joint selection of marginal mean and working correlation structure. The default is TRUE. See more in details section. |
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.gee.single
will calculate ELCIC value based on the function lambda.find.gee
and ee.gee
, which involve estimating equations for both marginal mean and correlation coefficient. When the argument "joints" is FALSE, ELCIC.gee.single
will calculate ELCIC value based on the function lambda.find.gee.mean
and ee.gee.mean
, which only involve estimating equations for marginal mean.
A ELCIC value for a given candidate model.
## tests # load data data(geesimdata) x<-geesimdata$x y<-geesimdata$y id<-geesimdata$id r<-rep(1,nrow(x)) time<-3 corstr<-"exchangeable" dist<-"poisson" criteria<-ELCIC.gee.single(x=x,y=y,r=r,id=id,time=time,index.var=c(1,2,3), name.var=NULL,dist=dist,corstr=corstr) criteria
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.