Repository navigation
Conversation
|
This pull request introduces 8 alerts when merging ccead19 into 3876fad - view on LGTM.com new alerts:
|
ccead19 to
5051fb8
Compare
|
Hello @josef-pkt! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2020-06-03 21:02:40 UTC |
|
This pull request introduces 8 alerts when merging 5051fb8 into 3876fad - view on LGTM.com new alerts:
|
|
most likely there are still some bugs, e.g. df in anova_welsh looks wrong (too small in a simple example) some quick checks with an unbalanced example OLS nonrobust f_test and one-way anova completely agree OLS HC2 f_test and anova_welch have large differences. update anova_welch results look strange but correct |
5051fb8 to
81493af
Compare
Codecov Report
@@ Coverage Diff @@
## master #6526 +/- ##
==========================================
+ Coverage 85.22% 85.24% +0.01%
==========================================
Files 643 650 +7
Lines 103178 104108 +930
Branches 11236 11345 +109
==========================================
+ Hits 87932 88745 +813
- Misses 12798 12889 +91
- Partials 2448 2474 +26
Continue to review full report at Codecov.
|
|
This pull request introduces 8 alerts when merging 81493af into 3876fad - view on LGTM.com new alerts:
|
|
some problems in verifying the trim functions against R WRS2 var_winsorized is likely wrong (and might have mixed in computation for std_mean_trimmed
WRS2 uses another problem is desired fraction to cut is not the actual fraction to cut because of integer rounding/truncation e.g. in the WRS2 vignette example, fraction to trim is 0.1, we trim one observation on each side which is 1/19 (AFAIR, I didn't look at WRS2 or the book of Wilcox when I wrote my versions, but I used several articles by Wilcox as reference) The code also has a comment I guess, I don't want to match WRS2 in some of the results. The difference in update workaround for unit test for integer trimming, use trimming fraction that corresponds to integer number of observations, eg fraction=1/19 this still leaves the difference in the sqrt for std_mean_trimmed |
|
:( another one Medcalc |
|
R psych and WRS2 don't agree on winsorized statistics Does psych do interpolation for fractional observations? |
|
a quick monte carlo And it's essentially the same if I use non-integer truncation fraction If we want to do a "bias" correction, i.e. change df, then it would have to be proportional to nobs and nobs_reduced, i.e. correct something like 5 or 6 % update maybe the sqrt in Wilcox helps (but I use actual trimming fraction) cross-check: |
|
Ok, given that Wilcox version of sqrt works better in the MC: Wilcox, Rand R. 2012. Introduction to Robust Estimation and Hypothesis Testing. 3rd ed. Statistical Modeling and Decision Science. Amsterdam ; Boston: Academic Press. |
|
aside: the another aside: Wilcox briefly mentions trimming based on interpolation. There was also an old R-help question why R base mean trimming doesn't interpolate. I will stick with integer trimming, that's simpler, and used in most references that I looked at a long time ago (AFAIR) |
|
I don't have a trimmed variance function, and neither does WRS2. chemometrics in R has WRS2 lists under the mean(self, 0.1) ## .10 trimmed mean Huber are in statsmodels.robust |
|
and another problem, standard error of winsorized mean has currently a term under sqrt, that WRS2 has outside to match WRS2, I need What's "an old SAS manual page, simplified"? Bugs, or computed under different assumptions or approximations? |
|
chasing R functions and packages is a bit tiresome One sample trimmed t-test |
81493af to
254e265
Compare
|
This pull request introduces 9 alerts when merging 254e265 into 3876fad - view on LGTM.com new alerts:
|
|
and it continues with anova problems running my anova_welch, I get the same Satterthwaite df as WRS2, but the test statistic and p-value differ :( Also, AFAICS, in the vignette appendix Yuen/Welch standard deviation for the mean diff don't just use the std of individual trimmed means, aside: the example that I use from the WRS2 docs is balanced, so the only difference between Welch and standard anova is in the degrees of freedom. |
|
R is sooo nice, I found another package My welch test, agrees (at 1e-16) with those R packages when there is not trimming, also in unbalance sample case. The 3 R packages agree with each other when there is trimming. |
|
what's the difference between anova_bfm and anova_welch? However, levene with trimmed mean as center, doesn't do any further trimming and uses standard anova. In Yuen, trimmed anova we use the properties of the trimming and order statistics to compute the std_mean_trimmed (e.g. use var_winsorized and not regular var). I guess, using levene with trimmed mean and trimming in anova does double trimming.
Maybe: And we haven't even added Kruskal yet in the mix, i.e. rank_transformed data. |
|
more info on Welsh ANOVA: OLS HC2 agrees with welch t-test and Welch Anova in two sample case Welsh correction factor is 1, i.e. no effect, in two sample case. It only corrects when we have 3 or more samples. That's why Welch two sample t-test is the same as HC2 Welsh 1951 refences James 1951 which has higher order expansion and correction for the heteroscedastic ANOVA. Welch corresponds to the first higher order expansion. the following article compares bootstrap with Welch and James second order expansion |
|
And now the question is whether the variation with different transformation (trimmed, variane/Levene-Welch, equivalence Wellek-Welch) use the same correction factor that james/Welch derived for the standard mean comparison. At least my trimmed Yuen-Welch doesn't match up with Yuen-Welsh in R, so some correction factor differs. (I will add an extra option to Welch type anova to compute the HC2 solution, i.e. unequal var, but no Welch/Satterthwaite correction.) |
|
A pain, two hours debugging because I had forgotten about a typo in a NCSS dataset. I have some test cases in 1 or 2 month old notebook According to that notebook, the following is similar Bartlett test for equality of variances, but pvalue doesn't match exactly, maybe F versus chisquare problem aside: I don't remember if I have this already somewhere. |
|
This pull request introduces 12 alerts when merging 9fbbcdf into 0551e89 - view on LGTM.com new alerts:
|
|
transformation for oneway scale test: abs is in Levene BF brief search Md. Khairul Islam TRANSFORMED TESTS FOR HOMOGENEITY OF VARIANCES AND MEANS aside: this is now generic anova with transformed data. testing variance is just a special case. Also, center can no be a number. Trivial case is setting it to |
|
This pull request introduces 12 alerts when merging 7f127f0 into d4d46c8 - view on LGTM.com new alerts:
|
|
There are still some workflow problems, when I want to do more with oneway analysis. side objective: I'm trying to get noncentrality and requirements for power analysis out of (OLS) Results instance from models and compare with standalone |
|
and I'm getting confused again: When do we divide by for power we use scaled nc / nobs, but f2 from f_stat is dividing by df_resid. also a bit annoying: |
|
inconsistency between two functions
|
|
This pull request introduces 12 alerts when merging 2e5f7f2 into 856385a - view on LGTM.com new alerts:
|
|
This pull request introduces 12 alerts when merging 68a6d27 into b19df42 - view on LGTM.com new alerts:
|
|
I still need to check Steiger again to see what denominator effect size confint use. |
|
It looks messy to validate my confint for effect size with R package MBESS produces the same eta2 confint as I have. My original unit test verify with an example from Steiger, but that covers only parts of confint function package sjstats just calls package effectsize, identical results at all decimals package groupstats also takes model object Lakens spss http://daniellakens.blogspot.com/2014/06/calculating-confidence-intervals-for.html |
|
I had forgotten about Stata.
looks like between Stata 14 (that I have) and docs of Stata 16 |
|
This pull request introduces 11 alerts when merging 0e09510 into ee9f5c0 - view on LGTM.com new alerts:
|
|
robust_descriptive.py is only added in the first commit, no changes to it in other commits so I can just drop that commit to remove it |
|
vectorized for adding effectsize and confint to, e.g.,
confint_effectsize_oneway breaks with shape mismatch when calling special function for ncF inversion. requires broadcasting with column vector, and numpy broad casting and extra dimension for confint bounds will not easily work with pandas. not clear to me: Even |
|
a bit of sightseeing on github two applications with anova https://github.com/sunshineDrizzle/CommonTools/blob/master/commontool/stats.py |
|
temporary storage, for udocstring |
This is a rebased version of my old branch, updated to run with Python 3
master...josef-pkt:stats_robust
see #6459
I moved the examples from
__main__to the test module as a smoke tests.