[R] bugs and misfeatures in polr(MASS).... fixed!

tjb timothy.benham at uqconnect.edu.au
Sat Nov 6 23:12:46 CET 2010


Note that that the enhancements in my original post solve the unresolved
problem of Chaehyung Ahn (22 Mar 2005) whose data I reproduce:

y,x,lx
0,3.2e-02,-1.49485
0,3.2e-02,-1.49485
0,1.0e-01,-1.00000
0,1.0e-01,-1.00000
0,3.2e-01,-0.49485
0,3.2e-01,-0.49485
1,1.0e+00,0.00000
0,1.0e+00,0.00000
1,3.2e+00,0.50515
1,3.2e+00,0.50515
0,1.0e+01,1.00000
1,1.0e+01,1.00000
1,3.2e+01,1.50515
2,3.2e+01,1.50515
2,1.0e+02,2.00000
1,1.0e+02,2.00000
2,3.2e+02,2.50515
1,3.2e+02,2.50515
2,1.0e+03,3.00000
2,1.0e+03,3.00000

Using the MASS version we get

> ahn$y<-as.factor(ahn$y)
> summary(polr(y~lx,data=ahn))

Re-fitting to get Hessian

Error in optim(s0, fmin, gmin, method = "BFGS", hessian = Hess, ...) : 
  initial value in 'vmmin' is not finite

Whereas,

> source('fixed-polr.R')
> summary(polr(y~lx,data=ahn))

Re-fitting to get Hessian

Call:
polr(formula = y ~ lx, data = ahn)

Coefficients:
   Value Std. Error t value
lx 2.421     0.8146   2.971

Intercepts:
    Value  Std. Error t value
0|1 0.5865 0.8118     0.7224 
1|2 4.8966 1.7422     2.8106 

Residual Deviance: 20.43286 
AIC: 26.43286 

-- 
View this message in context: http://r.789695.n4.nabble.com/bugs-and-misfeatures-in-polr-MASS-fixed-tp3024677p3030411.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list