VI_MODEL-cash-set_formula: Set formula for y, null model or alternative model

VI_MODEL$set_formulaR Documentation

Set formula for y, null model or alternative model

Description

This function store the formula in the environment, and drops all attributes. It is not recommended to modify the formula of y after the instance has been built, which may create confusion.

Arguments

...

Formulas. Formulas with names.

Value

Return the object itself.

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$set_formula(alt_formula = y ~ x + I(x^3))
test$alt_formula

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