powered by
Implements the maximum likelihood estimator of Olsson (1979, Psychometrika, tools:::Rd_expr_doi("10.1007/BF02296207")) for the polychoric correlation model.
polycor_mle( x, y = NULL, variance = TRUE, constrained = TRUE, twostep = FALSE, method = ifelse(constrained, "Nelder-Mead", "L-BFGS-B"), maxcor = 0.999, tol_thresholds = 0.01, init = initialize_param(x, y) )
An object of class "robpolycor". See polycor() for details.
"robpolycor"
polycor()
Vector of integer-valued responses to first item, or contingency table (a "table" object).
"table"
Vector of integer-valued responses to second item; only required if x is not a contingency table.
x
Shall an estimated asymptotic covariance matrix be returned? Default is TRUE.
TRUE
shall strict monotonicity of thresholds be explicitly enforced by linear constraints? Only relevant if twostep = FALSE. Default is TRUE.
twostep = FALSE
Shall two-step estimation of Olsson (1979) <doi:10.1007/BF02296207> be performed? Default is FALSE.
FALSE
Numerical optimization method; default is Nelder-Mead.
Maximum absolute correlation (to ensure numerical stability). Deafult is 0.999.
Minimum distance between consecutive thresholds (to enforce strict monotonicity); only relevant if constrained = TRUE. Default is 0.01.
constrained = TRUE
Initialization of numerical optimization. Default is neutral. If twostep = TRUE, only the first element (the correlation coefficient) will be used.
twostep = TRUE
## example data set.seed(123) x <- sample(c(1,2,3), size = 100, replace = TRUE) y <- sample(c(1,2,3), size = 100, replace = TRUE) polycor(x,y) # robust polycor_mle(x,y) # non-robust MLE
Run the code above in your browser using DataLab