Function that returns the final clustering, based on the estimated number of groups and common and group specific factors.
Useful links