For example, use id age sex if sex=1 using dataset.dta. For that, you only need to load the dataset in the following way: use using dataset.dta. This is very useful in order not to start with a massive dataset with unnecessary variables and observations. To load a dataset, the command use might be combined with options to load only the desired variables and observations.
#Stata mp max columns free
Thus, as more free space you have there, the less probability of running out of memory. Moreover, some procedures create temporary datasets stored in your memory. Then, as fewer variables are loaded, the faster will be some specific functions. The speed of commands such as collapse or reshape, to name a few, depends on the number of variables in the dataset (among other factors). For more information about this command, I recommend to check the help compress option in Stata or check this video from StataCorp.
![stata mp max columns stata mp max columns](https://www.stata.com/features/i/db-tabulate2.png)
Consequently, the use operation will be faster next time we load this dataset in our Stata workspace. This command not only reduces the amount of memory used by the dataset, it also saves a lot of space (in terms of MBs and even GBs) of the DTA file stored in the hard disk. Then, converting this int variable to byte variable (values between -127 and 100) reduces the memory usage. But imagine that variable’s values range from 0 to 99. This means it can take values comprised between -32.767 and 32.740. Similarly, a numerical variable can be in int format. Then, the compress command converts the variable’s storage type from str200 to str50.
![stata mp max columns stata mp max columns](https://datacarpentry.org/stata-economics/img/interface.png)
However, the longest value in that variable takes 50 characters. This means the variable might take 200 characters as maximum length. For instance, we have a string variable str200. It reduces the size of your dataset by converting the storage type of your variables into the most efficient typology. I would say that it is one of the most valuable commands in Stata.
![stata mp max columns stata mp max columns](https://www.alfasoft.com/images/products/stata/images/stata-16-box-200.png)
For this reason, I would like to share some tips that I have learned over many hours in front of Stata. However, these computations usually take more time than we would like, which is frustrating and inefficient. Depending on the power of our machine, computations in Stata might take more or less time. Occasionally we manage enormous datasets with a lot of variables and observations.