cor.poly | R Documentation |
This function computes a polychoric correlation matrix, which is the estimated Pearson product-moment correlation matrix between underlying normally distributed latent variables which generate the ordinal scores.
cor.poly(x, smooth = TRUE, global = TRUE, weight = NULL, correct = 0,
progress = TRUE, na.rm = TRUE, delete = TRUE,
tri = c("both", "lower", "upper"), digits = 2, as.na = NULL,
check = TRUE, output = TRUE)
x |
a matrix or data frame of discrete values. |
smooth |
logical: if |
global |
logical: if |
weight |
a vector of length of the number of observations that specifies
the weights to apply to each case. The |
correct |
a numeric value indicating the correction value to use to
correct for continuity in the case of zero entry. Note that
unlike in the |
progress |
logical: if |
na.rm |
logical: if |
delete |
logical: if |
tri |
a character string indicating which triangular of the matrix
to show on the console, i.e., |
digits |
an integer value indicating the number of decimal places to be used for displaying correlation coefficients. |
as.na |
a numeric vector indicating user-defined missing values,
i.e. these values are converted to |
check |
logical: if |
output |
logical: if |
Returns an object of class misty.object
, which is a list with following
entries:
call |
function call |
type |
type of analysis |
data |
matrix or data frame specified in |
args |
specification of function arguments |
result |
result table |
This function is based on the polychoric()
function in the psych
package by William Revelle.
William Revelle
Revelle, W. (2018) psych: Procedures for personality and psychological research. Northwestern University, Evanston, Illinois, USA, https://CRAN.R-project.org/package=psych Version = 1.8.12.
dat <- data.frame(x1 = c(1, 1, 3, 2, 1, 2, 3, 2, 3, 1),
x2 = c(1, 2, 1, 1, 2, 2, 2, 1, 3, 1),
x3 = c(1, 3, 2, 3, 3, 1, 3, 2, 1, 2))
# Polychoric correlation matrix
cor.poly(dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.