To quickly install RegiStream directly from our website, use the following command in your Stata console:
net install registream, from("https://registream.com/install/stata") replace
This command will download and install the latest version of RegiStream, including all necessary .ado and .sthlp files.
To verify the installation, run the following command in the Stata console.
which autolabel
To uninstall the RegiStream package, run the following command in the Stata console.
ado uninstall registream
By default, RegiStream will store data files in your system's user home directory. This enables seamless sharing of label data across projects and programming languages like Stata, R, and Python. The default storage locations are:
If you are working on a secure system that does not have a standard user home directory (e.g., MONA or other high-security environments), you will need to specify a custom directory for RegiStream to store the required files. You can do this by setting the global variable $registream_dir, at the beginning of your code:
global registream_dir "path/to/custom/directory"
Replace "path/to/custom/directory" with the actual path where you want RegiStream to store the data files.
Soon, you will be able to install RegiStream directly from the SSC repository:
ssc install registream
Stay tuned for updates on the SSC release!
If you are working on an offline server or a high-security environment (e.g., MONA), you can manually download the RegiStream package as a zip file and transfer it to the secure system.
Download ZIPAfter downloading, to install the package manually, follow these steps:
sysdir
adopath
adopath + "/path-to-your-favorite-folder/stata_packages/registream"
To verify the installation, run the following command in the Stata console.
which autolabel
If you do not get an error, everything worked smoothly.
To uninstall the RegiStream package, simply delete the registream folder from your secure system.
Once the RegiStream package is installed, you will also need the data files. Due to the 10MB file size limit for secure environments like MONA, the data files are split into multiple smaller downloads. You can download each file and transfer them to the secure system.
Note: Each file in the data directories is under 10MB to comply with the upload limits on secure systems like MONA.
Since secure systems may not have a standard user home directory, you will need to create a custom directory for RegiStream data. You can choose any location, but we recommend creating a folder named registream. Within this folder, create subfolders for each data type you download. For example:
# create the following directories for registream data
path-to-your-favorite-folder/registream
path-to-your-favorite-folder/registream/autolabel_keys
It is important that the folder names match exactly as indicated (e.g., scb_variables_swe). Once the CSV files are in the appropriate folders, RegiStream will automatically recognize and use them when you run your code.
If you do not place the data files in the default directories, i.e.
Then, for each Stata session, you need to set the global variable $registream_dir to specify the custom path where the path-to-your-favorite-folder/registream folder is located:
global registream_dir "path-to-your-favorite-folder/registream"
Replace "path-to-your-favorite-folder/registream" with the actual path where you created the registream folder and its subfolders.
Here are some examples of how to use RegiStream to label your datasets in Stata:
autolabel variables, domain(scb) lang(eng)
This command labels all variables in your dataset using the SCB domain in English.
autolabel values, domain(scb) lang(swe)
This command sets value labels for all variables using the SCB domain in Swedish.
autolabel variables ku*ink yrkarbtyp, domain(scb) lang(eng) exclude(ku3ink)
This command labels the specified variables (using wildcard asterisk to get all ku*ink
variables), excluding ku3ink
, using the SCB domain in English.
autolabel variables ku*ink yrkarbtyp, domain(scb) lang(eng) exclude(ku3ink) suffix("_lbl")
This command labels the variables as in the previous example, but stores the results in new variables with the suffix "_lbl"
.
autolabel values kon, domain(scb) lang(eng)
This command applies value labels to the variable kon
, using the SCB domain in English.
autolabel lookup carb random_var yrkarbtyp kaross, domain(scb) lang(eng)
This displays the labels, definitions, and value labels (if applicable) for the variables carb
, yrkarbtyp
, and kaross
from the SCB domain in English. The variable random_var
does not exist in the domain, so a warning is returned at the end.