because a new data set is created.
sysuse auto,clear
statsby, by(foreign): regress mpg gear turn
l
see help
....statsby
executes command for each group identified by varname, building a dataset of the associated values from the expressions in
exp_list. The resulting dataset replaces the current dataset, unless the saving() option is supplied.