Skip to main content

Median test between 2 or more independent groups in SPSS

In 2 or more independent groups, when the outcome variable is ordinal and the independent variable is nominal, we can not compare the mean values between the groups. However, we can compare the medians between the groups.
In SPSS, we can compare the median between 2 or more independent groups by the following steps:

Step 1. Open the dataset and identify the independent and dependent variables to use median test. Here, I use the "Employee Data.sav" which is in the installation directory of IBM-SPSS. Here, educational level is regarded as "dependent variable" which is a ordinal variable. Similarly, minority classification is regarded as "independent variable" with the two categories "yes" and "no" coded as 1 and 0 which is a nominal variable.

Step 2. Now, go to analyze, non-parametric tests and  independent samples
Step 3. Then you see the following dialog box. Click objective and select "compare medians across groups".
Step 4. Click on fields and you see the following dialog box. Move the dependent variable in test fields and independent variable in groups.
Step 5. Click on settings and you see the following dialog box. Under choose tests, select customize tests and tick mark "median test (k samples)" and select the method of multiple comparison. By default, it is set to all pairwise comparison.
Step 6. Select test options and put the desired level of significance and confidence level. By default, it is set 5% level of significance at 95% CI.
Step 7. Exclude or include (by default, it is excluded) the user missing values.
Step 8. Click on Run and you see the following output.
from the output, it is clear that the median educational level varies across the minority classifications with P value=0.013 which is less than 0.05. So, we reject the null hypothesis.

If you want to show the contingency table of medians between the minority classifications, follow the following steps.
Step 9. Go to  analyze, non-parametric tests and legacy dialogs and click on k independent samples.
Step 10. Then you see the following dialog box. Move the dependent variable to the test variable list. Move the independent variable to the grouping variable list. Select median under the test type. then click on define range.
Step 11. after you click on define range, you see the following dialog box and use the numeric codes for the nominal variable (i.e. independent variable) Put the upper and lower limit of codes used for the independent variable (Here, the codes for the independent variable i.e. minority are 0 and 1 in my dataset so, I put the minimum value as 0 and maximum value as 1 and click continue.
Step 12. after that click on ok and you get the following output.
Here, you can see a contingency table of educational level (classified as greater than median and smaller than median) and minority classification as well as the P value after Yate's continuity correction i.e. 0.013. Compare it with the output in step 8 above.

Hope you enjoyed the tutorial. Thank you and see you in the next tutorial. Share it with your peers if you enjoyed!!

Note: This tutorial is made with reference to IBM-SPSS 24 and there might be differences in older versions!


  1. IEEE Final Year projects Project Centers in Chennai are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Projects for CSE It gives you tips and rules that is progressively critical to consider while choosing any final year project point.

    Spring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
    Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai

    The Nodejs Training Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training


Post a Comment

Popular posts from this blog

Multiple response analysis using SPSS

Creating date variable and calculating between two dates in SPSS