Stata

How to access Stata
Write to us for the STATA setup file(exe. file) at glus@jgu.edu.in
Want to get started fast on a specific topic?
Access over 250 short ​video tutorials demonstrating how to use Stata and solve specific problems are available. The videos for simple linear regression, time series, descriptive statistics, importing Excel data, Bayesian analysis, t-tests, instrumental variables, and tables are always popular.
Need any Assistance? Please contact us at: glus@jgu.edu.in 
                 
What is Stata?
Stata is a robust statistical software that enables users to analyse, manage, and produce graphical visualisations of data. It is primarily used to study data trends by researchers in economics, health, and political science. The software is easier to use because it offers a command line and a graphical user interface.
JGU Global Library has license to STATA 18 for both Windows and Mac OS.
System Requirement for Installation

Windows versions supported by Stata 18 :
  • Windows 11 *
  • Windows 10 *
  • Windows 8.1 *
  • Windows Server 2016, 2012R2 *, 2019 *, 2022 *
* Stata requires 64-bit Windows for x86-64 processors made by Intel® or AMD (Core     i3 equivalent or better).

Mac versions supported by Stata 18 :
  • Mac with Apple Silicon or Intel processor (Core i3 or better)
  • macOS 11.0 (Big Sur) or newer for Macs with Apple Silicon and macOS 10.12 (Sierra) or newer for Macs with 64-bit Intel processors
IMPORTANT NOTE: If an older version of STATA exists in your computer, you must uninstall it first and then install the latest version.
How to install Stata on your computer

The installation process of Stata for Windows and Mac are the same.
Step 1:  Connect with Global Library Team for STATA setup file(exe. file) for Windows or Mac OS. (email id: glus@jgu.edu.in)
Step 2: Download the file and double-click the file to run the installation.







 
Step 3: Click  'next'

Step 4: Accept the terms and conditions and click on “Next” as shown in the below box. 

Step 5: Enter your name and Institution name in the given fields. Select 'anyone who uses this computer'. Click 'next'
 

 
Step 6: Select 'StataSE' option and click “next”

Step 7:  Select 'next' or you can change the drive as you want.

Step 8: Select a folder as convenient to you.

Step 9: Click 'install' to begin the installation.

Step 10: Wait till the program features get installed.



 
Step 11: Once all the features get installed, click 'finish'


 
Step 12: Search “StataSE 18” in the Windows search bar and double click on the “StataSE 18” Icon to open. You can pin it on your taskbar too.

Step 13: You have to click “Yes” to allow your system to run “StataSE” A dialogue box will appear asking to enter certain details. Enter the Code and Authorization key that has been shared with you.

Step 14: you may select the box or leave it. But if you register, you will get technical assistance when required.


 
Step 15: Optional information, you can set accordingly.


 
Step 16: Installation completed.



 
STATA used for
Stata is a powerful statistical analysis software.

You can run:
  • Descriptive statistics
  • Relationship between variable
  • Inferential statistics & modelling
  • Graphs
Graphical User Interface & Command Line Interface

 
Review Pane & Result Pane
Variable Pane & Properties Pane
Stata for beginners course
Simple guide on how to use STATA (Command Line Interface)
Area covered:
  • How to input data into Stata
  • How to edit variables
  • How to analyze data using frequencies and summary statistics
  • How to create charts
It is best that the collected data should be in an excel sheet. This makes it easier to copy and edit. An already existing dataset will be used as an example.


Please see that the observations of variables 'Sex' and 'did you eat cake in the past 7 days' are denoted as 1 &2 and 0 &1 respectively. For the variable 'sex', we will be considering 1 as male and 2 as female. Whereas, for the variable did you eat cake in the past 7 days', we will be considering 0 as 'no' and 1 as 'yes'. 
 
Step1: Copy the data from the excel sheet.



 
Step 2: Open Stata. Go to the command pane and enter the command 'edit' and click enter

Step 3: A data editor window will appear, where you can copy the data from the excel sheet. Make sure that you copy the data into the first cell in the data editor. You will find a pop-up message asking 'Do you want to treat the first row as variable names or data'. Click 'variable names' and the dataset will be created.

Step 1: Go to the command pane and enter the command 'varmanage'. This command opens the variables manager window.




 
Step 2: You can see the properties displayed on the right side for the selected variable (in this case 'interviewid'). If you want to edit any properties of the variables, you can choose any variable from the left side table and change the properties from the right-hand side table.

Variable properties: 
1. Name: Should not contain any numbers or special characters
2. Label: It is basically how the variable name appears in an output. This can be changed as per your requirement.
3: Type: How the data is being stored.
4. Format: It is auto-generated.
5. Value label: set of responses that are valid for a question(multiple choice). 
6. Notes: for reference purpose

Step 3: For example, earlier we saw that for the variable 'sex', the observations were denoted as 1 and 2, where 1 is male and 2 is female. Now we need to specify it in the variable properties by creating values in the value label.
Select the variable 'sex' from the left-hand side table and click the 'manage' option of the Value label. Then select 'create label'.


Step 4: A 'create label' window will pop-up, where you need to add the label name, i.e., variable name (in this case 'sex'). In the value section type '1' and in the label section type 'Male'. Then click 'add'.



Same way, In the value section type '2' and in the label section type 'Female'. Then click 'add'. Then 'OK'. The set of values for variable 'sex' is added.

Step 5: Now, go to the variable manager window and assign the value label and click 'apply'. The value label will be added to the left-hand side table.






The Variable name is changed to 'cake'. 'Yes' & 'No' values are also added. (1 means Yes and 0 means No)

Step 6: Now, go back to the main STATA window. You will see all the changes made displayed in the Result Pane.

Step 1: Let's find out the frequencies of males and females in the dataset. For this, type the command  'tabulate sex' in the command pane.

Step 2: We can calculate measures of central tendency (mean and median) and measures of variability (Range and Standard deviation). For this, we will be using the variable 'Age'. For this, Use the command 'summarize age'. 

Step 3: We can get more from the summary by giving summarize command and option code 'detail'. Let's see. Type 'summarize age, detail'. This will display, extra details like Skewness and Kurtosis.

Now let's see how to create a graph with the available data. We will be taking the variables 'sex' and 'rice' as examples.

Step 1: Let's create a pie chart for the variable 'sex'. Go to the command pane and type 'graph pie, over(sex)'. (note: in order to produce a pie chart. variable names are added inside the bracket). The command is the same for creating a bar and dot chart. You can replace the word 'pie' with either bar or dot and the same will be produced accordingly.


 
Step 2: Creating Histogram
For creating a histogram, the command is a bit different. Here, we will be using the variable 'age'. Type 'histogram age, normal' in the command pane. (note: the variable name is written after the histogram.)

Introduction to Stata - For Statistical and Econometric Computing - Part 1
Introduction to Stata - For Statistical and Econometric Computing - Part 2
Introduction to Stata - For Statistical and Econometric Computing - Part 3
Introduction to Stata - For Statistical and Econometric Computing - Part 4