Num.Instruments: Choose the number of potential instruments. This is 'K' in...

Description Usage Arguments Value

View source: R/AnalyzeMetaboliteData.R

Description

Choose the number of potential instruments using a q-value threshold

Usage

1
2
3
4
5
6
7
8
Num.Instruments(
  Y,
  Cov = NULL,
  max.miss.C = 0.05,
  max.missing.consider = 0.5,
  K.max = NULL,
  q.thresh = c(0.01, 0.05, 0.1)
)

Arguments

Y

a p x n data matrix of log2-transformed metabolite intensities, where p = #of metabolites and n = #of samples. Missing values should be left as NA. This is the only variable that must be specified.

Cov

a n x d matrix of covariates, where d <= 2. The default, and recommended value, is the vector of all 1s.

max.miss.C

a number between 0 and 1. The maximum fraction of missing data a metabolite is allowed to have to be considered nearly completely observed. The default, and recommended value, is 0.05.

max.missing.consider

a number between 0 and 1. The maximum fraction of missing data a metabolite is allowed to have. Any metabolites with missingness fractions greater than this will be ignored. Default, and recommended value, is 0.5.

K.max

an integer >=2. The maximum number of potential instruments to consider. If unspecified, it is set to be sva::num.sv estimate for K applied to the metabolites with complete data.

q.thresh

a vector of numbers between 0 and 1. The q-value thresholds to consider. It defaults to c(0.01, 0.05, 0.1).

Value

a list.

Frac1

a K.max x length(q.thresh) matrix. The (k,j)th entry is the fraction of metabolites with at least one factor 1,...,k with q-value less than or equal to q.thresh[j].

Frac2

a K.max x length(q.thresh) matrix. The (k,j)th entry is the fraction of metabolites with at least two factors 1,...,k with q-value less than or equal to q.thresh[j]. It is returned only if d = 1

frac.thresh

The fraction of factors with q-value < 0.05. If this is < 0.75, we recommend not estimating the missingness mechanism.

K.recommended

The recommended K (a scalar). This can be used as K in the function EstimateMissing. This is the smallest number of factors such that frac.thresh of the metabolites with missing data have at least 1 factor with q-value < 0.05.


chrismckennan/MetabMiss documentation built on March 1, 2020, 10:03 p.m.