Learn R Programming

NetworkToolbox (version 1.2.2)

nams: Network Adjusted Mean/Sum

Description

The hybrid centrality is used to adjust the mean or sum score of participant's community scores based on each node's centrality. Each participant's response values are multipled by the corresponding hybrid centrality value (uses "random" for BC argument). In this way, more central nodes contribute a greater score and less central nodes contribute a lesser score

Usage

nams(data, A, adjusted = c("mean", "sum"), comm = c("walktrap",
  "louvain"), ...)

Arguments

data

Must be a dataset

A

Adjacency matrix that has already been filtered

adjusted

Should adjusted values be the mean or sum score? Defaults to "mean". Set to "sum" for sum scores

comm

Can be a vector of community assignments or community detection algorithms ("walktrap" or "louvain") can be used to determine the number of communities. Defaults to 1 community. Set to "walktrap" for the walktrap algortihm. Set to "louvain" for louvain community detection

...

Additional arguments for community detection algorithms

Value

Returns a list containing:

Standardized

The standardized network adjusted score for each participant

Unstandardized

The unstandardized network adjusted score (mean or sum) for each participant

CommItems

The items associated with the specified or identified communities

CommCor

Correlations between the specified or identified communities

References

Christensen, A. P. (2018). NetworkToolbox: Methods and measures for brain, cognitive, and psychometric network analysis in R. PsyArXiv. doi: 10.31234/osf.io/6kmav

Examples

Run this code
# NOT RUN {
A <- TMFG(neoOpen)$A

#one community
sumadj <- nams(neoOpen, A, adjusted = "sum")

#theoretical communities
knowncomm <- nams(neoOpen, A,
comm = c(rep(1,8),rep(2,8),rep(3,8),rep(4,8),rep(5,8),rep(6,8)))

#walktrap communities
walkadj <- nams(neoOpen, A, adjusted = "sum", comm = "walktrap")

# }

Run the code above in your browser using DataLab