Introduction To STATA On JupyterHub
Introduction To STATA On JupyterHub
Introduction To STATA On JupyterHub
If you have NOT yet sign-up, please refer to the sign-up guide.
2. Enter your username and password for JuypterHub and then click on “Sign In”
3. The “Launcher” page would have appeared. If not, you can click on “+” on the left-hand side panel to open one.
Click on “+” to
open a new
Launcher
4. There are two STATA icons on the Launcher – the 1st one is under the “Notebook” category while the other is under “Console”. In other words, the
1st one will be running in Jupyter Notebook and the 2nd one will be running in a terminal mode (text mode).
5. Click on “STATA” under the “Console” category to open Stata in terminal mode. Note that the page is called “Console 1” to notify that it is in
terminal mode. Please note that STATA is connected and in idle mode waiting for your inputs in the bottom notification area.
6. You can type in any STATA command in the input area OR upload any file to your home folder
Input area
7. We use the automobile dataset that comes with STATA for illustration. Type in “sysuse auto” in the input area and then press “Shift + Enter” to
execute the command
A number here
means the
command is
successfully
executed
11. To read in data, you need to upload the data file first. Remember NOT to include any space or special characters, e.g. &, % etc., in the filename.
Click on the upload button and choose your file to upload.
12. You can create a new folder by right-clicking your mouse when pointing to the empty area on the left-hand side panel. Click on the folder to move
inside.
13. Enter command in the input area to read the file into STATA: e.g. “import excel “imfdata.xls”, sheet(“Sheet1”) firstrow” → “shift”+”Enter”.
Note: If you encounter a problem saying that file imfdata.xls not found, you need to change the folder to /data/ by the following command:
cd ~/data
pwd
14. You can continue to work on the dataset
15. However, you cannot save your inputs or result in terminal mode. To save your work, you need to use STATA in Jupyter Notebook. From Launcher,
click on the 1st STATA icon.