Weighted Two-Sample Kolmogorov-Smirnov Test
The weighted Kolmogorov-Smirnov test compares the weighted empirical distribution functions of two groups, where each observation contributes its own weight (for example a survey weight). The statistic D is the largest vertical gap between the two curves; an optional version divides by a variance term to give the tails more weight.
관측값마다 가중치(예: 표본 가중치)를 반영한 두 집단의 경험누적분포를 비교하여 가장 큰 세로 차이 D로 분포가 같은지 검정하고, 집단 표지를 순열하여 p값을 구합니다.
Do two weighted samples, such as two survey waves with sampling weights, have the same distribution of a numeric variable?
가중치가 있는 두 표본(예: 표본 가중치를 쓴 두 차례 조사)의 수치형 변수 분포가 같습니까?
A large D with a small permutation p-value means the distributions differ somewhere; the location of the largest gap is reported. An approximate large-sample p-value based on Kish effective sample sizes is shown for comparison.
When to use Weighted Two-Sample Kolmogorov-Smirnov Test
- Observations carry survey, frequency or importance weights.
- You want to compare whole distributions, not only means, between two groups.
When to use something else
- All observations have equal weight: use Two-Sample Kolmogorov-Smirnov Test
- You compare more than two groups: use k-Sample Anderson-Darling Test
Assumptions and requirements
- Exchangeability of (value, weight) pairs between groups under the null
- Non-negative weights
What the analysis reports
- D statistic and permutation p-value
- Effective sample sizes and approximate p-value
- Weighted medians per group
- Location of the largest gap
How to report it
The two-sample Kolmogorov-Smirnov test with observation weights compared [group] (n = [value]) with [group] (n = [value]): D = [value], permutation p = [value].
Related methods
How this method is validated
이 방법의 검증 근거
- Independent computation. 1 reference test compares the results with SciPy.
독립 계산. SciPy 대조 참조 시험 1건 통과.
Tolerances are relative differences (absolute differences for values near zero). R comparisons and reference tests are re-run before each release of the analysis engine.
허용오차는 상대 차이입니다(0 근처 값은 절대 차이). R 대조와 참조 시험은 분석 엔진을 배포할 때마다 다시 돌립니다.
Run Weighted Two-Sample Kolmogorov-Smirnov Test on Quorant
- Data you need
- a table (CSV or Excel) with an outcome variable and a grouping variable
- Price
- 250 credits for one analysis up to 10,000 rows (complexity level 2); larger or wider data costs more. Optional methodologist review: 1200 credits.
- Checking
- Compared with independent computations
- Before you pay
- A free pre-analysis diagnosis checks your data and gives an exact quote; nothing is deducted until you approve it.