Repository navigation
Conversation
| df : float64 | ||
| Degress of freedom for model terms. | ||
| test statistic : float64 | ||
| Name dependens on selected test statistic. Returns test statistic |
There was a problem hiding this comment.
maybe something
The column name is either "F" or "chi2" depending on whether the F-statistic or the chisquare-statistic is used in computing the p-value.
I don't have an example right now to check how chisquare is spelled in the column name.
There was a problem hiding this comment.
Possible values for test are as follows:
test : str {"F", "Chisq", "Cp"} or None
Value of the statistic column and Pvalue column return exactly those inputs.
Possible Alternative for docstring:
...
{'F','Chisq','CP'} : float64
....
PR(>{'F','Chisq','CP'}) : float64
There was a problem hiding this comment.
I briefly browsed the code and it seems to me only "F" is implemented. (I don't even know what Cp stands for.
I would also prefer if the header/title for the column in the docstring were the same as the pandas column name. But none of the formats look really convincing to me and I don't have much of a preference.
PR(>{'F','Chisq','CP'}) : float64
looks more difficult to interpret than the full list, althout it's shorter, e.g.
PR(>F), P(>Chisq) or P(>CP)
There was a problem hiding this comment.
You are correct...You can enter the Chisq or CP but it only returns 0.0 because only the 'F' actually makes anything calculate. (no errors or warnings are returned) Only clue is that P-value and test statistic is 0.0.
CP probably refers to Mallows Cp (never heard of it until today):
http://rafalab.github.io/pages/754/section-09.pdf
I too like the easy to read version. I will add a see notes in the parameters that 'F' is the only implemented test until that functionality can be added later vs removing that parameter from the input.
There was a problem hiding this comment.
I think it would be easier for now to just use the "F" version in the description of the DataFrame, which will be much easier.
In this case I don't see an advantage of documenting a return that never shows up in a meaningful way.
…oved lmap import not otherwise used
Codecov Report
@@ Coverage Diff @@
## master #5233 +/- ##
=========================================
- Coverage 81.7% 81.7% -0.01%
=========================================
Files 569 569
Lines 89628 89626 -2
Branches 10022 10025 +3
=========================================
- Hits 73227 73225 -2
+ Misses 14131 14130 -1
- Partials 2270 2271 +1
Continue to review full report at Codecov.
|
| try: | ||
| assert typ in [1,"I"] | ||
| except: | ||
| if typ not in [1,"1"]: |
There was a problem hiding this comment.
Did this change upper-case-i to “1” intentionally? Nitpick: Space after comma pls.
There was a problem hiding this comment.
Thank you for that catch...I typoed that "1" in there. Fixed the spacing.
| anova : DataFrame | ||
| A DataFrame containing. | ||
| When args is a single model, DataFrame contains. | ||
| sum_sq : float64 |
There was a problem hiding this comment.
should be float if scalar, not a numpy type.
There was a problem hiding this comment.
Thanks for the comment, and the initial work you did about a year ago. Helped me get started on enhancing this docstring.
Unless I am understanding this incorrectly float64 will always return for every column. I even tried a one item model based on the example in the docstring.
>>> moore_lm = ols('conformity ~ fscore', data=data).fit()
>>> table = sm.stats.anova_lm(moore_lm,typ=2)
>>> print(table)
sum_sq df F PR(>F)
fscore 0.134511 1.0 0.004784 0.945179
Residual 1209.065489 43.0 NaN NaN
>>> table.dtypes
sum_sq float64
df float64
F float64
PR(>F) float64
dtype: object
There was a problem hiding this comment.
I see, each is a vector. So maybe DataFrame with columns: ?
There was a problem hiding this comment.
Added some clarity about the columns being returned.
commit 2e9cf7c
|
LGTM |
|
final version looks good to me @jtweeder Can you squash this into one commit? |
further pythonic cleansing, removed lmaps in place of list comps, removed lmap import not otherwise used docstring changed to the only version that returns useful information the f-test docstring change for multimodel anova, left off last commit. fixing typo and correcting spacing Futher clarity of dataframes returned.
|
@josef-pkt I tried but apparently failed...as it now says i added two more commits..Sorry about that apparently I need more help than I anticipated. Hopefully I did not screw it up too much. Thanks. |
|
no problem I will fix it with an interactive rebase (hopefully within a few hours) |
|
Fixed version in #5246 |
|
Basically you should have done and then in the dialog that pops up you should have changed it to and then run the rebase. You then get to provide a final commit message for all commits. |
|
Thanks for that...I will give that a run on my personal repos so it wont be so messy next time. |
|
What I usually did, and still sometimes do for complicated git surgery, is to create a local temporary branch to try out whether the git rebase works correctly, and then either push the temporary branch to the right remote branch or redo the rebase on the original branch. |
|
You can also just try push the last commit to origin/BRANCH-NAME, and try and rebase, and if it does wrong, git reset --hard origin/BRANCH-NAME to revert right before the rebase. |
Hopefully this is presented in a clean enough way to show what is in the two possible dataFrames that can be returned by anova_lm
Closes #3306