Intro To Stata 2022
Intro To Stata 2022
Introduction to
Softwares
Debark University
Department of Economics
Introduction
Currently the dynamic nature of the world leads
to question among people in their daily lives.
To answer these questions, the collection,
organization, analysis and interpretation of data is
critical.
Data are the information that you collect to learn,
draw conclusions, and test hypotheses.
This data can be collected and stored in numerous
ways, depending on
the type of data,
source & context,
study design,
data volume & turnaround time and
data security.
Cont.…
The field of economic statistics and econometrics
is rapidly changing.
Increasing data availability combined with
powerful computing and advanced software
allows research to address issues of statistical
inference and analysis in innovative ways.
Statistical skills enable you to intelligently
collect, analyze and interpret data relevant to
decision-making.
Cont.…
Some of the software
packages for analysis and
collection of data
INTRODUCTION TO
STATA
What is Stata?
Stata is a general purpose Statistical software
package which is created in 1985 by economists
Stata is a statistical analysis package, used for
exploring, graphing, summarizing and
manipulating data files.
The word Stata is a combination of the words
`statistics' and `data.'
Stata is not an acronym and should not appear all
letters capitalized.
Cont..
Stata is an integrated statistical analysis
packaged designed for research professionals and
handling and manipulating large data sets.
It is a multi-purpose statistical package to help
you explore, summarize and analyze datasets.
Stata utilizes command line interface so users
can type commands to perform specific tasks.
Users can also run commands in batch using a
do-file.
Cont..
In addition, Stata has menus and dialog boxes
that give the user access to nearly all built-in
commands.
Stata is case-sensitive; thus, it distinguishes
between lower and upper case letters.
Most Stata built-in commands are lower case, a
convention most programmers follow.
Cont..
Forms or ‘flavors’ of Stata
There are 4 flavors':
STATA MP (multi-processor) which is the most powerful
STATA SE (special edition) extended
STATA IC (Intercooled)
Small STATA
Manipulate as needed
Analyze
“Data”
A set of numbers and/or text describing
specific phenomena
Mortality, drug effectiveness, economy,
weather, traffic, pollution levels, etc.
History
Variable
s
Results
Command line
interface
Windows Cont’d
Each of the Stata windows can be resized
and moved around in the usual way
To bring a window forward that may be
obscured by other windows, make the
appropriate selection in the Window
menu.
Ways to use Stata
Point & click
Always rectangular:
Stata file types
Stata uses and creates many types of files, which are
distinguished by extensions at the end of the filename. The
extensions used by Stata are
.ado Programs that add commands to Stata, such as the
SPost commands.
.do Batch files that execute a set of Stata commands.
.dta Data files in Stata’s format.
.gph Graphs saved in Stata’s proprietary format.
.hlp The text displayed when you use the help command.
For example, fitstat.hlp has help for fitstat.
.log Output saved as plain text by the log using command.
Loading data into Stata
The dataset may be viewed as a spreadsheet by opening the
Data Browser with the button and edited by clicking to open
the Data Editor
Stata command:
use file path/file name.dta, clear
e.g. use "C:\Users\Malede\Desktop\data.dta", clear
A command is typed in the Stata Command window and
executed by pressing the Return (or Enter) key.
working directory: using data, saving data, or logging output.
type cd in the Command Window and to change use: cd "C:\Users\Malede\
Desktop"
Do-files
Double click
Editor window
Log files
log allows you to make a full record of your Stata session. A
log is a file containing what you type and Stata's output.
At the beginning of a Stata session, Press the
button , type a filename into the dialog box, and choose
Save.
By default, this produces a SMCL (Stata Markup and
Control Language, pronounced ‘smicle’) file with
extension .smcl, but an ordinary ASCII text file can be
produced by selecting the .log extension.
Log files can also be opened, viewed, and closed by
selecting Log from the File menu, followed by Begin...,
View..., or Close.
log using mylog, replace
log using mylog2, name(mylog2)
. log using firstfile, name(log1) text
Data Analysis
summarize Statistical Analysis
correlate
regress
graph
predict
two way, scatter,…
hist
test
dwstat
hettest
Comments and Notes
Stata treats lines that begin with an asterisk * or are
located between a pair of /* and */ as comments that are
simply echoed to the output
If a command continues over two lines, we use /* at the
end of the first line and */ at the beginning of the second
line to make Stata ignore the line break.