i try to produce KS statistic using npar1way
proc npar1way edf data=final_pop_ks_1 ; class source; var FEES; exact ks; output out=stat ks; run;
However, SAS does not stop running (even with a small number of obs). I raised this in another post and i was advised to remove the option EXACT.
This resolved the issue however, now the output does not include the p-value for the D statistic of KS
This is the npar1way without the option EXACT
In addition in the PROC NPAR1WAY user guide i found that EXACT is not produced for KS npar1way - see below.
PROC NPAR1WAY provides exact p-values for tests for location and scale differences based on the following
scores: Wilcoxon, median, van der Waerden (normal), Savage, Siegel-Tukey, Ansari-Bradley, Klotz, Mood,
and Conover. Additionally, PROC NPAR1WAY provides exact p-values for tests that use the raw data as
scores. Exact tests are available for two-sample and multisample data. When the data are classified into two
samples, tests are based on simple linear rank statistics. When the data are classified into more than two
samples, tests are based on one-way ANOVA statistics.
My question is : i there any way we can produce p-values for the KS - D statistic or workaround ?
Add the D option to the PROC NPAR1WAY statement:
proc npar1way edf D data=final_pop_ks_1 ;
By the way, exact tests are for small data sets. Looks like you have 3000 observations, which is why the procedure never seems to finish processing the exact test. Add the MC option to the exact statement to get an approximate p-value for the exact test::
exact ks / MC;
Add the D option to the PROC NPAR1WAY statement:
proc npar1way edf D data=final_pop_ks_1 ;
By the way, exact tests are for small data sets. Looks like you have 3000 observations, which is why the procedure never seems to finish processing the exact test. Add the MC option to the exact statement to get an approximate p-value for the exact test::
exact ks / MC;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.