Learn R Programming

MultiOrd (version 2.4.4)

genOrd: Generates multivariate ordinal data from binary parameters

Description

Generates multivariate ordinal data from the ordinal marginal probabilities and a list returned by the simBinCorr function.

Usage

genOrd(no.rows, ordPmat, binObj)

Value

Mydata

A list with two components. Two components are a matrix of multivariate ordinal data (y) and its correlation matrix (Corr)

Arguments

no.rows

Number of rows

ordPmat

Input matrix of ordinal marginal probabilities

binObj

A list returned by the simBinCorr

Details

It generates multivariate ordinal data. The argument binObj must be obtained using simBinCorr before executing this function.

See Also

simBinCorr, BinToOrd, generate.binary

Examples

Run this code
if (FALSE) ordPmat1 = matrix( c(0.15,0.70,0.40,
					0.55,0.10,0.25,
					0.25,0.10,0.15,
					0.05,0.10,0.20),4,3,byrow=TRUE)
if (FALSE) cmat1= matrix( 	c(1,0.2,0.2,
				0.2,1,0.2,
				0.2,0.2,1),3,3,byrow=TRUE) 
if (FALSE) binObj=simBinCorr(ordPmat1, cmat1, no.rows=100000, steps=0.025)		
if (FALSE) myData = genOrd( 1000, ordPmat1, binObj)		

Run the code above in your browser using DataLab