Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gen.data

Generate Data With Contamination


Description

Generates a random dataset with some amount of contaimination.

Usage

gen.data(coeff, n = 100, eps = 0.1, sig = 3, snr = 1/20, seed = 837)

Arguments

coeff

a numeric vector of length 3 containing the true coefficients.

n

a positive integer giving the number of observations in the data set.

eps

a numeric value between 0 and 0.5 specifying the fraction of contamination.

sig

a positive numeric value giving the standard deviation of the uncontaminated data.

snr

a positive numeic value giving the signal to noise ratio, well not really.

seed

an integer value giving the seed for the random number generator.

Value

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.


robust

Port of the S+ "Robust Library"

v0.5-0.0
GPL-2
Authors
Jiahui Wang, Ruben Zamar <ruben@stat.ubc.ca>, Alfio Marazzi <Alfio.Marazzi@inst.hospvd.ch>, Victor Yohai <vyohai@dm.uba.ar>, Matias Salibian-Barrera <matias@stat.ubc.ca>, Ricardo Maronna <maron@mate.unlp.edu.ar>, Eric Zivot <ezivot@u.washington.edu>, David Rocke <dmrocke@ucdavis.edu>, Doug Martin, Martin Maechler <maechler@stat.math.ethz.ch>, Kjell Konis <kjell.konis@me.com>.
Initial release
2020-03-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.