| CorrelatedDesignMatrix {CatReg} | R Documentation | 
Create a design matrix of categorical variables with correlated columns.
Description
Function for use in simulations. Created design matrix of categorical variables with correlated columns
Usage
CorrelatedDesignMatrix(n, cov_mat, c)
Arguments
| n | Number of observations | 
| cov_mat | p x p covariance matrix. Controls correlations of pairs of marginally U[0,1] random variables that are subsequently binned to assign categories for each variable | 
| c | Number of categories within each variable | 
Value
A data frame of categorical (factor) variables.
Examples
# Generate matrix of marginal U[0,1] variables, 0.5 pairwise correlation, that are
# discretised into factor variables
cov_mat = 0.5 * diag(10) + 0.5 * matrix(1, 10, 10)
x = CorrelatedDesignMatrix(100, cov_mat, 8)
[Package CatReg version 2.0.3 Index]