Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to do K-S test with weight


    Dear specialists,

    I really thank everyone here sparing no efforts to help me.

    The problem is this: I have two samples (merged in one dataset) and I want to compare the distributions on some variables between the two samples. Normally, this is quite straightforward with, say, a Kolmogorov-Smirnov test. My problem is that I want to include probability weights in the two samples. The Stata ksmirnov routine does not allow for pweights. I was wondering if there is a way to do such a thing in Stata?

    It would be great if somebody can help me. Thank you very much in advance!

    Ye

  • #2
    Ye:
    welcome to this forum.
    Due to the lack of substantive details (please read and act on the FAQ. Thanks), guess-work is mandatory here.
    Both -mean- and -regress- allow weights, just to mention the first two Stata built-in commands that spring to my mind.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Has anyone even worked out the theory there? How many degrees of freedom do you have? If it's thousands or millions, then any discrepancy qualifies as significant.

      Prejudice alert, but with some logic

      K-S I regard as beautiful mathematics but fairly useless statistics. Like all tests, the most you get is a P-value. In this particular case, the test is most sensitive to differences in the middle of distributions rather than in the tails. Different problems require different choices, but that is the precise opposite of what I usually need.

      The associated graphics can be useful, but again (empirical (cumulative)) distribution traces converge in the tails, which is where the difference may be most interesting and/or important.
      Last edited by Nick Cox; 22 Oct 2021, 07:49.

      Comment

      Working...
      X