VI_MODEL$test | R Documentation |
This function test the null model against the alternative model. In this class, the test is a F-test computed using stats::anova. Derived classes may have their own test procedures.
dat |
Data frame. A data frame containing all variables needed by the
|
null_formula |
Formula. Formula for fitting the null model. Default
is |
alt_formula |
Formula. Formula for fitting the alternative model.
Default is |
A list containing the test name, the test statistic and the p-value.
# 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(100000)
test$test(dat)
test$test(dat, alt_formula = y ~ x + I(x^3))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.