Generation of ordinal and continuous variables
Source:R/questionnaire_gen_family.R
questionnaire_gen_family.RdCreates a data frame of discrete and continuous variables based on a latent correlation matrix and marginal proportions.
Usage
questionnaire_gen_family(
n_obs,
cat_prop,
cov_matrix,
family = "gaussian",
theta = FALSE,
mean_yx = NULL,
n_cats
)Arguments
- n_obs
number of observations to generate.
- cat_prop
list of cumulative proportions for each item.
- cov_matrix
covariance matrix. between the latent trait (Y) and the background variables (X and Z).
- family
distribution of the background variables. Can be NULL or 'gaussian'.
- theta
if
TRUEwill label the first continuous variable 'theta'.- mean_yx
vector with the means of the latent trait (Y) and the continuous background variables with flexible variance (X).
- n_cats
vector with number of categories for each W.