Simulates data for unit tests
.simulate(n, p, cor = 0, prob = 0.1, sd = 1, exp = 1, frac = 1)
sample size: positive integer
covariate space: positive integer
correlation coefficient : numeric between \(0\) and \(1\)
effect proportion: numeric between \(0\) and \(1\)
standard deviation: positive numeric
exponent: positive numeric
class proportion: numeric between \(0\) and \(1\)
Returns invisible list with elements y
and X
.
For simulating correlated features (cor
\(>0\)),
this function requires the R package MASS
(see mvrnorm
).
data <- cornet:::.simulate(n=10,p=20)
names(data)
#> [1] "y" "X" "cutoff"