You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ENH: effect size and power based on test statistic for other distribution #6983
I added power and effect size computation based on F-statistic in oneway PR #6789
We should be able to do the same for other distributions, t-test, chisquare and normal.
Confidence intervals can be obtained through the noncentrality parameter inversion.
For t-test and z-test the effect size will be a variant on cohen's d.
chisquare would also produce something like cohen's f_squared
Under correctly specified MLE assumptions, those might be standard (the usual) effect sizes.
With robust cov_type, Welch, ..., we will get an adjusted version. in analogy to Welch oneway anova based on F-statistic.
for chisquare: estimating non-centrality parameter and confidence interval for it.
one recommended estimator seems to be nc = max(chi2 - df, 0)
Note: I didn't use the bias correction for f2 noncentrality and related effect sizes.
see comments about different eta, omega for that. psychology literature mostly doesn't truncate infeasible negative nc
(in oneway/anova PR ?)
The functions in oneway for this are messy. I cannot figure out quickly which function does what.
maybe combine in one function:
estimate nc from test statistic and df
get confint for nc
convert to the corresponding common effect sizes (nc/nobs and variants )
aside: for nc-chi2 the truncated unbiased estimate for nc max(chi2_stat - df, 0) or some variant like max(chi2_stat - df, chi2_stat / (df + 1) (Li et al 2009) looks best Li et al version has better MSE for larger nc and doesn't have mass point at zero.
For ncf, I didn't like the literature for bias corrected nc estimate, but I should add it I guess. (I haven't checked the serious stats literature for it.)
One problem with (no) bias is that it doesn't survive nonlinear transformation, e.g. going from f2 to eta2. Median would be preserved but I haven't seen that in any of the related literature.
question (I haven't tried yet):
If chi2_stat - df < 0, is the truncated nc=0 outside the interval that we compute by inverting nc-chi2 cdf?
The lower confidence bound might approximate zero, i.e. low_nc is an epsilon < 1e-20.
according to this, mean of nct is close but not equal to nc parameter.
Note, in contrast to nc-chi2 and nc-F, the nc in nc-t can be negative.
aside: the gamma values are huge 1e60, so using gammaln would be better, i.e. np.exp(special.gammaln(df/2.-0.5) - special.gammaln(df/2.))
update
The nct case is in Hedges 1981 on standardized mean diff effect size
AFAICS (not verified yet), c11 above is the same as the bias correction factor c(m) in Hedges. stats.meta_analysis uses the normal approximation to nct.
Activity
josef-pkt commentedon Oct 2, 2020
for chisquare: estimating non-centrality parameter and confidence interval for it.
one recommended estimator seems to be nc = max(chi2 - df, 0)
Note: I didn't use the bias correction for f2 noncentrality and related effect sizes.
see comments about different eta, omega for that. psychology literature mostly doesn't truncate infeasible negative nc
(in oneway/anova PR ?)
usage of nc of chi2 for Hosmer-lemeshow chisquare test in
Nattino, Giovanni, Michael L. Pennell, and Stanley Lemeshow. 2020. “Assessing the Goodness of Fit of Logistic Regression Models in Large Samples: A Modification of the Hosmer-Lemeshow Test.” Biometrics 76 (2): 549–60. https://doi.org/10.1111/biom.13249.
refer for nc and interval estimation to
Kent, John T., and Timothy J. Hainsworth. 1995. “Confidence Intervals for the Noncentral Chi-Squared Distribution.” Journal of Statistical Planning and Inference 46 (2): 147–59. https://doi.org/10.1016/0378-3758(94)00104-4.
there is a related literature for admissible (non-dominated quadratic risk) estimators for nc
e.g., but there are more
Kubokawa, T., C.P. Robert, and A.K.Md.E. Saleh. 1993. “Estimation of Noncentrality Parameters.” Canadian Journal of Statistics 21 (1): 45–57. https://doi.org/10.2307/3315657.
Saxena, K. M. Lal, and Khursheed Alam. 1982. “Estimation of the Non-Centrality Parameter of a Chi Squared Distribution.” Annals of Statistics 10 (3): 1012–16. https://doi.org/10.1214/aos/1176345892.
Li, Qizhai, Junjian Zhang, and Shuai Dai. 2009. “On Estimating the Non-Centrality Parameter of a Chi-Squared Distribution.” Statistics & Probability Letters 79 (1): 98–104. https://doi.org/10.1016/j.spl.2008.07.025.
josef-pkt commentedon Oct 5, 2020
for test cases
Code for a short online book with a chapter on confint for noncentrality parameter of nct, nc-chi2, ncf.
This should be good for test cases at a few digits precision.
http://www.michaelsmithson.online/stats/CIstuff/Splusnonc.pdf
scipy.special precision is higher in round tripping
I need a collection of functions for this, eg. https://www.statsmodels.org/dev/generated/statsmodels.stats.oneway.confint_noncentrality.html and similar in oneway
The functions in oneway for this are messy. I cannot figure out quickly which function does what.
maybe combine in one function:
aside: for nc-chi2 the truncated unbiased estimate for nc
max(chi2_stat - df, 0)or some variant likemax(chi2_stat - df, chi2_stat / (df + 1)(Li et al 2009) looks best Li et al version has better MSE for larger nc and doesn't have mass point at zero.For ncf, I didn't like the literature for bias corrected nc estimate, but I should add it I guess. (I haven't checked the serious stats literature for it.)
One problem with (no) bias is that it doesn't survive nonlinear transformation, e.g. going from f2 to eta2. Median would be preserved but I haven't seen that in any of the related literature.
question (I haven't tried yet):
If chi2_stat - df < 0, is the truncated nc=0 outside the interval that we compute by inverting nc-chi2 cdf?
The lower confidence bound might approximate zero, i.e. low_nc is an epsilon < 1e-20.
josef-pkt commentedon Oct 5, 2020
umvue for ncF
based on
Kubokawa, T., C.P. Robert, and A.K.Md.E. Saleh. 1993. “Estimation of Noncentrality Parameters.” Canadian Journal of Statistics 21 (1): 45–57. https://doi.org/10.2307/3315657.
they also have noncentrality for OLS statistic
their improved estimators for nc for ncf
where nc_0 is the umvue above
truncated
max(nc_0, 0)and
max(nc_0, 2 * (df2 - 2) / (df1 + 2) * (x/s)josef-pkt commentedon Oct 5, 2020
for nct
confint
I haven't found a reference for an estimate for nc from t-stat yet
reverse engineering from
scipy.stats.nct.meanwhich has explicit computation for meansolving
E(y_nct | n_ct) = t_statforn_ctaccording to this, mean of nct is close but not equal to nc parameter.
Note, in contrast to nc-chi2 and nc-F, the nc in nc-t can be negative.
aside: the gamma values are huge 1e60, so using gammaln would be better, i.e.
np.exp(special.gammaln(df/2.-0.5) - special.gammaln(df/2.))update
The nct case is in Hedges 1981 on standardized mean diff effect size
AFAICS (not verified yet),
c11above is the same as the bias correction factorc(m)in Hedges.stats.meta_analysisuses the normal approximation to nct.