Description Usage Arguments Details Examples
Simulate compositional data.
1 2 3 |
n |
sample size |
p |
size of compositional predictors falling in S^p |
rho |
a scaler used to generate |
sigma |
standard deviation for noise terms, which follows iid norm distribution with mean 0 |
gamma, add.on |
To generate compsotional data, we first generate |
beta |
coefficients for composition variables |
beta0 |
coefficient for intercept |
intercept |
including intercept or not to generate response variable. Default value is FALSE |
The setup of this simulation follows Variable selection in regression with compositional covariates by WEI LIN, PIXU SHI, RUI FENG AND HONGZHE LI.
1 2 3 4 5 6 7 8 9 10 11 | n = 50
p = 30
rho = 0.2
sigma = 0.5
gamma = 0.5
add.on = 1:5
beta = c(1, -0.8, 0.6, 0, 0, -1.5, -0.5, 1.2)
beta = c( beta, rep(0, times = p - length(beta)) )
intercept = FALSE
Comp_data = comp_simulation(n = n, p = p, rho = rho, sigma = sigma, gamma = gamma, add.on = add.on,
beta = beta, intercept = intercept)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.