View source: R/mixture-pseudo_class.R
| append_class_draws | R Documentation |
Generates m datasets with random draws of a variable named class, with
probability for these draws based on each case's probability of belonging to
that class according to the model in x.
append_class_draws(x, data = NULL, m = 20)
x |
An object for which a method exists, usually a |
data |
A data.frame which the |
m |
Integer. Number of datasets to generate. Default is 10. |
A data.frame of class class_draws.
if(requireNamespace("OpenMx", quietly = TRUE)){
library(OpenMx)
dat <- iris[c(1:5, 50:55, 100:105),1:3]
colnames(dat) <- letters[1:3]
fit <- mx_profiles(data = dat, classes = 2)
append_class_draws(fit, data = iris[c(1:5, 50:55, 100:105), 4, drop = FALSE])
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.