Download as pdf or txt
Download as pdf or txt
You are on page 1of 54

Statistical Software Application in

Economics

Chapter 1: Introduction to Softwares

By: Habtamu Legese


12/15/2022 1
https://youtube.com/@economicsbyhabtamu
Introduction to statistical analysis and programs
✓ Wide range of statistical programs available • SAS
• R
www.statistics.com – over 150 listed • S-plus
• Stata
programs • Sigmastat
• Excel
✓ Differences in ease of use, types of analysis, • Minitab
popularity, and cost. • Stats Direct
• Graphpad Prism
✓ Need to decide what sort of program would • SPSS
• EViews
be most effective for your research needs.
By: Habtamu Legese
12/15/2022 2
https://youtube.com/@economicsbyhabtamu
Stata
• A complete, integrated statistical package that provides
everything you need for data analysis, data management,
and graphics.
• With a point-and-click interface, as well as intuitive
command syntax and online help, Stata is easy to use, fast,
and accurate.
• However programming language is required and this may
take some time to learn.
• Stata is particular useful to professionals working in the
areas of economic research and medical research .
By: Habtamu Legese
12/15/2022 3
https://youtube.com/@economicsbyhabtamu
Cont.
• Stata is an easy to use but powerful data analysis
software package that features strong capabilities for:
• Statistical analysis
• Data management and manipulation
• Data visualization
• Stata offers a wide array of statistical tools that
include both standard methods and newer, advanced
methods, as new releases of Stata are distributed
annually

By: Habtamu Legese


12/15/2022 4
https://youtube.com/@economicsbyhabtamu
Cont.
• STATA is an integrated statistical analysis package.
• It has got started in California, in the mid-1980s by William
Gould.
• It was written in the C programming language.
• At one time, the name "S" was considered, then "Stata“
(Statistics Data)
• Strong in handling and manipulating large data sets.
By: Habtamu Legese
12/15/2022 5
https://youtube.com/@economicsbyhabtamu
Packages of Stata
Four (4) different packages of Stata are available:
• Stata MP (Multi-Processor) -the most powerful
• Stata SE (Special Edition)
• Stata IC (Inter-Cooled)
• Small Stata
The main difference among these versions is the maximum number
of variables and observations that can be handled.
Stata is a command-driven and also has pull-down menus
By: Habtamu Legese
12/15/2022 6
https://youtube.com/@economicsbyhabtamu
By: Habtamu Legese
12/15/2022 7
https://youtube.com/@economicsbyhabtamu
STATA: Advantages
• Command syntax is very compact, saving time
• Syntax is consistent across commands, so easier to learn
• Competitive with other software regarding variety of statistical
tools
• Excellent documentation
• Exceptionally strong support for
• Econometric models and methods
• Complex survey data analysis tools

By: Habtamu Legese


12/15/2022 8
https://youtube.com/@economicsbyhabtamu
STATA: DISADVANTAGES
• Limited to one dataset in memory at a time
• Must open another instance of Stata to open another dataset
• This won’t be a problem for most users

By: Habtamu Legese


12/15/2022 9
https://youtube.com/@economicsbyhabtamu
NAVIGATING STATA’S INTERFACE
Five windows in the main Stata interface:
1. Variables Window: This window displays a list of all variables in your data set.
2. Properties Window: This window displays the properties of each variable in
your data set.
3. Command Window: This window is the place where commands are to be
written. When pressing the Enter key, Stata immediately executes the command .
4. Results Window: This is the window where results are displayed. Stata
commands are preceded by a period (.).
5. Review Window: displays a list of all commands you have used in the order you
used them. If you click on any command in this window, it will be immediately
copied to the command window.

By: Habtamu Legese


12/15/2022 10
https://youtube.com/@economicsbyhabtamu
Command
window

You can enter commands


directly into the Command
window
This command will load a
Stata dataset over the
internet
Go ahead and enter the
command

By: Habtamu Legese


12/15/2022 11
https://youtube.com/@economicsbyhabtamu
Variables window
Once you have data loaded,
variables in the dataset will be
listed with their labels in the
order they appear on the dataset
Clicking on a variable name
will cause its description to
appear in the Properties
Window
Double-clicking on a variable
name will cause it to appear in
the Command Window

By: Habtamu Legese


12/15/2022 12
https://youtube.com/@economicsbyhabtamu
Properties window

The Variables section


lists information about
selected variable
The Data section lists
information about the
entire dataset

By: Habtamu Legese


12/15/2022 13
https://youtube.com/@economicsbyhabtamu
Review Window
The Review window
lists previously issued
commands
Successful commands
will appear black
Unsuccessful commands
will appear red
Double-click a command
to run it again
Hitting PageUp will also
recall previously used
commands By: Habtamu Legese
12/15/2022 14
https://youtube.com/@economicsbyhabtamu
Figure 1: The Stata widows without database
Variables
Review

Results

Command

By: Habtamu Legese


12/15/2022 15
https://youtube.com/@economicsbyhabtamu
A few points to be emphasis
1. The font style and size can be changed by right-clicking any window and selecting
Font.
2. The default color schemes in the Results window can also be changed by right
clicking in it and selecting Preferences, and then choosing a different color
scheme
3. In case a window ever disappears, just click on Window tool bar and click on the
missing window to make it reappear. Also we can stretch any window just as we would
resize the window.
4. In addition to these windows, there are 4 additional windows: Data editor, Do-file
editor, Graphics window and Help viewer.
By: Habtamu Legese
12/15/2022 16
https://youtube.com/@economicsbyhabtamu
Basic Rules of Stata Language Syntax
▪ The basic structure of Stata language syntaxis: command
[varlist][,options]
▪ Stata commands and variable names are CASE-SENSITIVE!
▪ All Stata commands are lowercase.
▪ Stata allows abbreviations of some commands.
▪ A Stata variable name can be up to 32 characters long variable name must
start with a letter(can contain letters and numbers). spaces are not allowed;
use an underscore (_)instead.
▪ You can add comments preceded by an asterisk(*).

By: Habtamu Legese


12/15/2022 17
https://youtube.com/@economicsbyhabtamu
Working directory

At the bottom left of the


Stata window is the address
of the working directory
Stata will load from and save
files to here, unless another
directory is specified
Use the command cd to
change the working directory

By: Habtamu Legese


12/15/2022 18
https://youtube.com/@economicsbyhabtamu
Stata menus
Almost all Stata users use
syntax to run commands
rather than point-and-click
menus
Nevertheless, Stata
provides menus to run most
of its data management,
graphical, and statistical
commands
Example: two ways to
create a histogram
By: Habtamu Legese
12/15/2022 19
https://youtube.com/@economicsbyhabtamu
Do-files are scripts of commands
• Stata do-files are text files where users can store and run their
commands for reuse, rather than retyping the commands into the
Command window
• Reproducibility
• Easier debugging and changing commands

• We recommend always using a do-file when using Stata

• The file extension .do is used for do-files


By: Habtamu Legese
12/15/2022 20
https://youtube.com/@economicsbyhabtamu
Opening the do-file editor
Use the command doedit to
open the do-file editor
Or click on the pencil and
paper icon on the toolbar

The do-file editor is a text file editor


By: Habtamu Legese
specialized for Stata
12/15/2022 21
https://youtube.com/@economicsbyhabtamu
Syntax highlighting
The do-file editor colors Stata
commands blue Comments,
which are not executed, are
usually preceded by * and are
colored green
Words in quotes (file names,
string values) are colored “red”
Stata 16 features an enhanced
editor that features tab auto-
completion for Stata commands
and previously typed words

By: Habtamu Legese


12/15/2022 22
https://youtube.com/@economicsbyhabtamu
Running commands
from the do-file
• To run a command from the
do-file, highlight part or all of
the command, and then hit
Ctrl-D (Mac: Shift+Cmd+D) or
the “Execute(do)” icon, the
rightmost icon on the do-file
editor toolbar
• Multiple commands can be
selected and executed

By: Habtamu Legese


12/15/2022 23
https://youtube.com/@economicsbyhabtamu
Excel
• Available on almost in all computers.

• Excel is a great program for storing and manipulating data.

• Commonly used statistics and methods are NOT available and it can
perform only a few statistical analyses.

• Its lack of functionality makes it difficult to use for more than


computing summary statistics and simple univariate regression.

By: Habtamu Legese


12/15/2022 24
https://youtube.com/@economicsbyhabtamu
Parts of MS Excel

By: Habtamu Legese


12/15/2022 25
https://youtube.com/@economicsbyhabtamu
Excel has many applications:
➢ Sorting and organizing data
➢ Creating visual representations of the ➢Matrix Operations
data o Addition/Subtraction
➢ Addition, Subtraction, Division, o Multiplying
Multiplication of Cells o Inverse
➢ Statistical analysis o Determinant
o Average (Mean)
o Median
o Quartile
o Standard deviation
o t-Test
o Covariance
o Regression
By: Habtamu Legese
12/15/2022 26
https://youtube.com/@economicsbyhabtamu
Example: OLS estimation with Stata, Excel and
Hand Firm (i) Sales (Y ) Advertising Expense (X )
i i

1 11 10
Find
2 10 7
3 12 10
መ 𝛼ො and R
𝛽, 4 6 5
squared 5 10 8
6 7 8
7 9 6
8 10 7
9 11 9
By: Habtamu Legese
10 10 10
12/15/2022
https://youtube.com/@economicsbyhabtamu 27
Excel

By: Habtamu Legese


12/15/2022 28
https://youtube.com/@economicsbyhabtamu
Stata

By: Habtamu Legese


12/15/2022 29
https://youtube.com/@economicsbyhabtamu
Regression by Hand
X i2 96
i Yi Xi X iYi Y = = 9.6
1 11 10 110 100 10
. 2 10 7 70 49 80
X= =8
3 12 10 120 100 10
4 6 5 30 25
ˆ
=  X iYi − nXY
 i
5 10 8 80 64
X 2
− n X 2
6 7 8 56 64
7 9 6 54 36
ˆ 789 − 10(8)(9.6)
= = 0.75
8 10 7 70 49 668 − 10(8) 2

9 11 9 99 81
10 10 10 100 100 ˆ = Y − ˆX
12/15/2022
Ʃ 96 80 789 668
By: Habtamu Legese
https://youtube.com/@economicsbyhabtamu
ˆ = 9.6 − 0.75(8) = 3.6 30
i Yi Xi 𝑋𝑖 − 𝑋ሜ Y−𝑌ሜ 𝑥y 𝑥𝑖2 𝑦𝑖2
1 11 10 2 1.4 2.8 4 1.96
2. 10 7 -1 0.4 -0.4 1 0.16
3 12 10 2 2.4 4.8 4 5.76
4 6 5 -3 -3.6 10.8 9 12.96
5 10 8 0 0.4 0 0 0.16
6 7 8 0 -2.6 0 0 6.76
7 9 6 -2 -0.6 1.2 4 0.36
8 10 7 -1 0.4 -0.4 1 0.16
9 11 9 1 1.4 1.4 1 1.96
10 10 10 2 0.4 0.8 4 0.16
Ʃ 96 80 0 0 By: Habtamu Legese
21 28 30.4
12/15/2022 31
https://youtube.com/@economicsbyhabtamu
By: Habtamu Legese
12/15/2022 32
https://youtube.com/@economicsbyhabtamu
SAS
Software system for data analysis and report writing.

Can store data values and retrieve them, modify data,


compute simple statistics, and create reports all in one
SAS session.

Difference between SAS and most statistical packages is


that SAS incorporates a data-base management system
and a high-level programming language.

By: Habtamu Legese


12/15/2022 33
https://youtube.com/@economicsbyhabtamu
Also SAS software which provides graphics, forecasting,
data entry, and sophisticated statistics.

Designed for use by statisticians, researchers, and


engineers.

Key features: analysis of variance, regression, categorical


data analysis, multivariate analysis, survival analysis,
psychometric analysis, cluster analysis, nonparametric
analysis, survey data analysis.
By: Habtamu Legese
12/15/2022 34
https://youtube.com/@economicsbyhabtamu
R
• R is a free software environment for statistical computing and
graphics.
• R has its own syntax and can operate on any platform Windows,
UNIX, etc.
• R provides a wide range of statistical and graphical techniques.
• R is available as free software under the terms of the Free Software
Foundation’s GNU General Public License in source code form.
• Developed by same individuals that created S-plus
By: Habtamu Legese
12/15/2022 35
https://youtube.com/@economicsbyhabtamu
Minitab
• A computer program designed to perform basic and advanced
statistical functions.
• It combines the user-friendliness of Microsoft Excel with the
ability to perform complex statistical analysis.
• Extensive online help is available at any point of a MINITAB
session. Most tasks can be performed by using menus and
selecting options in dialog boxes.
• However, MINITAB also offers a macro facility that allows
you to write MINITAB routines to automate repetitive tasks.

By: Habtamu Legese


12/15/2022 36
https://youtube.com/@economicsbyhabtamu
SigmaStat 3.5
• Walks you step by step through the analysis of your data
• You don’t need to know which test is right for your data
• Can do regression, ANOVA, non-parametric tests,
correlations, power and sample size calculations, survival
analysis etc.
• Automatically checks your data against assumptions
• Generates written report that interprets your analysis results in
plain English

By: Habtamu Legese


12/15/2022 37
https://youtube.com/@economicsbyhabtamu
StatsDirect
• Easy to use
• Technically advanced
• Comprehensive – broad coverage of methods.
• Workbooks (similar to Excel spreadsheet)
• Import any common spreadsheet data
• Import text based data (formatted or plain)
• Windows metafile scaleable graphics (can edit components in
Word)

By: Habtamu Legese


12/15/2022 38
https://youtube.com/@economicsbyhabtamu
Graphpad Prism
• Powerful combination of basic biostatistics, curve fitting,
and scientific graphing in one comprehensive program.
• Ideally suited to data plotting and analysis applications in the
life sciences.
• Designed for laboratory and clinical researchers.
• Guides you through the analysis process and can provide
guidance when choosing a test and interpretation of results.
• Useful for basic statistical comparisons (t-tests, ANOVA,
nonparametric comparisons) but is not a replacement for a
statistics program.
By: Habtamu Legese
12/15/2022 39
https://youtube.com/@economicsbyhabtamu
SPSS
• Originally it is an acronym of Statistical Package for the
Social Science but now it stands for Statistical Product and
Service Solutions

• One of the most popular statistical packages which can


perform highly complex data manipulation and analysis
with simple instructions.

By: Habtamu Legese


12/15/2022 40
https://youtube.com/@economicsbyhabtamu
Basic structure of SPSS
• There are two different windows in SPSS

• 1st – Data Editor Window - shows data in two forms


• Data view
• Variable view

• 2nd – Output viewer Window – shows results of data analysis

• *You must save the data editor window and output viewer
window separately. Make sure to save both if you want to save
your changes in data or analysis.*

12/15/2022 By: Habtamu Legese https://youtube.com/@economicsbyhabtamu 41


Opening SPSS
•The default window will have the data editor
•There are two sheets in the window:
1. Data view 2. Variable view

12/15/2022 By: Habtamu Legese https://youtube.com/@economicsbyhabtamu 42


Data View window
• The Data View window
This sheet is visible when you first open the Data Editor and this sheet
contains the data
• Click on the tab labeled Variable View

Click

12/15/2022 By: Habtamu Legese https://youtube.com/@economicsbyhabtamu 43


Variable View window
• This sheet contains information about the data set that is stored with the
dataset
• Name
• The first character of the variable name must be alphabetic
• Variable names must be unique, and have to be less than 64 characters.
• Spaces are NOT allowed.

12/15/2022 By: Habtamu Legese https://youtube.com/@economicsbyhabtamu 44


Variable View window: Type
• Type: Click on the ‘type’ box. The two basic types of variables that
you will use are numeric and string. This column enables you to
specify the type of variable.

12/15/2022 By: Habtamu Legese https://youtube.com/@economicsbyhabtamu 45


Variable View window: Width
•Width
•Width allows you to determine the number of characters
SPSS will allow to be entered for the variable

12/15/2022 By: Habtamu Legese https://youtube.com/@economicsbyhabtamu 46


Variable View window: Decimals
• Decimals
• Number of decimals
• It has to be less than or equal to 16

3.14159265

12/15/2022 By: Habtamu Legese https://youtube.com/@economicsbyhabtamu 47


Variable View window: Label
• Label
• You can specify the details of the variable
• You can write characters with spaces up to 256 characters

12/15/2022 By: Habtamu Legese https://youtube.com/@economicsbyhabtamu 48


Variable View window: Values
•Values
•This is used and to suggest which numbers represent which
categories when the variable represents a category

12/15/2022 By: Habtamu Legese https://youtube.com/@economicsbyhabtamu 49


Defining the value labels
•Click the cell in the values column as shown below
•For the value, and the label, you can put up to 60 characters.
•After defining the values click add and then click OK.

Click

12/15/2022 By: Habtamu Legese https://youtube.com/@economicsbyhabtamu 50


EViews
• EViews is an easy-to-use statistical, econometric, and
economic modeling package.
• There are three ways to work in EViews:
• Graphical user interface (using mouse and
menus/dialogs).
• Single commands (using the command window).
• Program files (commands assembled in a script executed
in batch mode).

By: Habtamu Legese


12/15/2022 51
https://youtube.com/@economicsbyhabtamu
EViews Desktop

Command
Window

Object
Window/
Work Area

By: Habtamu Legese


12/15/2022 52
https://youtube.com/@economicsbyhabtamu
EViews Desktop Details
Main Menu

Note: Path/Database/Workfile
Path/directory Database Workfile
can be changed by double-clicking in
each .
12/15/2022
By: Habtamu Legese
https://youtube.com/@economicsbyhabtamu
53
Thank You
https://youtube.com/@economicsbyhabtamu

By: Habtamu Legese


12/15/2022 54
https://youtube.com/@economicsbyhabtamu

You might also like