casallas / ordinal

git mirror of Rune Haubo Christensen's ordinal package (https://r-forge.r-project.org/scm/viewvc.php/pkg/ordinal/?root=ordinal)
Other
0 stars 0 forks source link

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

Open casallas opened 10 years ago

casallas commented 10 years ago

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
casallas commented 10 years ago

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