[R] coef and vcoc for polr inconsistent??

BXC (Bendix Carstensen) bxc at steno.dk
Sat Jun 5 21:51:14 CEST 2004


Is the following an inconsistency, programming glitch or a feature? 
One would expect that vcov(obj) was the variance-covariance of
coef(obj), 
but apparently this is not the case for polr objects:

> x <- rnorm( 100 )
> y <- rnorm( 100 )
> ff <- factor( sample( 1:4, 100, replace=T ) )
> pm <- polr( ff ~ x + y )
> coef( pm )
         x          y 
0.21219010 0.03558506 
> vcov( pm )

Re-fitting to get Hessian

               x            y          1|2          2|3          3|4
x    0.033462790 -0.002414745 -0.006183451 -0.004164503 -0.001585546
y   -0.002414745  0.032953020  0.003821232  0.003645342  0.003756031
1|2 -0.006183451  0.003821232  0.060134608  0.029651508  0.018105699
2|3 -0.004164503  0.003645342  0.029651508  0.041604224  0.025465751
3|4 -0.001585546  0.003756031  0.018105699  0.025465751  0.051576286

But of course you CAN get wat you want:

> summary( pm )$coef

Re-fitting to get Hessian

          Value Std. Error    t value
x    0.21219010  0.1829284  1.1599628
y    0.03558506  0.1815297  0.1960289
1|2 -1.29481930  0.2452236 -5.2801580
2|3 -0.22054056  0.2039711 -1.0812342
3|4  0.98703785  0.2271041  4.3461907

> version
         _              
platform i386-pc-mingw32
arch     i386           
os       mingw32        
system   i386, mingw32  
status                  
major    1              
minor    9.0            
year     2004           
month    04             
day      12             
language R       


----------------------
Bendix Carstensen
Senior Statistician
Steno Diabetes Center
Niels Steensens Vej 2
DK-2820 Gentofte
Denmark
tel: +45 44 43 87 38
mob: +45 30 75 87 38
fax: +45 44 43 07 06
bxc at steno.dk
www.biostat.ku.dk/~bxc




More information about the R-help mailing list