L1Selection: L1 Selection for Rnets

Description Usage Arguments Value Examples

Description

An implementation of the Stability Approach to Regularization Selection (StARS) method for L1 penalty selection for use with Rnets method.

Usage

1
2
3
L1Selection(Data, L1_set, B = 100, n_b = 0.5, V_set = NULL,
  n_threshold = 0, cor_method = "s", cor_pairing = "pair",
  Forced_zeros = NULL, Stratify = NULL, Rand_seed = NULL)

Arguments

Data

The dataset containing the MICs

L1_set

The set of candidate L1 penalties to be evaluated for creating a sparse precision matrix. Must be non-negative.

B

The number of subsamples to evaluate network stability. Defaults to 100 subsamples.

n_b

The size of the subsample to be drawn from the data. If 0 < n_b < 1, this is interpreted as a proportion of the data set; if n_b > 1, it is interpreted as a set sample size. Defaults to 50% of sample size.

V_set

A character vector corresponding to the names of the antibiotics to include in the Rnet. Defaults to an empty list, in which case all columns in 'MIC_data' will be included in the Rnet

n_threshold

The minimum number of observations required for an an estimated correlation to be valid. Defaults to 0, in which case any number of observations will be sufficient to estimate a valid correlation

cor_method

The method used to estimate the correlation matrix. Must be 'pearson', 'spearman', or 'kendall'. Partial matches allowed. Defaults to 'spearman'.

cor_pairing

The method used to determine how NAs are handled when determining which pairs are used to estimate correlations. See 'cor' function documentation for additional information.

Forced_zeros

Edges to be omitted from the Rnet.

Stratify

The rule for stratifying the data, if desired.

Rand_seed

Allows a random seed to be set subsampling results may be consistently regenerated.

Value

A vector of D statistics, corresponding the tested L1 values.

Examples

1
2
3
4
5
6
7
 EC_all_L1Selection <- L1Selection(
                             Data = NARMS_EC_DATA, 
                             L1_set = seq(0.05, 0.50, 0.05),
                             n_b = 1500,
                             V_set = ABX_LIST
                             )
round(EC_all_L1Selection@StARS_D, 4)

EpidemiologyDVM/Rnets documentation built on May 28, 2021, 3:29 a.m.