Announcement

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

  • Error message with two-sample K-S test

    I have Stata/IC 15.1

    I downloaded the file ksxmpl.dta

    When I perform two-sample K-S test, I get the following error

    . ksmirnov group, by(x) exact
    x takes on 7 values, not 2
    r(450);

    I have tried different data set with this test and still the same error.

    What might be going wrong?

    Thank you!

  • #2
    Try
    Code:
    ksmirnov x, by(group) exact

    From help:
    Code:
    Two-sample Kolmogorov-Smirnov test
    
            ksmirnov varname [if] [in] , by(groupvar) [exact]

    Comment


    • #3
      Thank you! Advice was helpful in figuring out the problem.
      Figured out the problem, I had put the data for each group in separate columns (as I had done with XLStat and StatsDirect). However, Stata requires the group (1 or 2) in one column and the data on the second column.

      Comment

      Working...
      X