add_var | R Documentation |
This function adds variables to a Gaussian mixture model.
add_var(gmm, var)
gmm |
An object of class |
var |
A character vector containing the added variables, or a data frame or numeric matrix whose columns are named after the added variables. In the first case, for each mixture component, the marginal mean vector of the added variables is 0 and the marginal covariance matrix the identity matrix. In the second case, these mean vector and covariance matrix are computed from the data (after removing the rows that contain missing values). |
The gmm
object after adding the variables.
remove_var
, rename_var
data(gmm_body, data_body) gmm_1 <- add_var(gmm_body, "GENDER") gmm_2 <- add_var(gmm_body, data_body[, "GENDER"])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.