R Under development (unstable) (2023-12-02 r85657 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # test.makeThresholds.R > > library(ordinal) > > # Prvious bug which is now fixed: > res <- ordinal:::makeThresholds(letters[1:3], "symmetric") > stopifnot(length(res$alpha.names) == res$nalpha) > # length(res$alpha.names) used to be 4 > > # Real data example: > wine <- within(wine, { + rating_comb3b <- rating + levels(rating_comb3b) <- c("1-2", "1-2", "3", "4-5", "4-5") + }) > wine$rating_comb3b[1] <- "4-5" # Need to remove the zero here to avoid inf MLE > ftable(rating_comb3b ~ temp + contact, data=wine) rating_comb3b 1-2 3 4-5 temp contact cold no 12 5 1 yes 8 8 2 warm no 5 8 5 yes 1 5 12 > > fm.comb3_c <- clm(rating_comb3b ~ contact, #scale=~contact, + threshold = "symmetric", data=wine) # no error > > proc.time() user system elapsed 1.39 0.25 1.62