ResIN_utils {ResIN}R Documentation

ResIN_utils

Description

Generates auxiliary utensils useful for Response-Item Networks analysis.

Usage

ResIN_utils(
  df,
  node_vars = NULL,
  cor_method = "auto",
  weights = NULL,
  method_wCorr = "Polychoric",
  remove_negative = TRUE,
  EBICglasso = FALSE,
  EBICglasso_arglist = NULL
)

Arguments

df

A data-frame object containing the raw data.

node_vars

An optional character string detailing the attitude item columns to be selected for ResIN analysis (i.e. the subset of attitude variables in df).

cor_method

Which correlation method should be used? Defaults to "auto" which applies the cor_auto function from the qgraph package. Possible arguments are "auto", "pearson", "kendall", and "spearman".

weights

An optional continuous vector of survey weights. Should have the same length as number of observations in df. If weights are provided, weighted correlation matrix will be estimated with the weightedCorr function from the wCorr package.

method_wCorr

If weights are supplied, which method for weighted correlations should be used? Defaults to "Polychoric". See wCorr::weightedCorr for all correlation options.

remove_negative

Should all negative correlations be removed? Defaults to TRUE (highly recommended). Setting to FALSE makes it impossible to estimate a force-directed network layout. Function will use igraph::layout_nicely instead.

EBICglasso

Should a sparse, Gaussian-LASSO ResIN network be estimated? Defaults to FALSE. If set to TRUE, EBICglasso function from the qgraph packages performs regularization on (nearest positive-semi-definite) ResIN correlation matrix.

EBICglasso_arglist

An argument list feeding additional instructions to the EBICglasso function if EBICglasso is set to TRUE.

Value

A list object containing the original dataframe, (resin_df), the dummy-coded dataframe (resin_dummies), the ResIN correlation and covariance matrices (resin_cor & resin_vcov), and a numeric vector detailing which item responses belong to which item (same_items).

References

Epskamp S, Cramer AOJ, Waldorp LJ, Schmittmann VD, Borsboom D (2012). “qgraph: Network Visualizations of Relationships in Psychometric Data.” Journal of Statistical Software, 48(4), 1–18.

Examples


## Load the 12-item simulated Likert-type ResIN toy dataset
data(lik_data)

## Extract the utilities
output <- ResIN_utils(lik_data)


[Package ResIN version 1.1.0 Index]