Universidad Complutense de Madrid
E-Prints Complutense

Automatic regrouping of strata in the chi-square test



Downloads per month over past year

Pérez-Salamero González, Juan Manuel and Regúlez-Castillo, Marta and Ventura-Marco, Manuel and Vidal-Meliá, Carlos (2017) Automatic regrouping of strata in the chi-square test. [ Documentos de Trabajo del Instituto Complutense de Análisis Económico (ICAE); nº 24, 2017, ISSN: 2341-2356 ]

WarningThere is a more recent version of this item available.

Creative Commons Attribution Non-commercial Share Alike.




Pearson´s chi-square test is widely employed in social and health science to analyze categorical data and contingency tables and to assess sample representativeness. For the test to be valid the sample size must be big enough to provide a minimum number of expected elements per category. If the researcher chooses to regroup the strata in order to solve the failure on the minimum size requirement, the existence of automatic re-grouping procedures in statistical software would be very useful, especially when tests are applied sequentially. After comprehensively reviewing the software that can carry out this test, we find that, with a few exceptions, there is no automatic regrouping of the strata to meet this requirement, although it would be very useful if this were available. This paper develops some functions for regrouping strata automatically no matter where they are located, thus enabling the test to be performed within an iterative procedure. The functions are written in Excel VBA (Visual Basic for Applications) and in Mathematica, so it would not be hard to implement them in other languages. The utility of these functions is shown by using three different datasets. Finally, the iterative use of the functions is applied to the Continuous Sample of Working Lives, a dataset that has been used in a considerable number of studies, especially on labor economics and the Spanish public pension system.

Item Type:Working Paper or Technical Report
Uncontrolled Keywords:Chi-square test, statistical software, VBA, Mathematica, Continuous Sample of Working Lives.
Subjects:Social sciences > Economics > Econometrics
JEL:C46, C88, H55
Series Name:Documentos de Trabajo del Instituto Complutense de Análisis Económico (ICAE)
ID Code:45317
Deposited On:02 Nov 2017 09:53
Last Modified:11 Jun 2019 13:13

Available Versions of this Item

Origin of downloads

Repository Staff Only: item control page