kolmogorov smirnov test for two sample of different size I have two samples A and B.
A contains 100 elements while B has 150 elements.
I want to know whether Kolmogorov-Smirnov test can be performed to compare these two samples A and B of different size?
Kindly reply.
With Regards
Puglu
 A: Yes. Denoting by $n_1$ and $n_2$ the size of your samples, then the number of observations considered by the test when computes the statistics is given by $\frac{n_1 n_2}{n_1+n_2}$
[Later edit]
The 2-sample test is built around the estimator $D_{n_1n_2} = \sup_{x}{|S_{n_1}(x) - S_{n_2}(x)|}$. Where by $S_{n_1}(x)$ we denote the experimental cumulative distribution computed for first sample, and $S_{n_2}(x)$ for the second sample.
Now, for tiny samples this can be computed by hand. For 2-digits lengths is still computable exactly with some software. But when the samples are large is not feasible to compute in this way. For large samples, Smirnov found that the statistic $\sqrt{N}D_{n_1n_2}$ has the same asymptotic distribution as the statistic used for 1-sample test. Note that being asymptotic means is usable for large numbers and that $N = \frac{n_1n_2}{n_1+n_2}$ is only an approximation.
To compute the maximum there is a straight forward algorithm. Without loosing generality, we might consider the two samples sorted. Make a single vector of values from both samples, with sorted elements. Now iterating over elements, for each element $\in X$ add $1/n_1$, for each element $\in Y$ substract $1/n_2$. The maximum value found while cumulating values is $d$.
For small samples there are published tables of critical values. One of them you can find at KS Wikipedia page. Denote that for samples with less than 4 values you cannot compute something usable, to they are skipped.
For more information about how things evolved, a very interesting was published by M. A. Stephens.   
