| simulXy | R Documentation | 
Generates synthetic covariates and response vector from a specified distribution for simulation studies or method validation.
simulXy(
  n,
  p,
  interc = 0,
  beta,
  family = gaussian(),
  prop = 0.1,
  lim.b = c(-3, 3),
  sigma = 1,
  size = 1,
  rho = 0,
  scale.data = TRUE,
  seed = NULL,
  X = NULL,
  dispersion = 0.1
)
| n | Integer. Number of observations. | 
| p | Integer. Total number of covariates in the model matrix. | 
| interc | Numeric. Intercept to include in the linear predictor. Default is  | 
| beta | Numeric vector of length  | 
| family | Distribution and link function. Allowed:  | 
| prop | Numeric in  | 
| lim.b | Numeric vector of length 2. Range for coefficients if  | 
| sigma | Standard deviation of Gaussian response. Default is  | 
| size | Integer. Number of trials for binomial response. Default is  | 
| rho | Numeric. Correlation coefficient for generating covariates. Used to create AR(1)-type covariance:  | 
| scale.data | Logical. Whether to scale columns of the model matrix. Default is  | 
| seed | Optional. Integer seed for reproducibility. | 
| X | Optional. Custom model matrix. If supplied, it overrides the internally generated  | 
| dispersion | Dispersion parameter of Gamma response. Default is  | 
A list with components:
| X | Model matrix of dimension  | 
| y | Simulated response vector | 
| beta | True regression coefficients used | 
| eta | Linear predictor | 
n <- 100; p <- 100
beta <- c(runif(10, -3, 3), rep(0, p - 10))
sim <- simulXy(n = n, p = p, beta = beta, seed = 1234)
o <- islasso(y ~ ., data = sim$data, family = gaussian())
summary(o, pval = 0.05)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.