VI_MODEL$gen | R Documentation |
y
This function generates random values from the expression of
y
, and keeps all the right hand side information in a data frame.
n |
Integer. Number of observations. |
fit_model |
Boolean. Whether or not to fit a null model to obtain the
fitted values and the residuals. Default is |
test |
Boolean. Whether or not to test the null model against the
alternative model to obtain the test statistic and the p-value.
Default is |
computed |
List. Default is |
A data frame.
# 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))
dat <- test$gen(10)
dat
test$gen(10, computed = list(e = dat$e))
test$gen(10, test = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.