[R] Exact logistic regression, data frame issue

peter dalgaard pdalgd at gmail.com
Sat Jan 11 22:43:20 CET 2014


On 11 Jan 2014, at 19:09 , Razi Zaidi <razizaidi at doctors.org.uk> wrote:

> Hi there
> 
> I have the dataframe below saved in an object /tst/
> 
> agegrp bmigrp   pep     n
> 1      1      a         0       2
> 2      2      a         0       2
> 3      3      a         0       0
> 4      1      b         0      47
> 5      2      b         0      43
> 6      3      b         0      31
> 7      1      c         0     200
> 8      2      c         1     152
> 9      3      c         2     137
> 
> When i run Exact Logistic regression analysis:
> 
> elrm (formula = pep/n ~ bmigrp, interest = ~ bmigrp, iter = 22000,  dataset
> = tst, burnIn = 5000)
> 
> I get the following error:
> 
> *Error in data.frame(..., check.names = FALSE) :
>  arguments imply differing number of rows: 9, 8*
> 
> I was wondering if anyone knew what i was doing wrong.

Well, it's a contributed package, which presumably has a maintainer, but a little debugging suggests that line 3 gets zapped in the calculation of design.frame. Presumably it isn't happy with n=0.

Passing dataset=test[-3,] makes something happen.

-pd


-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com




More information about the R-help mailing list