gen_norm_microbiome {microbiomeDASim} | R Documentation

## Generate Longitduinal Differential Abundance from Multivariate Normal

### Description

Generate Longitduinal Differential Abundance from Multivariate Normal

### Usage

    gen_norm_microbiome(features = 10, diff_abun_features = 5, n_control,
      n_treat, control_mean, sigma, num_timepoints, rho, corr_str = c("ar1",
      "compound", "ind"), func_form = c("linear", "quadratic", "cubic", "M",
      "W", "L_up", "L_down"), beta, IP = NULL, missing_pct,
      missing_per_subject, miss_val = NA, dis_plot = FALSE,
      plot_trend = FALSE, zero_trunc = TRUE)

### Arguments

`features` | numeric value specifying the number of features/microbes to simulate. Default is 10.
`diff_abun_features` | numeric value specifying the number of differentially abundant features. Default is 5.
`n_control` | integer value specifying the number of control individuals
`n_treat` | integer value specifying the number of treated individuals
`control_mean` | numeric value specifying the mean value for control subjects. all control subjects are assummed to have the same population mean value.
`sigma` | numeric value specifying the global population standard deviation for both control and treated individuals.
`num_timepoints` | integer value specifying the number of timepoints per subject.
`rho` | value for the correlation parameter. must be between [0, 1]. see `mvrnorm_corr_gen` for details.
`corr_str` | correlation structure selected. see `mvrnorm_corr_gen` for details.
`func_form` | character value specifying the functional form for the longitduinal mean trend. see `mean_trend` for details.
`beta` | vector value specifying the parameters for the differential abundance function. see `mean_trend` for details.
`IP` | vector specifying any inflection points. depends on the type of functional form specified. see `mean_trend` for details. by default this is set to NULL.
`missing_pct` | numeric value that must be between [0, \1] that specifies what percentage of the individuals will have missing values.
`missing_per_subject` | integer value specifying how many observations per subject should be dropped. note that we assume that all individuals must have baseline value, meaning that the maximum number of `missing_per_subject` is equal to `num_timepoints` - 1.
`miss_val` | value used to induce missingness from the simulated data. by default missing values are assummed to be NA but other common choices include 0.
`dis_plot` | logical argument on whether to plot the simulated data or not. by default plotting is turned off.
`plot_trend` | specifies whether to plot the true mean trend. see `mean_trend` for details.
`zero_trunc` | logical indicator designating whether simulated outcomes should be zero truncated. default is set to TRUE

### Value

This function returns a list with the following objects

`Y` The full simulated feature sample matrix where each row represent a feature and each column a sample. Note that the differential and non-differential bugs are marked by row.names

### Examples

    gen_norm_microbiome(features = 5, diff_abun_features = 2,
                   n_control = 10, n_treat = 10, control_mean = 8, sigma = 1,
                   num_timepoints = 5, rho = 0.8, corr_str = "compound",
                   func_form = "linear", beta =  c(0, 1), missing_pct = 0.3,
                   missing_per_subject = 2)

[Package microbiomeDASim version 1.0.0 Index]