generate_dependent_covariates: Generate dependent covariates - numerical or (ordinal)...

Description Usage Arguments Details

View source: R/features_dependent.R

Description

Generate dependent covariates - numerical or (ordinal) categorical

Usage

1
2
generate_dependent_covariates(no_pts, no_covariates, type = "numerical",
  no_categories, ...)

Arguments

no_pts

numeric; number of points to simulate.

no_covariates

numeric; number of covariates required.

type

character; 'numerical' or 'categorical'.

no_categories

numeric; number of categories if categorical variables are required.

...

See details.

Details

If 'numerical' is chosen, multivariate normal distribution is used (MASS::mvrnorm). One can supply the mean vector and the covariance matrix using the parameter 'mu' and 'Sigma'.

If 'categorical' is chosen, a thresholded multivariate normal distribution is used (orddata::rmvord). One can supply the covariance matrix with 'Sigma' and the marginal probabilities for the categories for each covariate with 'marginal_probs'.

'marginal_probs' expects a matrix. For example, consider two covariates X1, X2, each covariate has two categories. Suppose X1 has marginals (0.5, 0.5), and X2 has marginals (0.3, 0.7). Then one should input "marginal_probs = matrix(c(0.5,0.5, 0.3,0.7), nrow = 2, byrow = FALSE)".


kcf-jackson/glmSimData documentation built on May 20, 2019, 8:15 a.m.