Estimation and exploratory hypothesis testing with missing data.
bggm_missing(x, iter =2000, method ="estimate",...)
Arguments
x: An object of class midmice.
iter: Number of iterations for each imputed dataset (posterior samples; defaults to 2000).
method: Character string. Which method should be used (default set to estimate)? The current options are "estimate" and "explore".
...: Additional arguments passed to either estimate or explore.
Returns
An object of class estimate or explore.
Note
Currently, BGGM is compatible with the package mice for handling the missing data. This is accomplished by fitting a model for each imputed dataset (i.e., more than one to account for uncertainty in the imputation step) and then pooling the estimates.
In a future version, an additional option will be added that allows for imputing the missing values during model fitting. This option will be incorporated directly into the estimate or explore functions, such that bggm_missing will always support missing data with mice.
Support :
There is limited support for missing data. As of version 2.0.0, it is possible to determine the graphical structure with either estimate or explore, in addition to plotting the graph with plot.select. All data types are currently supported.
Memory Warning : A model is fitted for each imputed dataset. This results in a potentially large object.
Examples
# note: iter = 250 for demonstrative purposes# need this packagelibrary(mice, warn.conflicts =FALSE)# dataY <- ptsd[,1:5]# matrix for indicesmat <- matrix(0, nrow =221, ncol =5)# indicesindices <- which(mat ==0, arr.ind =TRUE)# Introduce 50 NAsY[indices[sample(1:nrow(indices),50),]]<-NA# imputex <- mice(Y, m =5, print =FALSE)################################ copula ############################### rank based parital correlations# estimate the model fit_est <- bggm_missing(x, method ="estimate", type ="mixed", iter =250, progress =FALSE, seed =1234)# select edge setE <- select(fit_est)# plot Eplt_E <- plot(E)$plt
plt_E