CAssociation · correlation.polychoric
Polychoric / polyserial correlation (ordinal variables)
How strongly are two ordinal variables (or an ordinal and a continuous one) related underneath?
Estimates the correlation between the continuous normal variables assumed to underlie ordered categories such as Likert items: polychoric for two ordinal variables (tetrachoric when both have two categories), polyserial for an ordinal and a continuous one. Two-step or full maximum likelihood, a likelihood-ratio test of zero correlation and, for polychoric correlations, a test of the underlying bivariate normality.
A real result
Example “Likert two step”, recorded in both engines. In the app, “Try this example” loads it into Analyze.
polychoric r = .51, 95% CI [.41, .60], χ²(1) = 70.92, p < .001, N = 298
- ρ
- 0.5108
- 95% CI
- [0.4141, 0.5960]
- SE
- 0.0464
- LR χ²(1)
- 70.917
- p
- < .001
- n
- 298
Effect size
- polychoric ρ 0.5108 95% CI [0.4141, 0.5960]
Assumptions
- Underlying bivariate normality — G²(11) = 6.12, p = 0.865: the fitted cell probabilities match the table.
Estimated thresholds (normal scale)
| Variable | Between | Threshold |
|---|---|---|
| satisfaction | Strongly disagree | Disagree | −1.358 |
| satisfaction | Disagree | Neutral | −0.4062 |
| satisfaction | Neutral | Agree | 0.3253 |
| satisfaction | Agree | Strongly agree | 1.138 |
| usage | Never | Rarely | −0.8610 |
| usage | Rarely | Often | 0.1861 |
| usage | Often | Always | 0.9901 |
- 2 of 300 rows were left out because a value was missing.
- 1 of 20 cells of the table are empty; the estimate may be unstable.
- Polychoric correlation, two-step estimate (Olsson 1979).
polychoric r = .51, 95% CI [.41, .60], χ²(1) = 70.92, p < .001, N = 298
- ρ
- 0.5108
- 95% CI
- [0.4141, 0.5960]
- SE
- 0.0464
- LR χ²(1)
- 70.917
- p
- < .001
- n
- 298
Effect size
- polychoric ρ 0.5108 95% CI [0.4141, 0.5960]
Assumptions
- Underlying bivariate normality — G²(11) = 6.12, p = 0.865: the fitted cell probabilities match the table.
Estimated thresholds (normal scale)
| Variable | Between | Threshold |
|---|---|---|
| satisfaction | Strongly disagree | Disagree | −1.358 |
| satisfaction | Disagree | Neutral | −0.4062 |
| satisfaction | Neutral | Agree | 0.3253 |
| satisfaction | Agree | Strongly agree | 1.138 |
| usage | Never | Rarely | −0.8610 |
| usage | Rarely | Often | 0.1861 |
| usage | Often | Always | 0.9901 |
- 2 of 300 rows were left out because a value was missing.
- 1 of 20 cells of the table are empty; the estimate may be unstable.
- Polychoric correlation, two-step estimate (Olsson 1979).
Do it in CodeSplash Run it on your own data, in Python or R, with the code to prove it.
Worked examples in the app
- Likert two stepf_ordinal · x: satisfaction · y: usage
- Likert mlf_ordinal · x: satisfaction · y: usage
- Numeric itemslikert_sim · x: q1 · y: q2
- Binary by ordinalf_ordinal · x: binary item · y: satisfaction
- Polyserial two stepf_ordinal · x: minutes per week · y: satisfaction
- Polyserial mlf_ordinal · x: minutes per week · y: usage
- Reversed orderf_ordinal · x: usage · y: satisfaction
- Degenerate constantf_ordinal · x: satisfaction · y: usage
In the guides
Where it sits in the decision guides
- Ordinal variables: Spearman / Kendall, polychoric · Statistics Guide · C — Test association
What you need
- First variablecategorical / boolean / numeric · 1 column
- Ordered categories, or a continuous variable (polyserial). Numbers with up to 10 distinct values count as ordered categories unless you say otherwise.
- Ordinal variablecategorical / boolean / numeric · 1 column
- Ordered categories (a Likert item, a rating, a grade); numbers are treated as ordered categories (at most 15).
Choices you make
statistics
- First variable isdefault auto
Whether the first variable is ordinal (polychoric) or continuous (polyserial). Automatic decides from the data.
- Automatic(default) — Categories are ordinal; numbers with ≤ 10 distinct values are ordinal, otherwise continuous.
- Ordinal (polychoric) — Treat the first variable's values as ordered categories.
- Continuous (polyserial) — Use the first variable's values as a continuous normal variable.
- Estimatordefault two_step
Two-step estimates thresholds first (fast); full ML estimates everything together (slightly more efficient).
- Two-step(default) — Thresholds from each variable's own category proportions, then the correlation by maximum likelihood (Olsson 1979). Fast and the usual default.
- Full maximum likelihood — Thresholds and correlation estimated together; slightly more efficient, slower with many categories.
options
- Order of the first variable's levelsdefault —
Drag the categories into their natural order (low to high); the stored order is used otherwise.
- Order of the ordinal variable's levelsdefault —
Drag the categories into their natural order (low to high); the stored order is used otherwise.
hypothesis
- Confidence leveldefault 0.95
How sure the intervals should be: 0.95 gives 95% confidence intervals. Higher confidence means wider intervals.
Checks and remedies
CodeSplash checks each testable assumption on every run and shows the result on the card; premises the data can’t test are marked. If a check fails, these are the ways forward.
Underlying bivariate normality
The categories are cuts of continuous variables that are jointly normal; the G² test compares the fitted cell probabilities with the table.
Enough observations per cell
Many empty cells make the estimate unstable and the normality test unreliable; merge rare categories.
What it reports
- Tests: Underlying correlation
- type
- Which correlation was estimated: tetrachoric (two binary variables), polychoric (ordinal) or polyserial (x continuous).
- estimator
- The exact variant that ran (for example Welch vs classic F), shown so the result can be reported and reproduced.
- rho
- The correlation between the normal traits assumed to lie behind two sets of ordered categories.
- se
- The typical size of the error in an estimate, the standard deviation of its sampling distribution.
- ci_low
- A range of effect values compatible with your data at the chosen confidence level.
- ci_high
- A range of effect values compatible with your data at the chosen confidence level.
- lr
- Compares nested models by how much the log-likelihood improves when parameters are added.
- p
- How surprising your data would be if the null hypothesis were true, as a probability.
- g2
- A sum of squared, scaled differences between observed and expected counts or estimates.
- df_bn
- How much independent information is left to estimate variability after fitting the model.
- p_bn
- The correlation between the normal traits assumed to lie behind two sets of ordered categories.
- n
- How many independent units the analysis used; it sets precision and power.
- levels_x
- Categories of x in the order used, lowest first. Empty when x is treated as continuous (polyserial).
- levels_y
- Categories of y in the order used, lowest first.
- pearson
- How closely two numbers follow a straight line, from −1 to 1. Outliers can pull it a long way.
- n_zero_cells
- How many independent units the analysis used; it sets precision and power.
Python and R
Python and R agree to 6 decimals (relative tolerance 1e-6). Python uses pandas, numpy, scipy, codesplash; R uses stats, nanoparquet, codesplashr.
Default traps between the two languages
- Both engines use the codesplash twins: Genz's deterministic bivariate-normal algorithm, the same golden-section search and Newton polish; standard errors come from central-difference curvature, so they agree to about 1e-7 rather than to machine precision (P1).
- polycor::polychor (ML = FALSE) maximizes with optim, so its estimate agrees with the two-step estimate here to its optimizer tolerance (≈1e-6).
The exact script CodeSplash ran for example “Likert two step” · Python 3.13.5 · scipy 1.18.1 · pandas 3.1.0
# Polychoric / polyserial correlation (ordinal variables)
# Generated by CodeSplash Analytics 1.0.0 on 2026-11-09 · method correlation.polychoric 1.0.1 · spec 1629055bc54e26c1
# Dataset: f_ordinal (version 1)
# Runs on its own: outside the app, cs.publish() writes $CS_RESULT_PATH or prints the result JSON.
# %% Setup
import numpy as np
import pandas as pd
import codesplash as cs
from codesplash.stats import polychoric
# %% Data
df = pd.read_parquet("tests/parity/fixtures/f_ordinal.parquet", columns=["satisfaction", "usage"])
n_input = len(df)
df["satisfaction"] = pd.Categorical(df["satisfaction"], categories=["Strongly disagree", "Disagree", "Neutral", "Agree", "Strongly agree"]) # stored level order
df["usage"] = pd.Categorical(df["usage"], categories=["Never", "Rarely", "Often", "Always"]) # stored level order
df = df.dropna(subset=["satisfaction", "usage"]) # listwise deletion over the analysis columns
df["satisfaction"] = df["satisfaction"].cat.remove_unused_categories()
df["usage"] = df["usage"].cat.remove_unused_categories()
n_dropped = n_input - len(df)
warnings = []
if n_dropped:
warnings.append(cs.cs_warning("CS_W_ROWS_DROPPED", dropped=n_dropped, total=n_input))
if n_input and not len(df):
cs.cs_error("CS_E_NO_ROWS")
cs.check_finite_columns(df, ["satisfaction", "usage"]) # infinite values stop the run (registry/errors.yaml)
# %% Ordinal codes
a, b = "satisfaction", "usage"
x_numeric = False
y_numeric = False
x_type = "auto"
estimator = "two_step"
x_order = None
y_order = None
conf = 0.95
def ordinal(col, numeric, order, max_levels):
"""Codes 0..K−1 in the given (or stored / numeric) order, observed levels only."""
s = df[col]
if numeric:
values = np.sort(s.unique())
if len(values) > max_levels:
cs.cs_error("CS_E_TOO_MANY_LEVELS", column=col, k=len(values), max=max_levels)
levels = [f"{v:g}" for v in values]
codes = np.searchsorted(values, s.to_numpy())
return codes.astype(int), levels
levels = [str(v) for v in (order if order else list(s.cat.categories))]
present = set(str(v) for v in s.astype(str).unique())
missing = present - set(levels)
if missing:
raise ValueError(f"The level order for {col} leaves out: {', '.join(sorted(missing))}.")
levels = [lv for lv in levels if lv in present]
if len(levels) > max_levels: # the same limit as numeric ordinal columns
cs.cs_error("CS_E_TOO_MANY_LEVELS", column=col, k=len(levels), max=max_levels)
lookup = {lv: i for i, lv in enumerate(levels)}
return s.astype(str).map(lookup).to_numpy(dtype=int), levels
if x_type == "auto":
x_type = "continuous" if x_numeric and df[a].nunique() > 10 else "ordinal"
if x_type == "continuous" and not x_numeric:
raise ValueError(f"{a} is not numeric, so it cannot be treated as continuous.")
y_codes, levels_y = ordinal(b, y_numeric, y_order, 15)
if len(levels_y) < 2:
cs.cs_error("CS_E_CONSTANT", column=b)
n = len(df)
if x_type == "continuous":
kind = "polyserial"
xv = df[a].to_numpy(dtype=float)
if len(np.unique(xv)) < 2:
cs.cs_error("CS_E_CONSTANT", column=a)
res = polychoric.polyserial(xv, y_codes, len(levels_y), estimator=estimator, conf=conf)
levels_x = None
pearson = float(np.corrcoef(xv, y_codes)[0, 1])
thresholds = [{"variable": b, "between": f"{levels_y[i]} | {levels_y[i + 1]}", "threshold": t} for i, t in enumerate(res["thresholds_y"])]
g2 = df_bn = p_bn = None
n_zero_cells = 0
else:
x_codes, levels_x = ordinal(a, x_numeric, x_order, 15)
if len(levels_x) < 2:
cs.cs_error("CS_E_CONSTANT", column=a)
kind = "tetrachoric" if len(levels_x) == 2 and len(levels_y) == 2 else "polychoric"
tab = np.zeros((len(levels_x), len(levels_y)))
np.add.at(tab, (x_codes, y_codes), 1)
res = polychoric.polychoric(tab, estimator=estimator, conf=conf)
pearson = float(np.corrcoef(x_codes, y_codes)[0, 1])
thresholds = ([{"variable": a, "between": f"{levels_x[i]} | {levels_x[i + 1]}", "threshold": t} for i, t in enumerate(res["thresholds_x"])]
+ [{"variable": b, "between": f"{levels_y[i]} | {levels_y[i + 1]}", "threshold": t} for i, t in enumerate(res["thresholds_y"])])
g2, df_bn, p_bn = res["g2"], res["df_bn"], res["p_bn"]
empty = int(np.sum(tab == 0))
n_zero_cells = empty
if empty:
warnings.append(f"{empty} of {tab.size} cells of the table are empty; the estimate may be unstable.")
rho, se, p = res["rho"], res["se"], res["p"]
# %% Result
alpha = 1 - conf
pct = f"{conf:.0%}"
verdict = (f"The underlying variables are correlated ({cs.fmt_p(p)})." if p < alpha
else f"The data are compatible with no underlying correlation ({cs.fmt_p(p)}).")
summary = (f"The {kind} correlation between {a} and {b} was {rho:.2f}, {pct} CI [{res['ci_low']:.2f}, {res['ci_high']:.2f}] "
f"(n = {n}; Pearson r on the category codes {pearson:.2f}). {verdict}")
apa = (f"{kind} r = {cs.fmt_num(rho, leading_zero=False)}, {pct} CI [{cs.fmt_num(res['ci_low'], leading_zero=False)}, "
f"{cs.fmt_num(res['ci_high'], leading_zero=False)}], χ²(1) = {res['lr']:.2f}, {cs.fmt_p(p)}, N = {n}")
if kind == "polyserial":
bn = {"key": "latent_normality", "label": "Underlying bivariate normality", "status": "info",
"detail": "Not testable for a polyserial correlation here; check that the continuous variable looks normal within categories."}
elif df_bn is None:
bn = {"key": "latent_normality", "label": "Underlying bivariate normality", "status": "info",
"detail": "A 2 × 2 table has no degrees of freedom left to test bivariate normality."}
else:
bn = {"key": "latent_normality", "label": "Underlying bivariate normality", "status": "pass" if p_bn >= 0.05 else "warn",
"statistic": g2, "p": p_bn,
"detail": f"G²({df_bn}) = {g2:.2f}, p = {p_bn:.3f}: " + ("the fitted cell probabilities match the table." if p_bn >= 0.05
else "the table departs from a discretized bivariate normal; interpret the latent correlation with care.")}
cs.publish({
"method": "correlation.polychoric",
"methodVersion": "1.0.1",
"title": f"{kind.capitalize()} correlation",
"engine": cs.engine_info("pandas", "numpy", "scipy"),
"n": n,
"summary": summary,
"apa": apa,
"statistics": [
{"key": "rho", "label": "ρ", "value": rho},
{"key": "ci", "label": f"{pct} CI", "value": [res["ci_low"], res["ci_high"]]},
{"key": "se", "label": "SE", "value": se},
{"key": "lr", "label": "LR χ²(1)", "value": res["lr"]},
{"key": "p", "label": "p", "value": p, "format": "p"},
{"key": "n", "label": "n", "value": n},
],
"tables": [{"key": "thresholds", "title": "Estimated thresholds (normal scale)", "columns": [
{"key": "variable", "label": "Variable", "type": "string"}, {"key": "between", "label": "Between", "type": "string"},
{"key": "threshold", "label": "Threshold", "type": "number"}], "rows": thresholds}],
"effectSizes": [{"key": "rho", "label": f"{kind} ρ", "value": rho, "ciLow": res["ci_low"], "ciHigh": res["ci_high"], "ciLevel": conf,
"method": "Wald interval on the Fisher z scale"}],
"assumptions": [bn],
"charts": [],
"warnings": warnings,
"notes": [f"{kind.capitalize()} correlation, {'two-step' if estimator == 'two_step' else 'full maximum likelihood'} estimate (Olsson 1979)."],
"values": {"type": kind, "estimator": estimator, "rho": rho, "se": se, "ci_low": res["ci_low"], "ci_high": res["ci_high"],
"lr": res["lr"], "p": p, "g2": g2, "df_bn": df_bn, "p_bn": p_bn, "n": n, "levels_x": levels_x, "levels_y": levels_y,
"pearson": pearson, "n_zero_cells": n_zero_cells},
})
The exact script CodeSplash ran for example “Likert two step” · R version 4.5.1 (2025-06-13)
# Polychoric / polyserial correlation (ordinal variables)
# Generated by CodeSplash Analytics 1.0.0 on 2026-11-09 · method correlation.polychoric 1.0.1 · spec 1629055bc54e26c1
# Dataset: f_ordinal (version 1)
# Runs on its own: outside the app, cs_publish() writes $CS_RESULT_PATH or prints the result JSON.
# %% Setup
library(codesplashr)
# %% Data
df <- as.data.frame(nanoparquet::read_parquet("tests/parity/fixtures/f_ordinal.parquet", col_select = c("satisfaction", "usage")))
n_input <- nrow(df)
df[["satisfaction"]] <- factor(df[["satisfaction"]], levels = c("Strongly disagree", "Disagree", "Neutral", "Agree", "Strongly agree")) # stored level order
df[["usage"]] <- factor(df[["usage"]], levels = c("Never", "Rarely", "Often", "Always")) # stored level order
df <- df[stats::complete.cases(df[c("satisfaction", "usage")]), , drop = FALSE] # listwise deletion
df[] <- lapply(df, function(x) if (is.factor(x)) droplevels(x) else x)
n_dropped <- n_input - nrow(df)
warnings <- list()
if (n_dropped > 0) {
warnings <- c(warnings, cs_warning("CS_W_ROWS_DROPPED", dropped = n_dropped, total = n_input))
}
if (n_input > 0 && nrow(df) == 0) cs_error("CS_E_NO_ROWS")
cs_check_finite_columns(df, c("satisfaction", "usage")) # infinite values stop the run (registry/errors.yaml)
# %% Ordinal codes
a <- "satisfaction"
b <- "usage"
x_numeric <- FALSE
y_numeric <- FALSE
x_type <- "auto"
estimator <- "two_step"
x_order <- NULL
y_order <- NULL
conf <- 0.95
ordinal <- function(col, numeric, order, max_levels) {
s <- df[[col]]
if (numeric) {
values <- sort(unique(s), method = "radix")
if (length(values) > max_levels) cs_error("CS_E_TOO_MANY_LEVELS", column = col, k = length(values), max = max_levels)
return(list(codes = match(s, values) - 1L, levels = sprintf("%g", values)))
}
levels <- if (!is.null(order)) as.character(order) else levels(s)
present <- unique(as.character(s))
missing <- setdiff(present, levels)
if (length(missing)) stop(sprintf("The level order for %s leaves out: %s.", col, paste(sort(missing, method = "radix"), collapse = ", ")))
levels <- levels[levels %in% present]
# the same limit as numeric ordinal columns
if (length(levels) > max_levels) cs_error("CS_E_TOO_MANY_LEVELS", column = col, k = length(levels), max = max_levels)
list(codes = match(as.character(s), levels) - 1L, levels = levels)
}
if (x_type == "auto") x_type <- if (x_numeric && length(unique(df[[a]])) > 10) "continuous" else "ordinal"
if (x_type == "continuous" && !x_numeric) stop(sprintf("%s is not numeric, so it cannot be treated as continuous.", a))
oy <- ordinal(b, y_numeric, y_order, 15)
y_codes <- oy$codes; levels_y <- oy$levels
if (length(levels_y) < 2) cs_error("CS_E_CONSTANT", column = b)
n <- nrow(df)
g2 <- NULL; df_bn <- NULL; p_bn <- NULL; n_zero_cells <- 0L
if (x_type == "continuous") {
kind <- "polyserial"
xv <- as.double(df[[a]])
if (length(unique(xv)) < 2) cs_error("CS_E_CONSTANT", column = a)
res <- cs_polyserial(xv, y_codes, length(levels_y), estimator = estimator, conf = conf)
levels_x <- NULL
pearson <- stats::cor(xv, y_codes)
thresholds <- lapply(seq_along(res$thresholds_y), function(i) list(variable = b, between = sprintf("%s | %s", levels_y[i], levels_y[i + 1]), threshold = res$thresholds_y[i]))
} else {
ox <- ordinal(a, x_numeric, x_order, 15)
x_codes <- ox$codes; levels_x <- ox$levels
if (length(levels_x) < 2) cs_error("CS_E_CONSTANT", column = a)
kind <- if (length(levels_x) == 2 && length(levels_y) == 2) "tetrachoric" else "polychoric"
tab <- matrix(0, length(levels_x), length(levels_y))
for (i in seq_along(x_codes)) tab[x_codes[i] + 1L, y_codes[i] + 1L] <- tab[x_codes[i] + 1L, y_codes[i] + 1L] + 1
res <- cs_polychoric(tab, estimator = estimator, conf = conf)
pearson <- stats::cor(x_codes, y_codes)
thresholds <- c(lapply(seq_along(res$thresholds_x), function(i) list(variable = a, between = sprintf("%s | %s", levels_x[i], levels_x[i + 1]), threshold = res$thresholds_x[i])),
lapply(seq_along(res$thresholds_y), function(i) list(variable = b, between = sprintf("%s | %s", levels_y[i], levels_y[i + 1]), threshold = res$thresholds_y[i])))
g2 <- res$g2; df_bn <- res$df_bn; p_bn <- res$p_bn
empty <- sum(tab == 0)
n_zero_cells <- as.integer(empty)
if (empty > 0) warnings <- c(warnings, sprintf("%d of %d cells of the table are empty; the estimate may be unstable.", as.integer(empty), length(tab)))
}
rho <- res$rho; se <- res$se; p <- res$p
# %% Result
alpha <- 1 - conf
pct <- sprintf("%.0f%%", conf * 100)
verdict <- if (p < alpha) sprintf("The underlying variables are correlated (%s).", cs_fmt_p(p)) else sprintf("The data are compatible with no underlying correlation (%s).", cs_fmt_p(p))
summary <- sprintf("The %s correlation between %s and %s was %.2f, %s CI [%.2f, %.2f] (n = %d; Pearson r on the category codes %.2f). %s",
kind, a, b, rho, pct, res$ci_low, res$ci_high, n, pearson, verdict)
apa <- sprintf("%s r = %s, %s CI [%s, %s], χ²(1) = %.2f, %s, N = %d", kind, cs_fmt_num(rho, leading_zero = FALSE), pct,
cs_fmt_num(res$ci_low, leading_zero = FALSE), cs_fmt_num(res$ci_high, leading_zero = FALSE), res$lr, cs_fmt_p(p), n)
bn <- if (kind == "polyserial") {
list(key = "latent_normality", label = "Underlying bivariate normality", status = "info",
detail = "Not testable for a polyserial correlation here; check that the continuous variable looks normal within categories.")
} else if (is.null(df_bn)) {
list(key = "latent_normality", label = "Underlying bivariate normality", status = "info",
detail = "A 2 × 2 table has no degrees of freedom left to test bivariate normality.")
} else {
list(key = "latent_normality", label = "Underlying bivariate normality", status = if (p_bn >= 0.05) "pass" else "warn",
statistic = g2, p = p_bn,
detail = paste0(sprintf("G²(%d) = %.2f, p = %.3f: ", as.integer(df_bn), g2, p_bn),
if (p_bn >= 0.05) "the fitted cell probabilities match the table."
else "the table departs from a discretized bivariate normal; interpret the latent correlation with care."))
}
cs_publish(list(
method = "correlation.polychoric",
methodVersion = "1.0.1",
title = sprintf("%s correlation", paste0(toupper(substring(kind, 1, 1)), substring(kind, 2))),
engine = cs_engine_info("stats", "nanoparquet"),
n = n,
summary = summary,
apa = apa,
statistics = list(
list(key = "rho", label = "ρ", value = rho),
list(key = "ci", label = paste(pct, "CI"), value = c(res$ci_low, res$ci_high)),
list(key = "se", label = "SE", value = se),
list(key = "lr", label = "LR χ²(1)", value = res$lr),
list(key = "p", label = "p", value = p, format = "p"),
list(key = "n", label = "n", value = n)
),
tables = list(list(key = "thresholds", title = "Estimated thresholds (normal scale)", columns = list(
list(key = "variable", label = "Variable", type = "string"), list(key = "between", label = "Between", type = "string"),
list(key = "threshold", label = "Threshold", type = "number")), rows = thresholds)),
effectSizes = list(list(key = "rho", label = paste(kind, "ρ"), value = rho, ciLow = res$ci_low, ciHigh = res$ci_high, ciLevel = conf,
method = "Wald interval on the Fisher z scale")),
assumptions = list(bn),
charts = list(),
warnings = warnings,
notes = list(sprintf("%s correlation, %s estimate (Olsson 1979).", paste0(toupper(substring(kind, 1, 1)), substring(kind, 2)),
if (estimator == "two_step") "two-step" else "full maximum likelihood")),
values = list(type = kind, estimator = estimator, rho = rho, se = se, ci_low = res$ci_low, ci_high = res$ci_high,
lr = res$lr, p = p, g2 = g2, df_bn = df_bn, p_bn = p_bn, n = n, levels_x = levels_x, levels_y = levels_y,
pearson = pearson, n_zero_cells = n_zero_cells)
))
Sources
- Olsson, U. (1979). Maximum likelihood estimation of the polychoric correlation coefficient. Psychometrika, 44, 443–460.
- Olsson, U., Drasgow, F., & Dorans, N. J. (1982). The polyserial correlation coefficient. Psychometrika, 47, 337–347.
- Drezner, Z., & Wesolowsky, G. O. (1990). On the computation of the bivariate normal integral. Journal of Statistical Computation and Simulation, 35, 101–107.
- Genz, A. (2004). Numerical computation of rectangular bivariate and trivariate normal and t probabilities. Statistics and Computing, 14, 251–260.
From the CodeSplash method registry · correlation.polychoric v1.0.1.