KS Test

Hello - I am trying to preform a Kolmogorov-Smirnov Test using the StatsKSTest Function (https://www.wavemetrics.com/products/igorpro/dataanalysis/statistics/te…)

This example online does not make sense to me. I have 2 waves that I am trying to compare - Diameter_O12 and Diameter_U12. Are there any other examples online of how to do this or do you have further guidance on how to run this function?

Thanks,

Rachael

When you load your data make sure to eliminate trailing NaNs in the _O12 wave.  Once you do that you get:

alpha = 0.05
N1 = 41
N2 = 48
Ne = 22.1124
D = 1
Critical = 0.305464
PValue(Ne) = 8.04017e-21
PValue(Marsaglia) = 0
Critical(B&T) = 0.278862
PValue(B&T) = 0

You can see the reason for this by plotting the cumulative distributions of the two inputs:

make d_o,d_u
•histogram/b=4/cum Diameter_O12,d_o
•histogram/b=4/cum Diameter_u12,d_u

In most cases when you apply the KS test you have the equivalent range. One way to get there, which may not be appropriate for your application is to subtract the mean (see MatrixOP subtractMean()).

The bottom line is that it does not make sense to apply StatsKSTest to your data in its current form.

HTH,

AG

 

Okay, thanks. I am going to use a different statistical test. But I want to use curve fitting to determine a power law best fit for my data and then compare correlation coefficients. Is there a built in function to determine the correlation coefficient of each fit?

 

Out of ignorance perhaps but ... What exactly is the specific outcome that you need? You have two data sets, A and B. Do you need to know whether Data Set A or Data Set B better fits to a defined analytical model *when the model is fit having all coefficient parameters predefined*? Or do you need to know the variability (confidence) in the fitting parameters when using a defined model *where all or some coefficient parameters are allowed to vary*? Or do you need to know whether analytical model X (power law) is "better" at fitting the data sets than analytical model Y (e.g. a non-power law equation)? Or do you need to know something else?