selected: Shows which variables were selected for each node of a...

Description Usage Arguments Details Value See Also Examples

View source: R/selected.R

Description

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.

Usage

1
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

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.

Value

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).

See Also

fitNetwork, mlGVAR

Examples

1
2
3
4
5
6
7
8
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)

modnets documentation built on Oct. 1, 2021, 9:07 a.m.