GenOrd-package: Simulation of ordinal and discrete variables with given correlation matrix and marginal distributions
Description
The package implements a procedure for generating samples from ordinal/discrete random variables with pre-specified correlation matrix and marginal distributions.
It is developed in two steps: the first step (function ordcont
) sets up the original continuous variables in order to achieve the final discrete/ordinal variables meeting the experimental conditions; the second step (ordsample
) generates samples from the adjusted original variables and discretizes them, thus simulating samples from the target variables. The procedure can handle both Pearson's correlation and Spearman's rho, and any finite support for the discrete variables.
The intermediate function contord
computes the correlations of discrete/ordinal variables derived from correlated normal variables through discretization.
Function corrcheck
returns the lower and upper bounds of the correlation coefficients of ordinal/discrete variables given their marginal distributions, i.e. returns the range of feasible pairwise correlations.Details
ll{
Package: GenOrd
Type: Package
Version: 1.0
Date: 2012-03-27
License: GPL
LazyLoad: yes
}References
P.A. Ferrari, A. Barbiero: Simulating ordinal data, Multivariate Behavioral Research, forthcoming