Description Usage Arguments Value Examples

View source: R/UniformDesignMatrix.R

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

1 | ```
CorrelatedDesignMatrix(n, cov_mat, c)
``` |

`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 |

A data frame of categorical (factor) variables.

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)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.