VI_MODEL$null_resid | R Documentation |
This function uses the data and the null model to generate null residuals. The null residuals are generated by first regressing random noises on the original regressors, then multiply the obtained residuals by original RSS divided by the current RSS. The results are the null residuals.
dat |
Data frame. A data frame that used to fit the model. |
mod |
Linear Model. The null model. |
test |
Boolean. Whether or not to use |
A data frame with updated y
, .resid
, and potentially updated
test result.
# 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)
test$null_resid(dat, test$fit(dat), test = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.