xcollapse is an extended version of collapse, which creates a data set with one observation per combination of values of a list of variables in the existing data set and new variables containing summary statistics of other variables (eg means) in each combination. xcollapse allows the user to choose the destination of the output data set, which may either be listed to the Stata log, or saved to a disk file, or written to the memory (overwriting any existing data set).