A contingency table (array of rows of counts).
ML and stdErr (see PolycorOptions).
Polychoric correlation of two ordinal variables. By default the two-step estimate: thresholds from the margins,
then the maximum-likelihood correlation given them. Equivalent to polycor::polychor() in R. It takes x and y
or a table, as polychor(x, y) or polychor(table).
Given x and y, the table has the sorted distinct values of x as rows and those of y as columns (pairs with
a missing value are not counted). Rows and columns with a zero margin are removed with a warning; with fewer than
two rows or columns left, rho is NaN (and the result has no other fields).
With ML, the correlation and the thresholds are estimated together by maximum likelihood; with stdErr, the
result also has their variances, the chi-square test of bivariate normality and the thresholds (with stdErr
alone, the correlation is maximised given the two-step thresholds). The exact maximum is returned (R's optimisers
stop about 1e-4 short of it). If the likelihood increases up to |rho| = 0.9999, rho is ±0.9999 with a warning.
A contingency table (array of rows of counts).
Optionaloptions: PolycorOptions
ML and stdErr (see PolycorOptions).
Polychoric correlation of two ordinal variables given as vectors of category codes (see the table form).
Categories of the first variable.
Categories of the second variable, the same length.
ML and stdErr (see PolycorOptions).
Polychoric correlation of two ordinal variables. By default the two-step estimate: thresholds from the margins,
then the maximum-likelihood correlation given them. Equivalent to polycor::polychor() in R. It takes x and y
or a table, as polychor(x, y) or polychor(table).
Given x and y, the table has the sorted distinct values of x as rows and those of y as columns (pairs with
a missing value are not counted). Rows and columns with a zero margin are removed with a warning; with fewer than
two rows or columns left, rho is NaN (and the result has no other fields).
With ML, the correlation and the thresholds are estimated together by maximum likelihood; with stdErr, the
result also has their variances, the chi-square test of bivariate normality and the thresholds (with stdErr
alone, the correlation is maximised given the two-step thresholds). The exact maximum is returned (R's optimisers
stop about 1e-4 short of it). If the likelihood increases up to |rho| = 0.9999, rho is ±0.9999 with a warning.
Optionaloptions: PolycorOptions
ML and stdErr (see PolycorOptions).
Polychoric correlation of two ordinal variables. By default the two-step estimate: thresholds from the margins, then the maximum-likelihood correlation given them. Equivalent to
polycor::polychor()in R. It takesxandyor a table, aspolychor(x, y)orpolychor(table).Given
xandy, the table has the sorted distinct values ofxas rows and those ofyas columns (pairs with a missing value are not counted). Rows and columns with a zero margin are removed with a warning; with fewer than two rows or columns left,rhoisNaN(and the result has no other fields).With
ML, the correlation and the thresholds are estimated together by maximum likelihood; withstdErr, the result also has their variances, the chi-square test of bivariate normality and the thresholds (withstdErralone, the correlation is maximised given the two-step thresholds). The exact maximum is returned (R's optimisers stop about 1e-4 short of it). If the likelihood increases up to |rho| = 0.9999,rhois ±0.9999 with a warning.