
Last chance! 50% off unlimited learning
Sale ends in
CorPolychor(x, y, ML = FALSE, control = list(), std.err = FALSE, maxcor=.9999)
## S3 method for class 'CorPolychor':
print(x, digits = max(3, getOption("digits") - 3), ...)
x
is a variable, a second ordered categorical variable.TRUE
, compute the maximum-likelihood estimate; if FALSE
, the default, compute a quicker
``two-step'' approximation.optim
function.TRUE
, return the estimated variance of the correlation (for the two-step estimator)
or the estimated covariance matrix (for the ML estimator) of the correlation and thresholds; the default is FALSE
.std.err
is TRUE
,
returns an object of class "polycor"
with the following components:"polychoric"
.TRUE
for the ML estimate, FALSE
for the two-step estimate.hetcor
, polyserial
, print.CorPolychor
, optim
set.seed(12345)
z <- RndPairs(1000, 0.6)
x <- z[,1]
y <- z[,2]
cor(x, y) # sample correlation
x <- cut(x, c(-Inf, .75, Inf))
y <- cut(y, c(-Inf, -1, .5, 1.5, Inf))
CorPolychor(x, y) # 2-step estimate
CorPolychor(x, y, ML=TRUE, std.err=TRUE) # ML estimate
Run the code above in your browser using DataLab