Learn R Programming

sirt (version 3.0-32)

polychoric2: Polychoric Correlation

Description

This function estimates the polychoric correlation coefficient using maximum likelihood estimation (Olsson, 1979).

Usage

polychoric2(dat, maxiter=100, cor.smooth=TRUE)

Arguments

dat

A dataset with integer values

maxiter

Maximum number of iterations

cor.smooth

An optional logical indicating whether the polychoric correlation matrix should be smooth to ensure positive definiteness.

Value

A list with following entries

tau

Matrix of thresholds

rho

Polychoric correlation matrix

Nobs

Sample size for every item pair

maxcat

Maximum number of categories per item

References

Olsson, U. (1979). Maximum likelihood estimation of the polychoric correlation coefficient. Psychometrika, 44, 443-460.

See Also

See the psych::polychoric function in the psych package.

For estimating tetrachoric correlations see tetrachoric2.

Examples

Run this code
# NOT RUN {
#############################################################################
# EXAMPLE 1: data.Students | activity scale
#############################################################################

data(data.Students, package="CDM")
dat <- data.Students[, paste0("act", 1:5 ) ]

# tetrachoric correlation from psych package
library(psych)
t0 <- psych::polychoric( dat )$rho
# Olsson method (maximum likelihood estimation)
t1 <- sirt::polychoric2( dat )$rho
# maximum absolute difference
max( abs( t0 - t1 ) )
  ##   [1] 0.006914892
# }

Run the code above in your browser using DataLab