spec.data: Data Generation for a Given Specification

View source: R/MCres_comb.R

spec.dataR Documentation

Data Generation for a Given Specification

Description

Generates running variables, and corresponding standard deviations and regression function values given a specification.

Usage

spec.data(spec.ind, which.fun, n, th, C.big, C.small, sig.scale, seed = 1)

Arguments

spec.ind

data.frame with a single rows, with names(spec.ind) containing c("unif", "homo", "trueCsmall").

which.fun

which regression function to evaluate; supports 1:6.

n

sample size.

th

true RD parameter.

C.big

the value of C corresponding to the large C.

C.small

the value of C corresponding to the small C.

sig.scale

scaling parameter for the standard deviation.

seed

the random number seed used to generate regressors; the default is seed = 1.

Value

a list with components x (running variables), sig (standard deviations), and fx (regression function values).

Examples

spec.ind <- data.frame(unif = 1, homo = 0, trueCsmall = 0)
spec.data(spec.ind, 1, 100, 1, 3, 1, 1/2)
spec.data(spec.ind, 6, 100, 1, 3, 1, 1/2)

koohyun-kwon/rdadapt documentation built on May 8, 2022, 8:49 p.m.