Skip to contents

generate simulated datasets

Usage

genevar(
  n = 100,
  p = 10,
  pr = 5,
  e = 0,
  r = 0.5,
  df = Inf,
  beta = NULL,
  intercept = 0,
  sigma = 1,
  mux = rep(0, p),
  scalex = 1,
  gamma = 6,
  outtype = "cellwise"
)

Arguments

n

number of observations

p

number of candidate predictors

pr

number of active predictors

e

contamination rate

r

correlation among predictors

df

degrees of freedom used to generate predictors

beta

regression coefficients

intercept

intercept of the regression model

sigma

scale of the error item

mux

averages of predictors

scalex

scales of predictors

gamma

magnitudes of outliers

outtype

type of outliers: cellwise, rowwise

Value

x: the generated design matrix

xc: the generated design matrix without contamination

y: the generated response

ynew: another generated response (as an independent test set)

outlier: the generated outlier in the design matrix

erroroutlier: the generated outlier in response

Examples

data = genevar()
y = data$y
x = data$x