Shows which variables were selected for each node of a network
Shows which variables were selected for each node of a network
Provides a quick representation showing which variables were selected as predictors of each node in a network, both for unmoderated and moderated networks. Especially useful as a way to see which variables were selected in a variable selection procedure, such as through the varSelect
and resample functions.
selected(object, threshold =FALSE, mod = c("temporal","between"))
Arguments
object: Output from either fitNetwork or mlGVAR
threshold: Can be a numeric value between 0 and 1, or defaults to .05 when set to TRUE
mod: Only relevant to models fit with mlGVAR
Returns
A table where the columns represent nodes, and the rows show which variables were selected in predicting each node. For moderated networks, the output is a list that separates main effects (mods) from interaction effects (ints).
Details
The threshold argument allows the user to set a threshold for p-values, such that the output only reflects the predictors that are significant at that threshold. This argument can be utilized whether or not a variable selection procedure has been employed.
Examples
fit1 <- fitNetwork(ggmDat)selected(fit1)fit2 <- mlGVAR(mlgvarDat, m ='M', verbose =FALSE)selected(fit2, threshold =TRUE, mod ='temporal')# Can also set to 'between'fit3 <- fitNetwork(gvarDat, moderators ='M', type ='varSelect', lags =1)selected(fit3)