Last data update: 2014.03.03

R: Converts multivariate binary data to multivariate ordinal...
BinToOrdR Documentation

Converts multivariate binary data to multivariate ordinal data

Description

Converts multivariate binary data to multivariate ordinal data using original ordinal probabilities.

Usage

BinToOrd(prop.vec.bin, ordPmat, Mlocation, bin.data)

Arguments

prop.vec.bin

Vector of marginal probabilities. It is usually a first component of the list returned by find.binary.prob

ordPmat

Input matrix of ordinal marginal probabilities

Mlocation

Vector of locations where dichotomization is done. It is usually a second component of the list returned by find.binary.prob

bin.data

Matrix of binary data generated using generate.binary

Details

As a part of the multivariate ordinal data generation, intermediate multivariate binary data are generated. This function converts multivariate binary data generated by generate.binary to the multivariate ordinal data.

Value

y

Matrix of multivariate ordinal data

Corr

Correlation matrix of y

Examples

## Not run: 	nObs = 1000; nSim = 100000 
## Not run: 	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) 
## End(Not run)
					
## Not run: 	cmat1= matrix( 	c(1,0.2,0.2,
				0.2,1,0.2,
				0.2,0.2,1),3,3,byrow=TRUE) 
## End(Not run)
				
## Not run: 	binObj = simBinCorr(ordPmat1, cmat1, nSim) 
## Not run: 	ep0 = generate.binary( nObs, binObj$pvec, binObj$del.next) 
## Not run: 	Mydata= BinToOrd(binObj$pvec, ordPmat1, binObj$Mlocation, ep0) 	

Results