casallas/ordinal

drop and dropterm don't work if model was estimated with starting values

casallas opened this issue · 1 comments

With dropterm (clm2/clmm2)

library(MASS)
w.clm <- clm2(rating ~ temp + contact, data = wine)
w.clm2 <- clm(rating ~ temp + contact, data = wine, start = coef(w.clm))
dropterm(w.clm2)

yields

Error in clm2(location = rating ~ contact, data = wine, start = coef(w.clm)) : 
  'start' is not of the correct length

likewise with drop1 (clm/clmm)

w.clm1 <- clm(rating ~ temp + contact, data = wine, start = coef(w.clm))
drop1(w.clm1)

yields

Error: length of start is 6 should equal 5

Apparently the error comes from update

w.clm <- clm2(rating ~ temp + contact, data = wine)
w.clm2 <- clm(rating ~ temp + contact, data = wine, start = coef(w.clm))

clm2/clmm2

update(w.clm2, location = . ~ . - contact)

yields

Error in clm2(location = rating ~ temp, data = wine, start = coef(w.clm)) : 
  'start' is not of the correct length

likewise clm/clmm

w.clm1 <- clm(rating ~ temp + contact, data = wine, start = coef(w.clm))
update(w.clm1, formula = . ~ . - contact)

yields

Error: length of start is 6 should equal 5