polychoric0 {FactorCopula}R Documentation

Polychoric correlation

Description

Polychoric correlation

Usage

polychoric0(odat,iprint=FALSE,prlevel=0)    

Arguments

odat

nxd matrix of ordinal responses in 0,...,(ncat-1) or 1,...,ncat

iprint

flag for printing of intermediate results, including bivariate tables for observed versus expected assuming discretized bivariate Gaussian

prlevel

print.level for nlm for numerical optimization

Details

Polychoric correlation for ordinal random variables. The number of categories can vary.

Value

$polych is a polychoric correlation matrix based on two-stage estimate; $iposdef is an indicator if the 2-stage correlation matrix estimate is positive definite.

Examples

data(PTSD)
ydat=PTSD
rmat=polychoric0(ydat)$p

[Package FactorCopula version 0.9.3 Index]