View source: R/greedy.pairwise.n.filter.R
greedy.pairwise.n.filter | R Documentation |
This function identifies features that have less than a minimum number of complete pairwise observations and removes one of them, in a greedy fashion. The need for this function is in instances where missingness is extreme between two features the number of paired observation between them may be to to be informative. Thus one, but not both should be removed from the analysis to avoid analytical error based on sample sizes.
greedy.pairwise.n.filter(wdata, minN = 50)
wdata |
the metabolite data matrix. samples in row, metabolites in columns |
minN |
the minimum sample size (n) for pairwise comparisons |
a vector of feature names
set.seed(123) ex_data = sapply(1:10, function(x){ rnorm(250, 40, 5) }) ## define the data set rownames(ex_data) = paste0("ind", 1:nrow(ex_data)) colnames(ex_data) = paste0("var", 1:ncol(ex_data)) ## add in some missingness ex_data[ sample(1:250, 200) ,1] = NA ex_data[ sample(1:250, 200) ,2] = NA ex_data[ sample(1:250, 200) ,3] = NA ## Estimate missingness and generate plots greedy.pairwise.n.filter(ex_data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.