Learn R Programming

BGGM (version 2.0.3)

bggm_missing: GGM: Missing Data

Description

Estimation and exploratory hypothesis testing with missing data.

Usage

bggm_missing(x, iter = 2000, method = "estimate", ...)

Arguments

x

An object of class mid mice.

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.

Value

An object of class estimate or explore

Examples

Run this code
# NOT RUN {
# note: iter = 250 for demonstrative purposes

# need this package
library(mice, warn.conflicts = FALSE)

# data
Y <- ptsd[,1:5]

# matrix for indices
mat <- matrix(0, nrow = 221, ncol = 5)

# indices
indices <- which(mat == 0, arr.ind = TRUE)

# 50 NAs
Y[indices[sample(1:nrow(indices), 50),]] <- NA

# impute
x <- 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)

# select edge set
E <- select(fit_est)

# plot E
plt_E <- plot(E)$plt

plt_E
# }

Run the code above in your browser using DataLab