View source: R/02_TestItemFunctions.R
polyserial | R Documentation |
Calculates the polyserial correlation coefficient between a continuous variable and an ordinal variable.
polyserial(x, y)
x |
A numeric vector representing the continuous variable. |
y |
A numeric vector representing the ordinal variable (must be integer values). |
This function implements Olsson et al.'s ad hoc method for estimating the polyserial correlation coefficient. The method assumes that the continuous variable follows a normal distribution and that the ordinal variable is derived from an underlying continuous normal variable through thresholds.
A numeric value representing the estimated polyserial correlation coefficient.
U.Olsson, F.Drasgow, and N.Dorans (1982). The polyserial correlation coefficient. Psychometrika, 47,337-347.
n <- 300
x <- rnorm(n)
y <- sample(1:5, size = n, replace = TRUE)
polyserial(x, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.