llnull with exposure ? #1221

Closed
josef-pkt opened this Issue Dec 10, 2013 · 5 comments

Projects

None yet

2 participants

@josef-pkt
Member

question: Should the null model for llnull in count models also include exposure?

It doesn't currently

    def llnull(self):
        model = self.model
        #TODO: what parameters to pass to fit?
        null = model.__class__(model.endog, np.ones(self.nobs)).fit(disp=0)
        return null.llf

I'm trying to write the equivalent Wald test.

@josef-pkt
Member

Looks like a bug.

From running an example, Stata looks like is using exposure in the ll-null, while in statsmodels ll-null is unchanged when we add exposure

@jseabold
Member

Intuitively, I'd say yes, this is a bug.

@jseabold
Member

If you have a test handy that would be helpful.

@josef-pkt
Member

I will have a test case later in my next robust cov PR. plus the Wald test addition #1104
right now I'm using the ships data from xtpoisson
"We have data on the number of ship accidents for five different types of ships (McCullagh and Nelder 1989, 205)."

If we want to fix it fast, for 0.5.1, then we could maybe reuse a current test case.

@josef-pkt
Member

Problem with exposure: we don't store "exposure" we store log(exposure)

@josef-pkt josef-pkt added a commit to josef-pkt/statsmodels that referenced this issue Apr 20, 2014
@josef-pkt josef-pkt TST: add failing test, bug #1221 cf79587
@josef-pkt josef-pkt closed this in 52e628f Apr 21, 2014
@PierreBdR PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014
@josef-pkt josef-pkt TST: add failing test, bug #1221 3346d72
@PierreBdR PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014
@josef-pkt josef-pkt REF/ENH: add `_init_keys` to recreate model closes #1221 closes #1609 3f56e32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment