Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

llnull with exposure ? #1221

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

Comments

Projects
None yet
2 participants
@josef-pkt
Copy link
Member

commented Dec 10, 2013

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

This comment has been minimized.

Copy link
Member Author

commented Dec 10, 2013

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

This comment has been minimized.

Copy link
Member

commented Dec 10, 2013

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

@jseabold

This comment has been minimized.

Copy link
Member

commented Dec 10, 2013

If you have a test handy that would be helpful.

@josef-pkt

This comment has been minimized.

Copy link
Member Author

commented Dec 10, 2013

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

This comment has been minimized.

Copy link
Member Author

commented Apr 20, 2014

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

josef-pkt added a commit to josef-pkt/statsmodels that referenced this issue Apr 20, 2014

@josef-pkt josef-pkt closed this in 52e628f Apr 21, 2014

PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014

PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this issue Sep 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.