0

I am trying to find the difference in means in my two samples. The distribution is not normal hence I have to resort to KS test. Now, the data is weighted. In proc t-test, there is an option of mentioning weight in the command, like this:

proc ttest data=input;
var variable_x;
class variable_y;
weight weight;
run;

Is there a similar thing for KS test in npar1way procedure? Thanks!

  • This is not a good SO question, you should check the documentation to find the answer. – Reeza May 04 '17 at 20:48
  • I did check in the documentation, but I could not find a similar thing, hence the ask. – Vaishak N Chandran May 04 '17 at 20:52
  • I don't have a problem with this as a SO question. The presence of the answer in the documentation is not a barrier to a question being good. Most of the questions here can be answered from documentation after all. – Joe May 04 '17 at 21:08
  • No, it's still a 'statistical' type question, how to deal with weighted data in a non parametric test. And he could have said there wasn't the line in the documentation. – Reeza May 04 '17 at 21:13
  • I would appreciate if you guys could help me with this. I have been struggling with this for a while now. – Vaishak N Chandran May 04 '17 at 21:13
  • @Reeza If the question is "How to do X in SAS" it's correct here. If it's "What statistic whatever is correct theoretically" it belongs in [stats.se]. Some are okay in both places (this probably would be). – Joe May 04 '17 at 21:15
  • @VaishakNChandran I'm not a statistician, so I certainly can't give you a good answer. I will say that the `freq` statement is the closest to a weight, though I think it probably only works with integer weights. You may want to look at `SURVEYREG` or `SURVEYLOGISTIC` as those are better for weighted data. – Joe May 04 '17 at 21:16
  • @Joe those won't work for a non parametric test. – Reeza May 04 '17 at 21:19
  • Yes, I belive proc survreyreg assumes normality of data. – Vaishak N Chandran May 04 '17 at 21:20
  • Not a stats person like I said, just a programmer, so certainly will defer to you all here. I will note that Peter Flom recommends it in a similar situaiton [here](http://marc.info/?l=sas-l&m=132800761809084), though the OP is not as clear in indicating that their data is non-normal (though they suggest they would usually use NPAR1WAY similarly). – Joe May 04 '17 at 21:23
  • http://stackoverflow.com/questions/40044375/how-to-calculate-the-kolmogorov-smirnov-statistic-between-two-weighted-samples – Reeza May 04 '17 at 22:40
  • https://stats.stackexchange.com/questions/193439/two-sample-kolmogorov-smirnov-test-with-weights – Reeza May 04 '17 at 22:40
  • I think you're going to have to hardcode it, but I would simply ask SAS Support first and see what they say. – Reeza May 04 '17 at 22:40

0 Answers0