A few weeks ago, someone asked on Twitter whether one can write some Stata script that tells us how many variables from a dataset were used in a dofile. Such a script can be very relevant, especially if we have hundreds of variables, out of which, only a handful are…