sim_discr | R Documentation |
To-do: make this work with 'dplyr::group_by()' instead of 'group ='
sim_discr(.data, n_vars, var, cov, group_means, name = NA, seed = NA)
.data |
A dataframe containing a grouping variable column. |
n_vars |
Number of variables to simulate. |
var |
Variance used to construct variance-covariance matrix. |
cov |
Covariance used to construct variance-covariance matrix. |
group_means |
A vector of the same length as the number of grouping variables. |
name |
An optional name to be appended to the column names in the output. |
seed |
An optional seed for random number generation. If 'NA' (default) a random seed will be used. |
a tibble
sim_cat
, sim_covar
Other multivariate normal functions:
sim_cat()
,
sim_covar()
library(dplyr)
sim_cat(n_obs = 30, n_groups = 3) %>%
group_by(group) %>%
sim_discr(n_vars = 5, var = 1, cov = 0.5, group_means = c(-1, 0, 1), name = "descr")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.