Learn R Programming

NetworkToolbox (version 1.1.2)

threshold: Threshold Filter

Description

Filters the network based on an r-value, alpha, adaptive alpha (see Perez & Pericchi, 2014), bonferroni, false-discovery rate (FDR, fdrtool package), or proportional density (fixed number of edges) value

Usage

threshold(data, a, thresh = c("alpha", "adaptive", "bonferroni", "FDR",
  "proportional"), n = nrow(data), normal = FALSE, na.data = c("pairwise",
  "listwise", "fiml", "none"))

Arguments

data

Can be a dataset or a correlation matrix

a

When thresh = "alpha", "adaptive", and "bonferroni" an alpha threshold is applied (defaults to .05). For "adaptive", beta (Type II error) is set to a*5 for a medium effect size (r = .3). When thresh = "FDR", a q-value threshold is applied (defaults to .10). When thresh = "proportional", a density threshold is applied (defaults to .15)

thresh

Sets threshold. Defaults to "alpha". Set to any value 0> r >1 to retain values greater than set value, "adaptive" for an adapative alpha based on sample size (Perez & Pericchi, 2014), "bonferroni" for the bonferroni correction on alpha, "FDR" for local false discovery rate, and "proportional" for a fixed density of edges (keeps strongest correlations within density)

n

Number of participants in sample. Defaults to the number of rows in the data. If input is a correlation matrix, then n must be set

normal

Should data be transformed to a normal distribution? Defaults to FALSE. Data is not transformed to be normal. Set to TRUE if data should be transformed to be normal (computes correlations using the cor_auto function)

na.data

How should missing data be handled? For "listwise" deletion the na.omit function is applied. Set to "fiml" for Full Information Maxmimum Likelihood (corFiml). Full Information Maxmimum Likelihood is recommended but time consuming

Value

Returns a list containing a filtered adjacency matrix (A) and the critical r value (r.cv)

References

Perez, M. E., & Pericchi, L. R. (2014). Changing statistical significance with the amount of information: The adaptive a significance level. Statistics & Probability Letters, 85, 20-24.

Strimmer, K. (2008). fdrtool: A versatile R package for estimating local and tail area-based false discovery rates. Bioinformatics, 24(12), 1461-1462.

Examples

Run this code
# NOT RUN {
threshnet<-threshold(neoOpen)

alphanet<-threshold(neoOpen, thresh = "alpha", a = .05)

bonnet<-threshold(neoOpen, thresh = "bonferroni", a = .05)

FDRnet<-threshold(neoOpen, thresh = "FDR", a = .10)

propnet<-threshold(neoOpen, thresh = "proportional", a = .15)
# }

Run the code above in your browser using DataLab