Skip to main content

Non-Parametric Test : Kolmogorov - Smirnov one sample test and two sample test.

 Non-Parametric tests

Kolmogorov-Smirnov one sample test.  or Kolmogorov-smirnov goodness of fit test.

The test was discovered by A. N. Kolmogorov and N. V. Smirnov hence that test has name Kolmogorov-smirnov  test, they developed two test for one sample test and two sample test. in this article we discus the Kolmogorov-smirnov  one sample test. this is simple one sample Non- Parametric test used to test whether the data follow specific distribution or their is significant difference between the observed and theoretical distribution. (i.e. theoretical distribution means assumed distribution or considered specific distribution). the test measured the goodness of fit of theoretical distribution. we known that chi-square test is used to test the goodness of fit. the main difference is that the chi-square test is used when data is categorical and Kolmogorov-smirnov  test is used when data is continuous.

Assumptions of Kolmogorov-smirnov test as follows:

1. the sample is selected form the population having unknown distribution. 

2. the observation are independent.

3. the variable under study is continuous.

The procedure of Kolmogorov-smirnov  test is: 

Let X1, X2, ........Xn be a random sample of size n form population with unknown continuous distribution function. F(X). but we are interested to test the data follows a specific distribution F0(X) or not. for testing the hypothesis are

H0: Data follow a specific distribution.    

H1: Data does not follow a specific distribution.

OR 

H0: F(X) =  F0(X)   vs H0: F(X) ≠ F0(X).

(it is two tailed test)

The test consist following steps:

Step I: the Kolmogorov-smirnov  test (i.e. K-S test ) is based on the comparison of empirical cumulative distribution ( observed or sample distribution) with theoretical cumulative distribution function (i.e. specific or considered cumulative distribution function). now we first finding the empirical cumulative distribution function which is based on the sample and is defined as the proportion of sample observation which are less than or equal to some value of X and it is denoted as S(X).

S(X) = (number of observations are less than or equal to x ) / (total number of observations)

Step II: in this step we find the theoretical cumulative distribution function F0(X) for all possible  values of x.

Step III: After finding both empirical and theoretical cumulative distribution function for all possible values of x then we take the difference of empirical and theoretical cumulative distribution function  for all x

i.e. S(X) - F0(X)  for all 

Step IV: the test statistics denoted as Dn =    Sup| S(X) - F0(X) |

where Dn  is the supreme over all x of absolute value of difference of empirical and theoretical cumulative distribution function.

Step V: the calculated value of the test statistics Dn =    Sup| S(X) - F0(X) | is compared with the critical value at ∝ % level of significance. and take decision about test to accept or reject the null hypothesis.

here two case are arises if small sample test and large sample test

i) Small sample test: if the sample size n is less than or equal to 40 (i.e. n ≤  40) 

then the  test statistics as Dn =    Sup| S(X) - F0(X) |  is compared with the critical value at ∝ % level of significance

if the calculated Dn  is greater than   or equal to critical value  Dn α  at α% of level of significance. i.e.  

Dn   > Dn α


 We reject null hypothesis  at α% of level of significance. other wise we accept null hypothesis.

ii) Large sample test: if the sample size n is grater than 40 (i.e. n > 40)

 then the  test statistics as Dn =    Sup| S(X) - F0(X) |  is compared with the critical value at ∝ % level of significance.

but the sample size  n is greater than 40 then the critical value for test statistics at given ∝ % level of significance is approximately calculated as 

Dn ∝   = (1.36) / √n      (note that in large sample test we calculate the critical value)

where n is sample size

then we comparing the calculated and critical value of D and take decision about test to accept or reject the null hypothesis. if the calculated Dn  is greater than or equal to  the critical value  Dn α  at α% of level of significance. i.e.  Dn   > Dn α then we reject the null hypothesis  at α% of level of significance. other wise we accept null hypothesis.


Kolmogorov-Smirnov two sample test. 

In kolmogorov-Smirnov one sample test is used to compare the empirical cumulative distribution with hypothesized cumulative distribution function. but in two sample test compare the empirical cumulative  distribution of two sample. 

Assumptions: 

1. the sample is selected form the population having unknown distribution. 

2. the observation are independent.

3. the variable under study is continuous.

The procedure of Kolmogorov-smirnov  test is: 

Let X1, X2, ........Xn and Y1, Y2, ........Yn be a random sample of size n form first and second population.  Let S1(X) and S2(X) are sample empirical cumulative distribution function of first and second sample respectively now we want to check the sample come from population have same distribution or not. for testing the hypothesis are

H0:    F1(X) =  F2(X)

H1:  F1(X) ≠ F2(X)

The test consist following steps:

Step I:  the test is based on the comparison of the sample or empirical cumulative distribution function. so we firstly calculate the sample cumulative distribution for both sample and denoted as S1(X) and S2(X) and calculated as the proportion of number of sample observations are less than or equal to some value of X. to the total number of observations. 

S1(X) = the number of observations less than or equal to value of X  in first sample / total number of observation in sample first.  

and 

S2(X) = the number of observations less than or equal to value of X  in second sample / total number of observation in sample second.   

S1(X) and S2(X) calculated for all values of X 

Step II: after calculating the empirical distribution function S1(X) and S2(X) for all sample we take the difference between them. (i.e. S1(X) - S2(X)).

Step III:  the test statistics denoted as Dn = Sup| S1(X) - S2(X) |

where Dn  is the supreme or maximum  over all x of absolute value of difference of empirical cumulative distribution function of two samples.

the calculated value of the test statistics Dn =  Sup| S1(X) - S2(X) | is compared with the critical value at ∝ % level of significance. and take decision about test to accept or reject the null hypothesis.

here two case are arises if small sample test and large sample test

i) Small sample test: if the sample size n is less than or equal to 40 (i.e. n ≤  40) 

then the  test statistics as Dn =  Sup| S1(X) - S2(X) |  is compared with the critical value at ∝ % level of significance

if the calculated Dn  is greater than  or equal to critical value  Dn α  at α% of level of significance. i.e.  

Dn   > Dn α

 We reject null hypothesis  at α% of level of significance. other wise we accept null hypothesis.

ii) Large sample test: if the sample size n is grater than 40 (i.e. n > 40)

 then the  test statistics as Dn = Sup| S1(X) - S2(X) | is compared with the critical value at ∝ % level of significance.

but the sample size  n is greater than 40 then the critical value for test statistics at given ∝ % level of significance is approximately calculated as 

Dn ∝  = (1.36) / √n      (note that in large sample test we calculate the critical value) here the selection of quantity 1.36 id based on the level of significance 1.36 is for 0.05 l. o. s. and 1.22 is for 0.10 and 1.63 for 0.01 l.o.s. refer below table.

OR

where n is sample size n1=n2=n and for unequal sample size the critical value calculated using the formula,

 Dn α = c(∝) X √((n1+n2)/(n1n2). we select the value of C(∝) from table.

C(a)

1.22

1.36

1.48

1.63

a

0.1

0.05

0.025

0.01

then we comparing the calculated and critical value of D and take decision about test to accept or reject the null hypothesis. if the calculated Dn  is greater than or equal to  the critical value  Dn α  at α% of level of significance. i.e.  Dn   > Dn α then we reject the null hypothesis  at α% of level of significance. other wise we accept null hypothesis.



Comments

Post a Comment

Popular posts from this blog

B. Com. -I Statistics Practical No. 1 Classification, tabulation and frequency distribution –I: Qualitative data.

  Shree GaneshA B. Com. Part – I: Semester – I OE–I    Semester – I (BASIC STATISTICS PRACTICAL-I) Practical: 60 Hrs. Marks: 50 (Credits: 02) Course Outcomes: After completion of this practical course, the student will be able to: i) apply sampling techniques in real life. ii) perform classification and tabulation of primary data. iii) represent the data by means of simple diagrams and graphs. iv) summarize data by computing measures of central tendency.   LIST OF PRACTICALS: 1. Classification, tabulation and frequency distribution –I: Qualitative data. 2. Classification, tabulation and frequency distribution –II : Quantitative data. 3. Diagrammatic representation of data by using Pie Diagram and Bar Diagrams. 4. Graphical representation of data by using Histogram, Frequency Polygon, Frequency Curve and     Locating Modal Value. 5. Graphical representation of data by using Ogive Curves and Locating Quartile Values....

Index Number

 Index Number      Introduction  We seen in measures of central tendency the data can be reduced to a single figure by calculating an average and two series can be compared by their averages. But the data are homogeneous then the average is meaningful. (Data is homogeneous means data in same type). If the two series of the price of commodity for two years. It is clear that we cannot compare the cost of living for two years by using simple average of the price of the commodities. For that type of problem we need type of average is called Index number. Index number firstly defined or developed to study the effect of price change on the cost of living. But now days the theory of index number is extended to the field of wholesale price, industrial production, agricultural production etc. Index number is like barometers to measure the change in change in economics activities.   An index may be defined as a " specialized  average designed to measure the...

Non- Parametric Test: Run Test

Non- Parametric Test  A Non-Parametric tests is a one of the part of Statistical tests that non-parametric test does not assume any particular distribution for analyzing the variable. unlike the parametric test are based on the assumption like normality or other specific distribution  of the variable. Non-parametric test is based on the rank, order, signs, or other non-numerical data. we know both test parametric and non-parametric, but when use particular test? answer is that if the assumption of parametric test are violated such as data is not normally distributed or sample size is small. then we use Non-parametric test they can used to analyse categorical data  or ordinal data and data are obtained form in field like psychology, sociology and biology. For the analysis use the  some non-parametric test that are Wilcoxon signed-ranked test, mann-whiteny U test, sign test, Run test, Kruskal-wallis test. but the non-parametric test have lower statistical power than ...

Statistical Inference

 Statistical Inference: The Power of Statistical Inference in Data Analysis Statistical Inference: Drawing Meaningful Conclusions from Data In a data analysis, The statistical inference is a  a powerful tool for drawing meaningful conclusions from a sample of data  and making inferences about a larger population. It enables us to make confident predictions, understand relationships, and uncover valuable insights that can inform decision-making and shape various fields of study. At its core, statistical inference involves using statistical methods to analyse sample data and extend the findings to the broader population. This approach is necessary because it is often impractical or impossible to collect data from every individual or element of interest. Instead, we carefully select a representative sample and employ statistical techniques to infer information about the larger population. The first aspect of statistical inference is estimation. Estimation allows us to estima...

B. Com. I OE - II Practical No. 3 Scatter Plot.

  Practical No. 3   Scatter Plot.  Correlation In previous blog we discussed about the measure central tendency and Dispersion to use to study the variable. the correlation is a statistical concept that allows us to measure and understand the relationship between two or more variables. it provided a valuable information about that variables. e.g. price and demand of commodity, income and expenditure of family, height and weight of group of persons. their we use the relation   between this two variables. in above examples we see the one variable increases other variable is also changes in same or opposite direction.  definition: Correlation is statistical tool which study the relationship between two or more variables. for analysis of correlation various method and techniques are used.  example: i. Demand and supply of product                               ...

Median test

 Non- Parametric test Median test Median test is also a Non-Parametric test and it is alternative to Parametric T test. The median test is used when we are interested to check the two independent sample have same median or not. It is useful when data is discrete or continuous and if data is in small size.  Assumptions:  I) the variable under study is ordinal scale II) the variable is random and Independent. The stepwise procedure for computation of median test for two independent sample : Step I :- firstly we define the hypothesis Null Hypothesis is the two independent sample have same median.  Against Alternative Hypothesis is the two independent sample have different median.  Step II :- In this step we combine two sample data. And calculating the median of combined data. Step III :- after that for testing hypothesis we constructing the (2x2) contingency table. For that table we divide the sample into two parts as number of observation above and below to the ...

Non-Parametric Test 1.Sign test

Types of Non-Parametric Test : the non-parametric test is Broadly divided into three categories as: 1. One-sample Test  2.Two-sample test 3. K-sample test In this blog we discuss the one-sample tests,  there are four types of one-sample non-parametric test as follows:  1. Run Test. 2.Sign Test 3. Wilcoxon Sing-Rank test 4. Kolmogorov-smirnov test. first we discuss the sign test. 1.Sign Test The sign test id one of the very simplest non-parametric test. the test is based on signs (i.e. plus and minus signs) hence is called sign test. the non-parametric test are alternative to the parametric one, therefore the sign test is alternative to parametric T-test, is used to test the median of population instead of mean of population. (i.e. Parametric T-test is used to testing mean of population and sign test is used to testing the median of the population they are alternative to each other when the data follows assumption of T-test we use parametric t-test, but i some situation th...

Statistical Inference Practical: Point Estimation by Method of Moment

 

Statistical Inference I ( Theory of Estimation) : Unbiased it's properties and examples

 📚Statistical Inference I Notes The theory of  estimation invented by Prof. R. A. Fisher in a series of fundamental papers in around 1930. Statistical inference is a process of drawing conclusions about a population based on the information gathered from a sample. It involves using statistical techniques to analyse data, estimate parameters, test hypotheses, and quantify uncertainty. In essence, it allows us to make inferences about a larger group (i.e. population) based on the characteristics observed in a smaller subset (i.e. sample) of that group. Notation of parameter: Let x be a random variable having distribution function F or f is a population distribution. the constant of  distribution function of F is known as Parameter. In general the parameter is denoted as any Greek Letters as θ.   now we see the some basic terms :  i. Population : in a statistics, The group of individual under study is called Population. the population is may be a group of obj...

B. Com. I OE - II Practical No. 4 Karl Pearson's correlation coefficient

  Practical no. 4 Karl Pearson's correlation coefficient  Correlation In previous blog we discussed about the measure central tendency and Dispersion to use to study the variable. the correlation is a statistical concept that allows us to measure and understand the relationship between two or more variables. it provided a valuable information about that variables. e.g. price and demand of commodity, income and expenditure of family, height and weight of group of persons. their we use the relation   between this two variables. in above examples we see the one variable increases other variable is also changes in same or opposite direction.  definition: Correlation is statistical tool which study the relationship between two or more variables. for analysis of correlation various method and techniques are used.  example: i. Demand and supply of product                           ...