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 |
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 |
method_wCorr |
If weights are supplied, which method for weighted correlations should be used? Defaults to |
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 |
plot_title |
Optionally, assign a title to the |
qgraph_arglist |
An optional argument list feeding additional instructions to |
EBICglasso |
Should a sparse, Gaussian-LASSO ResIN network be estimated? Defaults to FALSE. If set to TRUE, |
EBICglasso_arglist |
An argument list feeding additional instructions to the |
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)