In this paper [1] the author mentioned a procedure by M. Greenace that can be used to collapse the levels of a categorical variable by setting up a table with the frequency of each level and the proportion of the target value in each level. Then collapsing the table level by level looking at the change in chi-square as the table is collapsed. Does anyone know if such a procedure is available in R. [1] http://www2.sas.com/proceedings/sugi31/079-31.pdf