
KS Test

rhoover
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
I am attaching my data if that is helpful.
April 3, 2025 at 11:29 am - Permalink
When you load your data make sure to eliminate trailing NaNs in the _O12 wave. Once you do that you get:
You can see the reason for this by plotting the cumulative distributions of the two inputs:
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
April 3, 2025 at 12:20 pm - Permalink
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?
April 4, 2025 at 08:55 am - Permalink
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?
April 4, 2025 at 09:57 am - Permalink