ResIN_qgraph {ResIN}R Documentation

ResIN_qgraph

Description

Performs Response Item-Network analysis (ResIN) and exports the results as an qgraph object.

Usage

ResIN_qgraph(
  df,
  node_vars = NULL,
  cor_method = "auto",
  weights = NULL,
  method_wCorr = "Polychoric",
  remove_negative = TRUE,
  plot_graph = TRUE,
  plot_title = "ResIN qgraph",
  qgraph_arglist = NULL,
  EBICglasso = FALSE,
  EBICglasso_arglist = NULL,
  same_item_groups = FALSE,
  cluster = FALSE
)

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.

plot_graph

Optionally, should qgraph generate print the network upon generation? Defaults to TRUE.

plot_title

Optionally, assign a title to the qgraph plot.

qgraph_arglist

An optional argument list feeding additional instructions to qgraph. Needs to be specified as an object list containing the arguments to be passed down.

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. Needs to be specified as an object list containing the arguments to be passed down.

same_item_groups

Optionally, should the qgraph object automatically incorporate a "group" attribute that groups item response nodes by the items that repose nodes stem from?

cluster

Optional, should community detection be performed on item response network? Defaults to FALSE. If set to TRUE, performs "cluster_leading_eigen" function from the igraph package and stores results in plotting_frame.

Value

A list object containing the qgraph output object, a numeric vector detailing which item responses belong to which item (same_items), and optionally a matrix detailing community membership of different item nodes (clustering).

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)

## Run the function:
ResIN_qgraph <-  ResIN_qgraph(lik_data, same_item_groups = TRUE)



[Package ResIN version 1.1.0 Index]