outcome.sim: Simulating multivariate outcome data from specified...

Description Usage Arguments Examples

View source: R/datasim_main.R

Description

Function to simulate multivariate response data with specified beta coefficient correlation structure and relationship with the abundance data set.

Usage

1
outcome.sim(tax_sim, n.outcomes, beta.struc, controls = NULL)

Arguments

tax_sim

Object of type MCSim can be of type sim_phylo or sim_ex in order to extract useful arguments.

n.outcomes

Number of outcome variables

beta.struc

Can be "none" which means that beta values are randomly generated. "phylo" which means beta values are generated following the phylogenetic tree, "ex" for an exchangable structure similar to that of the abundance data, and "none" means there exists no dependency relationship between taxa when the beta values are generated. Finally, if "nr" is specified, no beta values will be generated.

controls

List of arguments controlling the specific parameters of the simulation. Specifically, b.spar (range 0 to 1) controls the sparsity of the beta matrix, o.corr controls the correlation of the outcomes (range 0 to 1), n.param controls the mean and std.dev parameters of the normal distribution that gives rise to the beta values, snr controls for the signal to noise ratio. If beta.struc is exchangable, then b.corr controls the correlation of the beta values.

Examples

1
2
3
4
5
     tax <- tax.sim(n.spec = 20, n.samp = 200, corr.struc = "phylo", p = 0.1)
     outcome <- outcome.sim(tax_sim = tax, n.outcomes = 10,
                          beta.struc = "ex", controls = list(b.corr = 0.1))
     beta <- outcome$beta
     met <- outcome$response

quangnguyen1995/MCTools documentation built on May 23, 2019, 8:56 a.m.