View source: R/main_function.R
ELCICwgee | R Documentation |
The function ELCICwgee
provides the model selection under the syntax of the wgeesel package.
ELCICwgee(models, candidate.cor.sets, data, model_mis, family,r,id,time)
models |
A list of formulas. See corresponding documentation to wgeesel. |
candidate.cor.sets |
A vector containing candidate correlation structures. It can be any subset of c("independence","exchangeable", "ar1"). |
data |
A data frame containing the variables in both the main model and the missing model. |
model_mis |
A formula used in the missing data model. |
family |
A description of the error distribution and link function to be used in the model. The details are given under "Details". |
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. |
Three commonly used distributions are considered: "gaussian", "poisson", "binomial". For the current package, the identity link is considered for a "gaussian" distribution; the log link is considered for a "poisson" distribution; the logit link is considered for a "binomial" distribution;n;
A list with two items: model selection result based on ELCIC; An object of "wgee" based on the selected model.
## tests # load data data(wgeesimdata) family<-binomial() r<-wgeesimdata$obs_ind id<-wgeesimdata$id time<-3 dat <- data.frame(y=wgeesimdata$y, wgeesimdata$x,x_mis1=wgeesimdata$x_mis[,2]) models <- list(y~x1+x2) model_mis<-r~x_mis1 candidate.cor.sets<-c("exchangeable") output<-ELCICwgee(models, candidate.cor.sets,data=dat,model_mis,family,r,id,time) output$model.selection output$wgee.output
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.