.simulate | R Documentation |
Simulates data for unit tests
.simulate(n, p, cor = 0, prob = 0.1, sd = 1, exp = 1, frac = 1)
n |
sample size: positive integer |
p |
covariate space: positive integer |
cor |
correlation coefficient :
numeric between |
prob |
effect proportion:
numeric between |
sd |
standard deviation: positive numeric |
exp |
exponent: positive numeric |
frac |
class proportion:
numeric between |
For simulating correlated features (cor
>0
),
this function requires the R package MASS
(see mvrnorm
).
Returns invisible list with elements y
and X
.
data <- cornet:::.simulate(n=10,p=20)
names(data)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.