Description Usage Arguments Details Value Author(s) References See Also Examples
Convenience function to extract data from a model.
1 2 | extract_target(model, dataset)
extract_predictors(model, dataset)
|
model |
A function that takes a data frame as its argument and
returns an object that has a |
dataset |
A data frame. |
text
For extract_target
, a vector that contains the values from
dataset
of the dependent variable specified in model
.
For extract_predictors
, the same thing but now the
model.matrix
of the predictors.
Gray Calhoun <gcalhoun@iastate.edu>
Calhoun, G. 2011, Documentation appendix: An asymptotically normal out-of-sample test of equal predictive accuracy for nested models. Unpublished manuscript.
mixedwindow
, clarkwest
,
terms
, model.matrix
1 2 3 4 5 6 7 8 9 10 11 | model <- function(d) lm(y ~ x, data = d)
dataset <- data.frame(y = rnorm(10), x = rnorm(10))
all.equal(extract_target(model, dataset), dataset$y,
check.attributes = FALSE)
all.equal(extract_predictors(model, dataset),
cbind(1, dataset$x), check.attributes = FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.