sample_size: Sample size for correlation computation

Description Usage Arguments Value Source

View source: R/network_generation.R

Description

(INTERNAL) Depending on how missing data is handled in correlation matrix computation, the number of samples used is returned. If 'all.obs' is used the number of rows (i.e. samples) of the orignal data is returned. If 'pairwise.complete.obs' is used the crossproduct of a matrix indicating the non-NA values is returned as matrix. This implementation was adopted from corAndPvalue.

Usage

1
sample_size(x, use)

Arguments

x

matrix of measurement data used for correlation computation

use

string indicating handling of missing data. Can be 'all.obs' for all observations or 'pairwise.complete.obs' for pairwise observations

Value

For 'all.obs' returns an integer indicating the number of samples in the supplied matrix (i.e. number of rows). For 'pairwise.complete.obs' returns a matrix in the same size of the correlation matrix indicating the number of samples for each correlation calculation.

Source

Method to calculate samples in 'pairwise.complete.obs' adopted and improved from corAndPvalue


molnet-org/molnet documentation built on Dec. 21, 2021, 8:59 p.m.