Skip to content

Fix weights - #504

Merged
jseabold merged 10 commits into
statsmodels:masterfrom
jseabold:fix-weights
Oct 5, 2012
Merged

jseabold merged 10 commits into
statsmodels:masterfrom
jseabold:fix-weights

Conversation

@jseabold

@jseabold jseabold commented Oct 4, 2012

Copy link
Copy Markdown
Member

I've left the incorrect GLS results in there for now. Addresses #501.

@josef-pkt

Copy link
Copy Markdown
Member

do you have scripts for R and Stata, so it's easier to figure out which models were used for comparison?

I a first read through the changes I didn't see any problems with this, but I would like to verify some parts.

@jseabold

jseabold commented Oct 4, 2012

Copy link
Copy Markdown
Member Author

The only actual code changes were the centered_tss and the likelihood in WLS. The rests are tests. The tests should have the commands in them that I executed. Ie., for stata

insheet using "/home/skipper/statsmodels/statsmodels/statsmodels/datasets/ccard/ccard.csv", double clear
reg avgexp age income incomesq ownrent [aw=1/incomesq]
eret list
mata
V = st_matrix("e(V)")
se = diagonal(V):^0.5
se'
end
estat ic
mat list r(S), nonames format(%16.12g)

Similar story for R, I just cd to the ccard directory and it's 4-5 lines of code.

@josef-pkt

Copy link
Copy Markdown
Member

I read up on the stata documentation (aweights).
Given that R and Stata calculate the tss and rsquared this way, go ahead and merge.

I don't quite understand what the interpretation of this is.
I'm fine with leaving GLS as is, and figure it out when we work on subclasses of GLS again.

jseabold added a commit that referenced this pull request Oct 5, 2012
@jseabold
jseabold merged commit d587df8 into statsmodels:master Oct 5, 2012
PierreBdR pushed a commit to PierreBdR/statsmodels that referenced this pull request Sep 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants