rank_biserial(paired = TRUE): the confidence interval counts x != mu instead of the nonzero paired differences
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 85/100
Direzione di ricerca
Inizia da R/rank_diff.R, intorno alla riga 179, e leggi il calcolo dell’intervallo di confidenza in rank_biserial() insieme alla gestione esistente delle differenze non nulle in .r_rbs(). Controlla i test esistenti per rank_biserial() e aggiungi un caso di regressione usando dati appaiati con differenze nulle. Il lavoro è completato quando l’intervallo di confidenza della chiamata appaiata corrisponde a quello della chiamata a un campione sulle differenze.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Describe the bug
For paired samples, rank_biserial() computes the estimate from the paired differences (x - y) - mu, but the standard error of its confidence interval takes the number of observations from x alone:
nd <- sum((x - mu) != 0)
(R/rank_diff.R, line 179 on main; the same in 1.0.3 on CRAN). In the paired case x and y are still separate vectors at that point, so nd counts the values of x that differ from mu, not the nonzero differences that the estimate is built on. Whenever the two counts differ, the interval is too narrow or too wide. The one-sample case is not affected, since y is 0 there.
To Reproduce
x holds no zeros, but three of the ten differences are zero:
library(effectsize)
x <- c(5.1, 6.0, 7.2, 4.8, 6.5, 5.9, 7.0, 6.1, 5.5, 6.3)
y <- c(4.9, 6.0, 6.5, 4.8, 6.8, 5.3, 6.1, 6.1, 5.9, 5.0)
rank_biserial(x, y, paired = TRUE)
#> r (rank biserial) | 95% CI
#> --------------------------------
#> 0.64 | [0.06, 0.90]
rank_biserial(x - y)
#> r (rank biserial) | 95% CI
#> ---------------------------------
#> 0.64 | [-0.07, 0.92]
The two calls describe the same data and give the same estimate, 0.642857, but the paired call uses nd = 10 where there are 7 nonzero differences, and its interval excludes zero while the correct one does not.
Expected behavior
The paired call should give the same interval as the one-sample call on the differences, [-0.065116, 0.920343], which is what nd = 7 gives. A possible fix is to count the differences, as .r_rbs() does:
nd <- sum(((x - y) - mu) != 0)
This is separate from #502, which is about how zero differences enter the estimate itself.
Specifications
RVersion 4.5.0 (2025-04-11)effectsizeVersion 1.0.3
- Lingua principale
- R
- Stelle
- 353
- Fork
- 25
- Merge medio
- 9h 11m
- PR unite (30g)
- 2
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di easystats/effectsize
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
easystats/effectsize#709 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
easystats/effectsize#708 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 20/100
easystats/effectsize#705 · 1 commento ·
-
consistency :apple: :green_apple: docs 📑
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
easystats/effectsize#681 · 1 commento ·
-
Significance testsApertaenhancement 🔥
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
easystats/effectsize#638 · 7 commenti ·
Tutte le issue di easystats/effectsize
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
HenrikBengtsson/R.matlab#61 ·
-
multi_class that used on tutorial has been deprecated on sklearn 1.5 versionForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
microsoft/ML-For-Beginners#1059 · 1 commento ·
-
easy first-contributor first-contributors good first issue help wanted r up-for-grabs
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
fork-commit-merge/fork-commit-merge#8524 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
waldronlab/bedbaser#27 ·
-
documentation good first issue priority: low
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
Pascal-Kueng/dyadMLM#157 ·
I maintainer di solito rispondono entro 1 giorno