Repository navigation
GEE rebased and cleaned - #1215
Conversation
|
@josef-pkt you write "@vincentarelbundock see the test cases, from_formula works by inheritance.." I'm not sure exactly how this works. Do you mean we don't have to have explicit tests for formulas inside the test_gee.py file? |
|
I'm not sure what I meant, maybe I misinterpreted something #928 (comment) looks like a good idea. We should have some basic test that the formula interface, from_formula, works correctly in this case. That's just a generic answer, I try to look at it later today. (Right now I'm struggling to get some test results out of Stata for kernel regression.) |
|
I'm trying to write an example, and can't figure out why I get different results in R and SM. These two models in R give identical coefficient estimates, but not in SM. Any ideas? |
|
My first impression is that I don't see why they should give the same results. Based on the SUR analog, only if all the explanatory variables are the same in each equation/cross-sectional unit/group, then SUR ( Can you try another correlation structure? |
|
I couldn't immediately find an easy analogue between R's I will also need to read more on GEE generally, but in the meantime, I note that Table 6 of this paper shows identical coefficients for Exchangeable and Independence: |
|
And the plot thickens. Stata produces different coefficient estimates under independence and exchangeability, but those estimates are different than ours: |
|
I'm still suspicious about the geepack result. Does unstructured work in our GEE with unbalanced clusters/panel? (Stata doesn't IIRC the documentation) 'exchangeable' could be verified also with Stata, I guess. Given your time constraint, it might be better to let Kerby or me worry about this. @kshedden Do you know if there are special cases where "exchangeable" and "independent" produces the same coefficient estimates? |
|
Good about the Stata results. That's much better (that they get different results between the two corr structures.) My guess is that there still might be options or default differences. Our GEE summary doesn't show the estimated parameters for correlation and variance.
|
|
I forgot about the different position of the constant when I compared your notebook with your Stata results. (bug in geepack ?) (*) standard errors in Stata are quite different, my best guess, given my experience matching sandwiches with Stata, is small sample correction. But I don't remember whether our GEE doesn't use bias corrected by default. I didn't read anything about bias correction for vce in Stata AFAIR. |
|
I would like to do more comparisons with Stata, but at this point, all my However the other covariance structures are not as clearly defined. I had I'll have more time to look into this starting in about two weeks. Kerby On Sat, Dec 14, 2013 at 10:25 PM, Josef Perktold
|
|
@josef-pkt I also looked at the wrong rows! It looks like our results agree with Stata very well. When I ask Stata to produce robust standard errors, those match up quite well too! wrt R, I don't know. The |
|
That looks pretty good, Thanks Vincent. Are the Stata commands the ones from you previous message xtgee ....? This time I will really merge this, so we get it in master before Christmas. I just need to get some smaller PR in first. Then it's GEE and IV/GMM as a present for Christmas or any other end of year celebration. |
|
Yes, start with: And then: |
|
I mean "NO". Not quite the same commands since I added |
There was a problem hiding this comment.
our standard name is start_params in discrete and others
|
Looks good to me, merging Thanks Vincent |
STY/ENH GEE mostly code style, add to formula.api
|
Alright then, didn't expect it to go through right away :) I'll try to cook up a Notebook example pretty soon and I'll make a new PR for that. |
Made most of the minor fixes suggested by @josef-pkt on #928
Please leave a comment so I can add to this todo list: