polychoric0: Polychoric correlation

polychoric0R 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

FactorCopula documentation built on March 7, 2023, 5:29 p.m.