Generates a random dataset with some amount of contaimination.
gen.data(coeff, n = 100, eps = 0.1, sig = 3, snr = 1/20, seed = 837)
a data frame with n
rows and 4 columns. The regressors are generated as: rnorm(n,1)
, rnorm(n,1)^3
, exp(rnorm(n,1))
. It also generates an unused vector x4
.
a numeric vector of length 3 containing the true coefficients.
a positive integer giving the number of observations in the data set.
a numeric value between 0 and 0.5 specifying the fraction of contamination.
a positive numeric value giving the standard deviation of the uncontaminated data.
a positive numeic value giving the signal to noise ratio, well not really.
an integer value giving the seed for the random number generator.