Description Usage Arguments Value Examples
Turns ordered variables into integers and expands factors as binary dummy
codes. cont_conv()
additionally adds noise to discrete variables, but this is only
useful for estimation. [cc_prepare()]
can be used to evaluate an already
fitted estimate.
1 |
x |
a vector or data frame with numeric, ordered, or factor columns. |
A numeric matrix containing the expanded variables. It has additional
type expanded_as_numeric
and attr(, "i_disc")
cntains the indices of
discrete variables.
1 2 3 4 5 6 7 8 9 10 11 12 | # dummy data with discrete variables
dat <- data.frame(
F1 = factor(rbinom(100, 4, 0.1), 0:4),
Z1 = as.ordered(rbinom(100, 5, 0.5)),
Z2 = as.ordered(rpois(100, 1)),
X1 = rnorm(100),
X2 = rexp(100)
)
pairs(dat)
pairs(expand_as_numeric(dat)) # expanded variables without noise
pairs(cont_conv(dat)) # continuously convoluted data
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.