Learn R Programming

aucm (version 2016.1-2)

simulations: Simulate datasets

Description

sim.dat.1 simulates a dataset with two covariates to reproduce Pepe Figure 1. skin.orange simulates a skin of orange dataset as in Hastie et al.

Usage

sim.dat.1(n, seed, add.outliers=FALSE, std.dev = 0.2)

Arguments

n
sample size
seed
seed for random number generator
add.outliers
boolean. If TRUE, 10% of data are replaced by a contaminating distribution
std.dev
standard deviation in data generating process

Value

  • A data frame with n rows, and 4 columns: y, x1, x2, and eta, where eta is the linear combination X*beta.

Examples

Run this code
dat = sim.dat.1(n=100,seed=1)
nrow(dat)

dat = sim.dat.1(n=100,seed=1,add.outliers=TRUE)
nrow(dat)

Run the code above in your browser using DataLab