VI_MODEL-cash-gen_lineup: Generating random values from the expression of 'y', and...

VI_MODEL$gen_lineupR Documentation

Generating random values from the expression of y, and forms a lineup

Description

This function generates random values from the expression of y, and keeps all the right hand side information in a data frame.

Arguments

n

Integer. Number of observations.

k

Integer. Number of plots in the lineup. Default is k = 20.

pos

Integer. Position of the true data plot. Default is pos = NULL, which means the position is random.

computed

List. Default is NULL. If it is provided, random variables or random closed form expression will use the values from the list, which makes the expression potentially deterministic.

Value

A data frame.

Examples


# Instantiate
x <- rand_uniform()
e <- rand_normal()
test <- vi_model(prm = list(x = x, e = e),
                 prm_type = list(x = "r", e = "r"),
                 formula = y ~ 1 + x + x^2 + e,
                 null_formula = y ~ x,
                 alt_formula = y ~ x + I(x^2))

test$gen_lineup(10, k = 3)

test$gen_lineup(10, k = 3, computed = list(e = 1:10))

TengMCing/visage documentation built on Aug. 28, 2024, 3:27 p.m.