Description Usage Arguments Value Examples
Each of the n noise elements are from rnorm
(mean=0,sd=1).
Except for columns 1 and 2, each of the design-matrix elements are from runif
(min=0,max=1).
The outcome y is noise added to the linear combination of the design matrix with 'coef_true'.
1 2 |
n |
integer for number of observations |
p |
integer for total number of cols in the design matrix. Note, offset from '3:p'. Since col 1 is reserved for intercept-column of 1s and col 2 is reserved for treatment-column of 1s/0s |
coef_true |
vector (length p) for true lm coefficients |
seed |
a seed for RNG (default NULL) |
output_meta |
a logical (default FALSE) determining if meta info is returned as list elements |
If 'output_meta=FALSE' (the default), only the data.frame 'yx' is returned. The column names of yx are names(yx)=c('y',paste0("x",seq(1:p))).
If 'output_meta=TRUE', a 3 element list with yx, coef_true, noise.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.