sample.sim {FARDEEP} | R Documentation |
Generate random sample with different proportion of outliers and leverage points
Description
Generate random sample with different proportion of outliers and leverage points
Usage
sample.sim(n, p, sig, a1, a2, nn = TRUE, intercept = FALSE)
Arguments
n |
number of observations. |
p |
number of independent variables (predictors). |
sig |
variance of dependent variable. |
a1 |
proportion of outliers. |
a2 |
proportion of leverage points in outliers. |
nn |
whether coefficients are non-negative, default TRUE. |
intercept |
whether intercept is included in model, default TRUE. |
Value
y: vector of dependent variable.
x: matrix of predictors with n rows and p columns.
loc: index of added outliers.
beta: vector of coefficients.
Author(s)
Yuning Hao, Ming Yan, Blake R. Heath, Yu L. Lei and Yuying Xie
References
Yuning Hao, Ming Yan, Blake R. Heath, Yu L. Lei and Yuying Xie. Fast and Robust Deconvolution of Tumor Infiltrating Lymphocyte from Expression Profiles using Least Trimmed Squares. <doi:10.1101/358366>
Examples
library(FARDEEP)
samp = sample.sim(n = 500, p = 20, sig = 1, a1 = 0.1, a2 = 0.2, nn = TRUE, intercept = TRUE)