mantar provides several methods for estimating psychological networks
with and without missing data. For network estimation, two main
approaches are implemented:
For missing data handling, the preferred two strategies are:
The workflow is designed to support typical use cases in psychological research, including varying sample sizes, missingness levels, and variable types.
The current stable version (0.3.1) is available on CRAN and can be installed using the usual approach:
install.packages("mantar")
You can install the development version of mantar from
GitHub. To do so, you need the
remotes package.
# install.packages("remotes")
remotes::install_github("kai-nehler/mantar@develop")
The suffix @develop ensures you install the latest development version
with new features and updates.
mantar offers a few dummy data sets for demonstration and testing
purposes. Here, we illustrate how to estimate a neighborhood selection
network on a continuous data set with missing values using stacked
multiple imputation.
library(mantar)
data(mantar_dummy_mis_cont)
Network analysis based on neighborhood selection can be performed using
the neighborhood_net() function. By default, it uses the Bayesian
Information Criterion (BIC) for model selection.
result <- neighborhood_net(mantar_dummy_full_cont,
missing_handling = "stacked-mi")
#> No missing values in data. Sample size for each variable is equal to the number of rows in the data.
summary(result)
#> The density of the estimated network is 0.321
#>
#> Network was estimated using neighborhood selection with the information criterion: BIC
#> and the 'and' rule for the inclusion of edges based on a full data set.
#>
#> The sample sizes used for the nodewise regressions were as follows:
#> EmoReactivity TendWorry StressSens SelfAware Moodiness
#> 400 400 400 400 400
#> Cautious ThoughtFuture RespCriticism
#> 400 400 400
result$pcor
#> EmoReactivity TendWorry StressSens SelfAware Moodiness Cautious
#> EmoReactivity 0.0000000 0.2055099 0.0000000 0.0000000 0.0000000 0.0000000
#> TendWorry 0.2055099 0.0000000 0.0000000 0.3396183 0.0000000 0.0000000
#> StressSens 0.0000000 0.0000000 0.0000000 0.0000000 0.1143278 0.0000000
#> SelfAware 0.0000000 0.3396183 0.0000000 0.0000000 0.0000000 0.0000000
#> Moodiness 0.0000000 0.0000000 0.1143278 0.0000000 0.0000000 0.3290979
#> Cautious 0.0000000 0.0000000 0.0000000 0.0000000 0.3290979 0.0000000
#> ThoughtFuture 0.0000000 0.1855478 0.1728659 0.0000000 0.0000000 0.0000000
#> RespCriticism 0.0000000 0.0000000 0.0000000 0.1833561 0.2670060 0.2939731
#> ThoughtFuture RespCriticism
#> EmoReactivity 0.0000000 0.0000000
#> TendWorry 0.1855478 0.0000000
#> StressSens 0.1728659 0.0000000
#> SelfAware 0.0000000 0.1833561
#> Moodiness 0.0000000 0.2670060
#> Cautious 0.0000000 0.2939731
#> ThoughtFuture 0.0000000 0.0000000
#> RespCriticism 0.0000000 0.0000000
The summary shows the density of the estimated network and details about
the estimation procedure. The partial correlation matrix can be accessed
via result$pcor.
The package vignette provides: