Running ‘anova.R’ [2s/3s]
  Running ‘clm.fit.R’ [2s/4s]
  Running ‘clm.formula.R’ [2s/3s]
  Running ‘clmm.R’ [6s/9s]
  Running ‘clmm.control.R’ [2s/3s]
  Running ‘clmm.formula.R’ [3s/5s]
  Running ‘clmm.methods.R’ [3s/4s]
  Running ‘confint.R’ [2s/3s]
  Running ‘nominal.test.R’ [2s/3s]
  Running ‘ranef.loading.R’ [3s/4s]
  Running ‘test-all.R’ [14s/22s]
  Running ‘test.clm.Theta.R’ [2s/3s]
  Running ‘test.clm.convergence.R’ [2s/3s]
  Running ‘test.clm.flex.link.R’ [2s/3s]
  Running ‘test.clm.model.matrix.R’ [2s/3s]
  Running ‘test.clm.predict.R’ [2s/3s]
  Running ‘test.clm.profile.R’ [2s/3s]
  Running ‘test.clm.single.anova.R’ [2s/3s]
  Running ‘test.general.R’ [0s/1s]
  Running ‘test.makeThresholds.R’ [2s/3s]
  Running ‘test.sign.R’ [2s/4s]
  Running ‘test0weights.R’ [2s/3s]
  Running ‘testAnova.clm2.R’ [2s/4s]
  Running ‘testCLM.R’ [2s/3s]
Running the tests in ‘tests/anova.R’ failed.
Complete output:
  > library(ordinal)
  > data(wine)
  > 
  > fm1 <- clm(rating ~ temp, data=wine)
  Error: length of start is 5 should equal 4
  Execution halted
Running the tests in ‘tests/clm.formula.R’ failed.
Complete output:
  > library(ordinal)
  > ## library(devtools)
  > ## r2path <- "/Users/rhbc/Documents/Rpackages/ordinal/pkg/ordinal"
  > ## clean_dll(pkg = r2path)
  > ## load_all(r2path)
  > 
  > #################################
  > ## Appropriate evaluation of formulas:
  > 
  > ## These fail and give appropriate error messages:
  > ##  fm1 <- clm(rating ~ contact, scale=temp, data=wine)
  > ##  fm1 <- clm(rating ~ contact, scale=~Temp, data=wine)
  > ##  fm1 <- clm(rating ~ contact, scale="temp", data=wine)
  > ##  sca <- "temp"
  > ##  fm1 <- clm(rating ~ contact, scale=sca, data=wine)
  > ##  sca <- as.formula(sca)
  > ##  sca <- as.formula(temp)
  > ##  sca <- with(wine, as.formula(temp))
  > 
  > ## These all work as intended with no warnings or errors:
  > fm1 <- clm(rating ~ contact, scale="~temp", data=wine)
  > fm1 <- clm(rating ~ contact, scale=~temp, data=wine)
  > sca <- "~temp"
  > fm1 <- clm(rating ~ contact, scale=sca, data=wine)
  > sca <- as.formula("~temp")
  > fm1 <- clm(rating ~ contact, scale=sca, data=wine)
  > fm1 <- clm(rating ~ contact, scale=as.formula(~temp), data=wine)
  > fm1 <- clm(rating ~ contact, scale=as.formula("~temp"), data=wine)
  > 
  > #################################
  > ## can evaluate if 'formula' is a character:
  > f <- "rating ~ contact + temp"
  > clm(f, data=wine)
  Error: length of start is 6 should equal 5
  Execution halted
Running the tests in ‘tests/confint.R’ failed.
Complete output:
  > #################################
  > ## test profile and confint methods:
  > library(ordinal)
  > data(wine)
  > fm1 <- clm(rating ~ contact + temp, data = wine)
  Error: length of start is 6 should equal 5
  Execution halted
Running the tests in ‘tests/nominal.test.R’ failed.
Complete output:
  > library(ordinal)
  > 
  > if(require(MASS)) {
  +     fm1 <- clm(Sat ~ Infl + Type + Cont, data=housing, weights=Freq)
  +     scale_test(fm1)
  +     nominal_test(fm1)
  + 
  +     fm2 <- update(fm1, scale=~Cont)
  +     scale_test(fm2)
  +     nominal_test(fm2)
  +     fm3 <- update(fm1, nominal=~ Cont)
  +     fm3$Theta
  +     anova(fm2, fm3)
  +     fm3$alpha.mat
  +     summary(fm3)
  + }
  Loading required package: MASS
  Error: length of start is 8 should equal 7
  Execution halted
Running the tests in ‘tests/test-all.R’ failed.
Complete output:
  > 
  > if(require(testthat) && require(ordinal)) {
  +     test_check("ordinal")
  + }
  Loading required package: testthat
  Loading required package: ordinal
  [ FAIL 9 | WARN 0 | SKIP 0 | PASS 41 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-clm-formula.R:40:5'): standard formulae are interpreted correctly/give right error messages ──
  Error: length of start is 6 should equal 5
  Backtrace:
      ▆
   1. ├─testthat::expect_is(clm(f, data = wine), "clm") at test-clm-formula.R:40:4
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─ordinal::clm(f, data = wine)
   5.   └─ordinal:::clm.fit.default(clm.struct)
   6.     └─ordinal:::set.start(...)
  ── Error ('test-clm-formula.R:61:5'): variables are found in the right environments ──
  Error: length of start is 6 should equal 5
  Backtrace:
      ▆
   1. ├─testthat::expect_is(fm1 <- clm(f1, data = wine), "clm") at test-clm-formula.R:61:4
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─ordinal::clm(f1, data = wine)
   5.   └─ordinal:::clm.fit.default(clm.struct)
   6.     └─ordinal:::set.start(...)
  ── Error ('test-clm-formula.R:107:5'): data indexing works in formulae ─────────
  Error: length of start is 4 should equal 3
  Backtrace:
      ▆
   1. ├─testthat::expect_is(fit <- clm(data$y ~ data$x), "clm") at test-clm-formula.R:107:4
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─ordinal::clm(data$y ~ data$x)
   5.   └─ordinal:::clm.fit.default(clm.struct)
   6.     └─ordinal:::set.start(...)
  ── Error ('test-clm-formula.R:127:16'): clm may be invoked within functions ────
  Error: length of start is 6 should equal 5
  Backtrace:
      ▆
   1. ├─testthat::expect_is(...) at test-clm-formula.R:141:4
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─ordinal (local) fun.clm(rating ~ temp + contact, data = wine)
   5.   └─ordinal::clm(formula, data = data) at test-clm-formula.R:127:15
   6.     └─ordinal:::clm.fit.default(clm.struct)
   7.       └─ordinal:::set.start(...)
  ── Error ('test-clm-formula.R:188:5'): '.'-notation works in formula ───────────
  Error: length of start is 6 should equal 5
  Backtrace:
      ▆
   1. └─ordinal::clm(rating ~ ., data = wine2) at test-clm-formula.R:188:4
   2.   └─ordinal:::clm.fit.default(clm.struct)
   3.     └─ordinal:::set.start(...)
  ── Error ('test-clm-predict.R:3:1'): (code run outside of `test_that()`) ───────
  Error: length of start is 6 should equal 5
  Backtrace:
      ▆
   1. └─ordinal::clm(rating ~ temp + contact, data = wine) at test-clm-predict.R:3:0
   2.   └─ordinal:::clm.fit.default(clm.struct)
   3.     └─ordinal:::set.start(...)
  ── Error ('test-clm.R:38:5'): offset is allowed in formula, but not in scale and nominal ──
  Error: length of start is 6 should equal 5
  Backtrace:
      ▆
   1. ├─testthat::expect_is(...) at test-clm.R:38:4
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─ordinal::clm(rating ~ temp + contact + offset(off), data = wine2)
   5.   └─ordinal:::clm.fit.default(clm.struct)
   6.     └─ordinal:::set.start(...)
  ── Error ('test-clm.R:66:5'): Intercept is needed and assumed ──────────────────
  Error: length of start is 4 should equal 3
  Backtrace:
      ▆
   1. ├─testthat::expect_is(fm <- clm(rating ~ 1, data = wine), "clm") at test-clm.R:66:4
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─ordinal::clm(rating ~ 1, data = wine)
   5.   └─ordinal:::clm.fit.default(clm.struct)
   6.     └─ordinal:::set.start(...)
  ── Error ('test-contrasts.R:31:5'): clm gives contrast warnings when it should ──
  Error: length of start is 5 should equal 4
  Backtrace:
      ▆
   1. ├─testthat::expect_warning(...) at test-contrasts.R:31:4
   2. │ └─testthat:::quasi_capture(...)
   3. │   ├─testthat (local) .capture(...)
   4. │   │ └─base::withCallingHandlers(...)
   5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
   6. └─ordinal::clm(...)
   7.   └─ordinal:::clm.fit.default(clm.struct)
   8.     └─ordinal:::set.start(...)
  
  [ FAIL 9 | WARN 0 | SKIP 0 | PASS 41 ]
  Error: Test failures
  Execution halted
Running the tests in ‘tests/test.clm.Theta.R’ failed.
Complete output:
  > library(ordinal)
  > 
  > #################################
  > ## 1 categorical variable in nominal:
  > fm <- clm(rating ~ temp, nominal=~contact, data=wine)
  Error: length of start is 9 should equal 8
  Execution halted
Running the tests in ‘tests/test.clm.convergence.R’ failed.
Complete output:
  > library(ordinal)
  > 
  > 
  > ## Testing that errors in chol() are caught soon enough:
  > cy <- with(wine, which(temp == "cold" & contact == "yes"))
  > wine2 <- subset(wine, subset=(!1:nrow(wine) %in% cy))
  > wine2[c(9, 15, 46), "rating"] <- NA
  > fm1 <- clm(rating ~ temp, scale=~contact, nominal=~contact,
  +            data=wine2)
  Warning message:
  (1) Hessian is numerically singular: parameters are not uniquely determined 
  In addition: Absolute convergence criterion was met, but relative criterion was not met 
  > fm1 <- try(clm(rating ~ temp, scale=~contact, nominal=~contact,
  +                data=wine2, control=list(gradTol=1e-12)), silent=TRUE)
  Warning message:
  (1) Hessian is numerically singular: parameters are not uniquely determined 
  In addition: Absolute convergence criterion was met, but relative criterion was not met 
  > fm2 <- try(clm(rating ~ temp, scale=~contact, nominal=~contact,
  +                data=wine2, control=list(gradTol=1e-15)), silent=TRUE)
  Warning message:
  (-1) Model failed to converge with max|grad| = 1.11481e-07 (tol = 1e-15) 
  In addition: iteration limit reached 
  > ## These gave errors in version 2014.11-12.
  > stopifnot(!inherits(fm1, "try-error"))
  > stopifnot(!inherits(fm2, "try-error"))
  > summary(fm1)
  formula: rating ~ temp
  scale:   ~contact
  nominal: ~contact
  data:    wine2
  
   link  threshold nobs logLik AIC    niter  max.grad cond.H  
   logit flexible  51   -60.44 140.87 63(39) 1.51e-13 -2.1e+16
  
  Coefficients:
           Estimate Std. Error z value Pr(>|z|)
  tempwarm    2.306         NA      NA       NA
  
  log-scale coefficients:
             Estimate Std. Error z value Pr(>|z|)
  contactyes -0.07119         NA      NA       NA
  
  Threshold coefficients:
                  Estimate Std. Error z value
  1|2.(Intercept)   -1.354         NA      NA
  2|3.(Intercept)    1.092         NA      NA
  3|4.(Intercept)    3.469         NA      NA
  4|5.(Intercept)    5.066         NA      NA
  1|2.contactyes   -30.684         NA      NA
  2|3.contactyes    -1.425         NA      NA
  3|4.contactyes    -1.808         NA      NA
  4|5.contactyes    -1.870         NA      NA
  (3 observations deleted due to missingness)
  > summary(fm2)
  formula: rating ~ temp
  scale:   ~contact
  nominal: ~contact
  data:    wine2
  
   link  threshold nobs logLik AIC    niter   max.grad cond.H 
   logit flexible  51   -60.44 140.87 111(86) 1.11e-07 1.8e+17
  
  Coefficients:
           Estimate Std. Error z value Pr(>|z|)   
  tempwarm   2.3060     0.7713    2.99  0.00279 **
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  log-scale coefficients:
               Estimate Std. Error z value Pr(>|z|)
  contactyes   -0.07126 2995.02357       0        1
  
  Threshold coefficients:
                    Estimate Std. Error z value
  1|2.(Intercept) -1.354e+00  5.707e-01  -2.373
  2|3.(Intercept)  1.092e+00  5.251e-01   2.080
  3|4.(Intercept)  3.469e+00  7.982e-01   4.346
  4|5.(Intercept)  5.066e+00  1.193e+00   4.246
  1|2.contactyes  -3.822e+01  1.282e+09   0.000
  2|3.contactyes  -1.425e+00  7.902e+03   0.000
  3|4.contactyes  -1.808e+00  1.933e+03  -0.001
  4|5.contactyes  -1.870e+00  2.665e+03  -0.001
  (3 observations deleted due to missingness)
  > 
  > ## Error in convergence.clm() due to bad evaluation of model
  > ## environment with update(object, doFit=FALSE):
  > wine3 <- wine
  > set.seed(1234)
  > wts <- runif(nrow(wine3), 0, 2)
  > fm3 <- clm(rating ~ temp + contact, data=wine3,
  +            weights=wts)
  Error: length of start is 6 should equal 5
  Execution halted
Running the tests in ‘tests/test.clm.flex.link.R’ failed.
Complete output:
  > # test.clm.flex.link.R
  > 
  > library(ordinal)
  > 
  > fm <- clm(rating ~ contact + temp, data=wine, link="log-gamma")
  Error in rep(0, NCOL(frames$S) - 1) : invalid 'times' argument
  Calls: clm -> clm.fit.default -> set.start
  Execution halted
Running the tests in ‘tests/test.clm.model.matrix.R’ failed.
Complete output:
  > library(ordinal)
  > ## source("test.clm.model.matrix.R")
  > 
  > ## library(devtools)
  > ## r2path <- "/Users/rhbc/Documents/Rpackages/ordinal/pkg/ordinal"
  > ## clean_dll(pkg = r2path)
  > ## load_all(r2path)
  > 
  > ## Check that get_clmDesign works in standard setting:
  > fm1 <- clm(rating ~ temp, scale=~contact, nominal=~contact, data=wine)
  > contr <- c(fm1$contrasts, fm1$S.contrasts, fm1$nom.contrasts)
  > XX <- ordinal:::get_clmDesign(fm1$model, terms(fm1, "all"), contrasts=contr)
  > XX2 <- update(fm1, method="design")
  > (keep <- intersect(names(XX), names(XX2)))
   [1] "y"             "y.levels"      "X"             "offset"       
   [5] "terms"         "contrasts"     "xlevels"       "weights"      
   [9] "S"             "S.terms"       "S.off"         "S.contrasts"  
  [13] "S.xlevels"     "NOM"           "nom.terms"     "nom.contrasts"
  [17] "nom.xlevels"  
  > (test <- mapply(function(x, y) isTRUE(all.equal(x, y)),
  +                 XX[keep], XX2[keep]))
              y      y.levels             X        offset         terms 
           TRUE          TRUE          TRUE          TRUE          TRUE 
      contrasts       xlevels       weights             S       S.terms 
           TRUE          TRUE          TRUE          TRUE          TRUE 
          S.off   S.contrasts     S.xlevels           NOM     nom.terms 
           TRUE          TRUE          TRUE          TRUE          TRUE 
  nom.contrasts   nom.xlevels 
           TRUE          TRUE 
  > stopifnot(all(test))
  > 
  > ## Check that get_clmDesign works with singular fit and NAs:
  > cy <- with(wine, which(temp == "cold" & contact == "yes"))
  > wine2 <- subset(wine, subset=(!1:nrow(wine) %in% cy))
  > wine2[c(9, 15, 46), "rating"] <- NA
  > fm1 <- clm(rating ~ temp, scale=~contact, nominal=~contact,
  +            data=wine2)
  Warning message:
  (1) Hessian is numerically singular: parameters are not uniquely determined 
  In addition: Absolute convergence criterion was met, but relative criterion was not met 
  > contr <- c(fm1$contrasts, fm1$S.contrasts, fm1$nom.contrasts)
  > XX <- ordinal:::get_clmDesign(fm1$model, terms(fm1, "all"), contrasts=contr)
  > XX2 <- update(fm1, method="design")
  > (keep <- intersect(names(XX), names(XX2)))
   [1] "y"             "y.levels"      "X"             "offset"       
   [5] "terms"         "contrasts"     "xlevels"       "na.action"    
   [9] "weights"       "S"             "S.terms"       "S.off"        
  [13] "S.contrasts"   "S.xlevels"     "NOM"           "nom.terms"    
  [17] "nom.contrasts" "nom.xlevels"  
  > (test <- mapply(function(x, y) isTRUE(all.equal(x, y)),
  +                 XX[keep], XX2[keep]))
              y      y.levels             X        offset         terms 
           TRUE          TRUE          TRUE          TRUE          TRUE 
      contrasts       xlevels     na.action       weights             S 
           TRUE          TRUE          TRUE          TRUE          TRUE 
        S.terms         S.off   S.contrasts     S.xlevels           NOM 
           TRUE          TRUE          TRUE          TRUE          TRUE 
      nom.terms nom.contrasts   nom.xlevels 
           TRUE          TRUE          TRUE 
  > stopifnot(all(test))
  > 
  > ## In this situation update and get_clmRho give the same results:
  > wine2 <- wine
  > fm1 <- clm(rating ~ temp + contact, data=wine2) ## OK
  Error: length of start is 6 should equal 5
  Execution halted
Running the tests in ‘tests/test.clm.predict.R’ failed.
Complete output:
  > library(ordinal)
  > ## source("test.clm.predict.R")
  > 
  > ## library(devtools)
  > ## r2path <- "/Users/rhbc/Documents/Rpackages/ordinal/pkg/ordinal"
  > ## clean_dll(pkg = r2path)
  > ## load_all(r2path)
  > 
  > cy <- with(wine, which(temp == "cold" & contact == "yes"))
  > options("contrasts" = c("contr.treatment", "contr.poly"))
  > getOption("contrasts")
  [1] "contr.treatment" "contr.poly"     
  > 
  > ## Example model
  > 
  > wine1.clm <- clm(rating ~ temp*contact, subset = -cy, data = wine)
  Error: length of start is 6 should equal 5
  Execution halted
Running the tests in ‘tests/test.clm.profile.R’ failed.
Complete output:
  > library(ordinal)
  > 
  > ## Testing that the profile remains the same - that the model object
  > ## is not 'distorted' by update(object/fitted, doFit=FALSE)
  > set.seed(1234)
  > wts <- runif(nrow(wine), 0, 2)
  > fm3 <- clm(rating ~ temp + contact, data=wine,
  +            weights=wts)
  Error: length of start is 6 should equal 5
  Execution halted
Running the tests in ‘tests/test.clm.single.anova.R’ failed.
Complete output:
  > # test.clm.single.anova.R
  > 
  > library(ordinal)
  > 
  > # WRE says "using if(requireNamespace("pkgname")) is preferred, if possible."
  > # even in tests:
  > assertError <- function(expr, ...)
  +   if(requireNamespace("tools")) tools::assertError(expr, ...) else invisible()
  > assertWarning <- function(expr, ...)
  +   if(requireNamespace("tools")) tools::assertWarning(expr, ...) else invisible()
  > 
  > fm <- clm(rating ~ temp * contact, scale=~contact, data=wine)
  > 
  > anova(fm, type="I")
  Type I Analysis of Deviance Table with Wald chi-square tests
  
               Df   Chisq Pr(>Chisq)    
  temp          1 17.1046  3.538e-05 ***
  contact       1  9.1574   0.002477 ** 
  temp:contact  1  0.1097   0.740512    
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  > anova(fm, type="II")
  Type II Analysis of Deviance Table with Wald chi-square tests
  
               Df   Chisq Pr(>Chisq)    
  temp          1 17.1046  3.538e-05 ***
  contact       1  9.1574   0.002477 ** 
  temp:contact  1  0.1097   0.740512    
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  > anova(fm, type="III")
  Type III Analysis of Deviance Table with Wald chi-square tests
  
               Df  Chisq Pr(>Chisq)   
  temp          1 9.5681    0.00198 **
  contact       1 4.1830    0.04083 * 
  temp:contact  1 0.1097    0.74051   
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  > anova(fm, type=1)
  Type I Analysis of Deviance Table with Wald chi-square tests
  
               Df   Chisq Pr(>Chisq)    
  temp          1 17.1046  3.538e-05 ***
  contact       1  9.1574   0.002477 ** 
  temp:contact  1  0.1097   0.740512    
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  > anova(fm, type=2)
  Type II Analysis of Deviance Table with Wald chi-square tests
  
               Df   Chisq Pr(>Chisq)    
  temp          1 17.1046  3.538e-05 ***
  contact       1  9.1574   0.002477 ** 
  temp:contact  1  0.1097   0.740512    
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  > anova(fm, type=3)
  Type III Analysis of Deviance Table with Wald chi-square tests
  
               Df  Chisq Pr(>Chisq)   
  temp          1 9.5681    0.00198 **
  contact       1 4.1830    0.04083 * 
  temp:contact  1 0.1097    0.74051   
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  > anova(fm, type="1")
  Type I Analysis of Deviance Table with Wald chi-square tests
  
               Df   Chisq Pr(>Chisq)    
  temp          1 17.1046  3.538e-05 ***
  contact       1  9.1574   0.002477 ** 
  temp:contact  1  0.1097   0.740512    
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  > anova(fm, type="2")
  Type II Analysis of Deviance Table with Wald chi-square tests
  
               Df   Chisq Pr(>Chisq)    
  temp          1 17.1046  3.538e-05 ***
  contact       1  9.1574   0.002477 ** 
  temp:contact  1  0.1097   0.740512    
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  > anova(fm, type="3")
  Type III Analysis of Deviance Table with Wald chi-square tests
  
               Df  Chisq Pr(>Chisq)   
  temp          1 9.5681    0.00198 **
  contact       1 4.1830    0.04083 * 
  temp:contact  1 0.1097    0.74051   
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  > anova(fm, type="marginal")
  Marginal Analysis of Deviance Table with Wald chi-square tests
  
               Df  Chisq Pr(>Chisq)   
  temp          1 9.5681    0.00198 **
  contact       1 4.1830    0.04083 * 
  temp:contact  1 0.1097    0.74051   
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  > 
  > # Nominal effects:
  > fm <- clm(rating ~ temp, nominal=~contact, data=wine)
  Error: length of start is 9 should equal 8
  Execution halted
Running the tests in ‘tests/test.makeThresholds.R’ failed.
Complete output:
  > # 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
  Error: length of start is 3 should equal 2
  Execution halted
Running the tests in ‘tests/test.sign.R’ failed.
Complete output:
  > # test.sign.R
  > 
  > # Test the use of sign.location and sign.nominal in clm.control():
  > 
  > library(ordinal)
  > 
  > fm1 <- clm(rating ~ temp + contact, data=wine)
  Error: length of start is 6 should equal 5
  Execution halted
Running the tests in ‘tests/test0weights.R’ failed.
Complete output:
  > library(ordinal)
  > options(contrasts = c("contr.treatment", "contr.poly"))
  > ## library(devtools)
  > ## r2path <- "/Users/rhbc/Documents/Rpackages/ordinal/pkg/ordinal"
  > ## clean_dll(pkg = r2path)
  > ## load_all(r2path)
  > 
  > ## one zero weight:
  > data(wine, package="ordinal")
  > wts <- rep(1, nrow(wine))
  > wine$rating
   [1] 2 3 3 4 4 4 5 5 1 2 1 3 2 3 5 4 2 3 3 2 5 5 4 4 3 2 3 2 3 2 5 3 2 3 4 3 3 3
  [39] 3 3 3 2 3 2 2 4 5 4 1 1 2 2 2 3 2 3 2 2 2 3 3 3 3 4 1 2 3 2 3 2 4 4
  Levels: 1 < 2 < 3 < 4 < 5
  > wts[1] <- 0
  > fm1 <- clm(rating ~ contact + temp, data=wine, weights=wts)
  Error: length of start is 6 should equal 5
  Execution halted
Running the tests in ‘tests/testAnova.clm2.R’ failed.
Complete output:
  > library(ordinal)
  > options(contrasts = c("contr.treatment", "contr.poly"))
  > 
  > ## More manageable data set:
  > (tab26 <- with(soup, table("Product" = PROD, "Response" = SURENESS)))
         Response
  Product   1   2   3   4   5   6
     Ref  132 161  65  41 121 219
     Test  96  99  50  57 156 650
  > dimnames(tab26)[[2]] <- c("Sure", "Not Sure", "Guess", "Guess", "Not Sure", "Sure")
  > dat26 <- expand.grid(sureness = as.factor(1:6), prod = c("Ref", "Test"))
  > dat26$wghts <- c(t(tab26))
  > m1 <- clm(sureness ~ prod, scale = ~prod, data = dat26,
  +           weights = wghts, link = "logit")
  > 
  > ## anova
  > m2 <- update(m1, scale = ~1)
  > anova(m1, m2)
  Likelihood ratio tests of cumulative link models:
   
     formula:        scale: link: threshold:
  m2 sureness ~ prod ~1     logit flexible  
  m1 sureness ~ prod ~prod  logit flexible  
  
     no.par    AIC  logLik LR.stat df Pr(>Chisq)  
  m2      6 5392.7 -2690.3                        
  m1      7 5389.5 -2687.7  5.1749  1    0.02292 *
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  > mN1 <- clm(sureness ~ 1, nominal = ~prod, data = dat26,
  +            link = "logit")
  Error: length of start is 10 should equal 9
  Execution halted
Running the tests in ‘tests/testCLM.R’ failed.
Complete output:
  > library(ordinal)
  > options(contrasts = c("contr.treatment", "contr.poly"))
  > ## library(devtools)
  > ## r2path <- "/Users/rhbc/Documents/Rpackages/ordinal/pkg/ordinal"
  > ## clean_dll(pkg = r2path)
  > ## load_all(r2path)
  > 
  > ## More manageable data set:
  > data(soup, package="ordinal")
  > (tab26 <- with(soup, table("Product" = PROD, "Response" = SURENESS)))
         Response
  Product   1   2   3   4   5   6
     Ref  132 161  65  41 121 219
     Test  96  99  50  57 156 650
  > dimnames(tab26)[[2]] <- c("Sure", "Not Sure", "Guess", "Guess", "Not Sure", "Sure")
  > dat26 <- expand.grid(sureness = as.factor(1:6), prod = c("Ref", "Test"))
  > dat26$wghts <- c(t(tab26))
  > m1 <- clm(sureness ~ prod, scale = ~prod, data = dat26,
  +           weights = wghts, link = "logit")
  > ## print, summary, vcov, logLik, AIC:
  > m1
  formula: sureness ~ prod
  scale:   ~prod
  data:    dat26
  
   link  threshold nobs logLik   AIC     niter max.grad cond.H 
   logit flexible  1847 -2687.74 5389.49 8(1)  5.09e-07 1.0e+02
  
  Coefficients:
  prodTest 
     1.296 
  
  log-scale coefficients:
  prodTest 
     0.148 
  
  Threshold coefficients:
      1|2     2|3     3|4     4|5     5|6 
  -1.4913 -0.4522 -0.1072  0.1634  0.8829 
  > summary(m1)
  formula: sureness ~ prod
  scale:   ~prod
  data:    dat26
  
   link  threshold nobs logLik   AIC     niter max.grad cond.H 
   logit flexible  1847 -2687.74 5389.49 8(1)  5.09e-07 1.0e+02
  
  Coefficients:
           Estimate Std. Error z value Pr(>|z|)    
  prodTest    1.296      0.119   10.89   <2e-16 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  log-scale coefficients:
           Estimate Std. Error z value Pr(>|z|)  
  prodTest   0.1480     0.0651   2.273    0.023 *
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Threshold coefficients:
      Estimate Std. Error z value
  1|2 -1.49126    0.09215 -16.183
  2|3 -0.45218    0.07182  -6.296
  3|4 -0.10721    0.06995  -1.533
  4|5  0.16337    0.07025   2.325
  5|6  0.88291    0.07957  11.096
  > vcov(m1)
                     1|2           2|3           3|4         4|5         5|6
  1|2       0.0084917417  0.0046258673  0.0038492096 0.003316006 0.002036170
  2|3       0.0046258673  0.0051586967  0.0044974099 0.004099300 0.003352323
  3|4       0.0038492096  0.0044974099  0.0048935739 0.004528181 0.003948048
  4|5       0.0033160059  0.0040993002  0.0045281811 0.004935721 0.004489054
  5|6       0.0020361699  0.0033523229  0.0039480481 0.004489054 0.006331523
  prodTest  0.0009111749  0.0031074167  0.0039832831 0.004738959 0.007064828
  prodTest -0.0024312129 -0.0007825923 -0.0001820514 0.000338977 0.001989991
               prodTest      prodTest
  1|2      0.0009111749 -0.0024312129
  2|3      0.0031074167 -0.0007825923
  3|4      0.0039832831 -0.0001820514
  4|5      0.0047389591  0.0003389770
  5|6      0.0070648284  0.0019899912
  prodTest 0.0141687135  0.0045752922
  prodTest 0.0045752922  0.0042385585
  > 
  > logLik(m1)
  'log Lik.' -2687.745 (df=7)
  > ll.m1 <- structure(-2687.74456343981, df = 7L, nobs = 1847,
  +                    class = "logLik")
  > stopifnot(all.equal(logLik(m1), ll.m1))
  > 
  > AIC(m1)
  [1] 5389.489
  > 
  > coef(m1)
         1|2        2|3        3|4        4|5        5|6   prodTest   prodTest 
  -1.4912570 -0.4521846 -0.1072083  0.1633653  0.8829135  1.2958776  0.1479862 
  > cm1 <- c(-1.49125702755587, -0.45218462707814, -0.107208315524318, 0.163365282774162,
  +          0.88291347877514, 1.29587762626394, 0.147986162902775)
  > stopifnot(all.equal(as.vector(coef(m1)), cm1))
  > 
  > coef(summary(m1))
             Estimate Std. Error    z value     Pr(>|z|)
  1|2      -1.4912570 0.09215065 -16.182817 6.667319e-59
  2|3      -0.4521846 0.07182407  -6.295726 3.059652e-10
  3|4      -0.1072083 0.06995408  -1.532553 1.253861e-01
  4|5       0.1633653 0.07025469   2.325329 2.005437e-02
  5|6       0.8829135 0.07957087  11.095938 1.312749e-28
  prodTest  1.2958776 0.11903241  10.886763 1.332938e-27
  prodTest  0.1479862 0.06510421   2.273066 2.302222e-02
  > csm1 <- structure(c(-1.49125702755587, -0.45218462707814, -0.107208315524318,
  + 0.163365282774162, 0.88291347877514, 1.29587762626394, 0.147986162902775,
  + 0.0921506468161812, 0.0718240681909781, 0.069954084652323, 0.0702546879687391,
  + 0.0795708692869622, 0.119032405993894, 0.065104213008022, -16.1828167145758,
  + -6.2957256316336, -1.53255261729392, 2.32532927691394, 11.0959385851501,
  + 10.8867632762999, 2.27306584421104, 6.66732036748908e-59, 3.05965144996025e-10,
  + 0.125386123756898, 0.0200543599621069, 1.31274723412040e-28,
  + 1.33293711602276e-27, 0.0230222123418036), .Dim = c(7L, 4L), .Dimnames = list(
  +     c("1|2", "2|3", "3|4", "4|5", "5|6", "prodTest", "prodTest"
  +     ), c("Estimate", "Std. Error", "z value", "Pr(>|z|)")))
  > stopifnot(all.equal(coef(summary(m1)), csm1))
  > 
  > ## link functions:
  > m2 <- update(m1, link = "probit")
  > m3 <- update(m1, link = "cloglog")
  > 
  > m4 <- update(m1, link = "loglog")
  > m5 <- update(m1, link = "cauchit", start = coef(m1))
  > ## m6 <- update(m1, link = "Aranda-Ordaz", lambda = 1)
  > ## m7 <- update(m1, link = "Aranda-Ordaz")
  > ## m8 <- update(m1, link = "log-gamma", lambda = 1)
  > ## m9 <- update(m1, link = "log-gamma")
  > ## nominal effects:
  > mN1 <- clm(sureness ~ 1, nominal = ~ prod, data = dat26,
  +            weights = wghts)
  Error: length of start is 10 should equal 9
  Execution halted