powered by
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)
a tibble
A dataframe containing a grouping variable column.
Number of variables to simulate.
Variance used to construct variance-covariance matrix.
Covariance used to construct variance-covariance matrix.
A vector of the same length as the number of grouping variables.
An optional name to be appended to the column names in the output.
An optional seed for random number generation. If `NA` (default) a random seed will be used.
sim_cat, sim_covar
sim_cat
sim_covar
Other multivariate normal functions: sim_cat(), sim_covar()
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")
Run the code above in your browser using DataLab