New User
Posts: 1

# how to produce the estimated quantile of the sampling distribution of Kolmogorov Smirnov statistic

I have to write a SAS macro in terms of the Kolmogorov Smirnov statistic. I spent a lot of time to do it but haven't finished so who can help me please? The question is:

Write a SAS macro which has 3 parameters: m for the number of simulation iterations, n for the sample size, and @ for the upper tail probability. given values of the 3 parameters, it returns a simulation-based estimate of the (1-@) quantile of the sampling distribution of the Kolmogorov-Smirnov statistic for data from the standard normal distribution.

%D(m=500, n=5, @=0.10);

%D(m=1000, n=10, @=0.05);

Super User
Posts: 20,735

## Re: how to produce the estimated quantile of the sampling distribution of Kolmogorov Smirnov statist

Post what you've tried. And this is clearly homework.

SAS Super FREQ
Posts: 3,839

## Re: how to produce the estimated quantile of the sampling distribution of Kolmogorov Smirnov statist

I suggest you begin with

%let m=500;

%let n=5;

%let alpha=0.10;

then write a DATA step that generates m samples, each of size n.

Run PROC UNIVARIATE with BY-group processing on the Sample ID variable.

Then analyze the empirical frequency of the indicator variable ( KS > alpha ).

For hints and similar Monte Carlo estimates, see

"Using simulation to estimate the power of a statistical test"

which uses PROC TTEST (on two independent samples) instead of the KS (on one sample).

After everything is debugged and working, it is trivial to wrap the code into a macro.

Discussion stats
• 2 replies
• 105 views
• 0 likes
• 3 in conversation