CorrelatedDesignMatrix: Create a design matrix of categorical variables with...

Description Usage Arguments Value Examples

View source: R/UniformDesignMatrix.R

Description

Function for use in simulations. Created design matrix of categorical variables with correlated columns

Usage

1

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

1
2
3
4
# 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)

CatReg documentation built on June 14, 2021, 5:07 p.m.