File: gen.data.Rd

package info (click to toggle)
r-cran-robust 0.7-5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,548 kB
  • sloc: fortran: 11,898; ansic: 741; sh: 13; makefile: 2
file content (34 lines) | stat: -rw-r--r-- 1,033 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
\name{gen.data}
\alias{gen.data}

\title{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{
  \item{coeff}{a numeric vector of length 3 containing the true coefficients.}

  \item{n}{a positive integer giving the number of observations in the data set.}

  \item{eps}{a numeric value between 0 and 0.5 specifying the fraction of contamination.}

  \item{sig}{a positive numeric value giving the standard deviation of the uncontaminated data.}

  \item{snr}{a positive numeic value giving the signal to noise ratio, well not really.}

  \item{seed}{an integer value giving the seed for the random number generator.}
}

\value{
a data frame with \code{n} rows and 4 columns.  The regressors are generated as: \code{rnorm(n,1)}, \code{rnorm(n,1)^3}, \code{exp(rnorm(n,1))}.  It also generates an unused vector \code{x4}.
}

\keyword{utilities}