Professional Documents
Culture Documents
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Introduction to STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
1 2
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
1 2 3
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
1 2 3 4
Introduction to STATA Getting Stated With STATA Data Management Elementary Data Analysis
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
1 2 3 4 5
Introduction to STATA Getting Stated With STATA Data Management Elementary Data Analysis Multiple Regression
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
1 2 3 4 5 6
Introduction to STATA Getting Stated With STATA Data Management Elementary Data Analysis Multiple Regression Curve Fitting and Logistic Regression
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
1 2 3 4 5 6 7
Introduction to STATA Getting Stated With STATA Data Management Elementary Data Analysis Multiple Regression Curve Fitting and Logistic Regression Multivariate Methods
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
1 2 3 4 5 6 7 8
Introduction to STATA Getting Stated With STATA Data Management Elementary Data Analysis Multiple Regression Curve Fitting and Logistic Regression Multivariate Methods Time Series Analysis
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
The software STATA is a statistical analysis package for standard and specialized estimation procedures. STATA is actually very easy and intuitive to use once you get used to its jargons and formats. The syntax of the commands can be readily learned, perhaps more easily than other statistical packages syntax. STATA has both a command driven interface and a graphical user interface (GUI), that is, point and click features. With its command driven interface, actions are set o by commands which can be issued either in interactive or batch mode.
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Interactive Mode
With the interactive mode, users can issue commands line by line and yield results after each command line is issued. Commands are also retrieved with the Page-Upand Page-Down keys or retrieved from the list of previous commands. With the batch mode, users can run a set of commands and have the results all saved into a le or shown on the screen. Whether one runs commands via interactive or batch mode, documentation of the data management and analysis is easy to do in contrast to working with spreadsheets.
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
STATA is oered in three versions: Small Intercooled Stata Special Edition (SE)
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
STATA is oered in three versions: Small Intercooled Stata Special Edition (SE) SMALL Version SMALL is student version, limited in the number of variables - 99 variables only, and 1000 observations or cases, but otherwise complete in functionality.
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
STATA Versions
Intercooled Version The Intercooled Version is the standard version. It supports up to 2,047 variables in a data set, with the number of observations limited by available RAM ( technically, as large as 2.147 billion), as the entire data set is held in memory. Intercooled allows matrices up to 800 rows or columns.
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
STATA Versions
Intercooled Version The Intercooled Version is the standard version. It supports up to 2,047 variables in a data set, with the number of observations limited by available RAM ( technically, as large as 2.147 billion), as the entire data set is held in memory. Intercooled allows matrices up to 800 rows or columns. Special Edition The Special Edition or SE version arose during the life of version 7.0 in response to users needs for analyzing much larger data sets. Thus, SE allows signicantly more variables in the data set (32,767) and supports larger matrices (up to 11,000 rows or columns).
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
STATA is designed for research. STATA provides vivid exchange of ideas and experiences among its users largely among users from academics, research and government institutions, as well as international organizations while other statistical software such as SPSS increasingly targets the business world.
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
STATA is designed for research. STATA provides vivid exchange of ideas and experiences among its users largely among users from academics, research and government institutions, as well as international organizations while other statistical software such as SPSS increasingly targets the business world. It can incorporate a sample survey design into the estimation process
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
STATA is designed for research. STATA provides vivid exchange of ideas and experiences among its users largely among users from academics, research and government institutions, as well as international organizations while other statistical software such as SPSS increasingly targets the business world. It can incorporate a sample survey design into the estimation process It has a very powerful set of facilities for handling panel/longitudinal data, for survival analysis and for working with time series data.
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
To start a STATA session, perform either of the following three procedures: double click the STATA icon in your desktop.
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
To start a STATA session, perform either of the following three procedures: double click the STATA icon in your desktop. nd the Windows START button at bottom left corner of the screen; click on this button. Then click on PROGRAMS STATA STATASE (Intercooled or Small)
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
To start a STATA session, perform either of the following three procedures: double click the STATA icon in your desktop. nd the Windows START button at bottom left corner of the screen; click on this button. Then click on PROGRAMS STATA STATASE (Intercooled or Small) Use the Windows explorer to navigate across the STATA version and nd the button of the executable le eg wsestata. Double click on this button.
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
2.3 Menu and Toolbars The menu and toolbar can be used to issue dierent STATA commands, although most of the time it is more convenient to use the STATA Command window to perform those tasks.
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
2.3 Menu and Toolbars The menu and toolbar can be used to issue dierent STATA commands, although most of the time it is more convenient to use the STATA Command window to perform those tasks. GUI The Graphical User Interface allows users to directly perform data management using the Data menu, obtain some data analysis with the Statistics menu, or generate all sorts of graphs on the data set with the Graphics menu, with its point and click features.
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Click on FILE then EXIT Press ALT and F4 keys simultaneously Click on the Close (X) button on the uppermost right hand corner of the screen, or
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Click on FILE then EXIT Press ALT and F4 keys simultaneously Click on the Close (X) button on the uppermost right hand corner of the screen, or Type exit on the Command line window
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Options
CONTENTS Option The Contents option can be used by beginners unfamiliar with STATA commands while the Search option can be used by users who know the name of the command or topic they wish to search.
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
The command sysuse dir [, all] list example datasets installed with STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
The command sysuse dir [, all] list example datasets installed with STATA The command set memory allows the user to increase or decrease the amount of memory allocated to STATA by the operating system while STATA is running. The syntax is given by set memory number[bkmg] [, permanently] permanently species that in addition to making the change right now, the memory setting be remembered and become the default setting when you invoke STATA.
DLPolestico STAT 325 STATISTICAL ANALYSIS WITH STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
There are a number of tasks that can be done when examining STATA dataset in active memory:
1
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
There are a number of tasks that can be done when examining STATA dataset in active memory:
1 2
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
There are a number of tasks that can be done when examining STATA dataset in active memory:
1 2 3
determining the number of observations obtaining a brief description of the data perform some simple data analysis including obtaining summary statistics, listing some data, obtaining tables,and crosstabulations, etc
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
There are a number of tasks that can be done when examining STATA dataset in active memory:
1 2 3
determining the number of observations obtaining a brief description of the data perform some simple data analysis including obtaining summary statistics, listing some data, obtaining tables,and crosstabulations, etc perform some basic data management such sorting, dropping some variables, or sampling from the database
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Useful Commands
describe The describe command results to a brief description of the dataset in active memory. The syntax is describe [ varlist ] [, memory options] where memory options could be simple, short, detail, fullnames, and numbers. Alternatively using the menu or header bar, Data Describe Data Describe Variables in Memory .
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
count
count The count command is used to tally the number of observations in the dataset. It can be used with if-conditions to restrict the output to subsets of the dataset. The syntax is given by count [if] [in] by is also permitted, however before using the by option, the variable to be used should be sorted rst. For example in the auto data, count if rep78 > 4 by foreign: count if rep78 > 4
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
count
count The count command is used to tally the number of observations in the dataset. It can be used with if-conditions to restrict the output to subsets of the dataset. The syntax is given by count [if] [in] by is also permitted, however before using the by option, the variable to be used should be sorted rst. For example in the auto data, count if rep78 > 4 by foreign: count if rep78 > 4 ds and codebook Exercise: Explore the use of the commands ds and codebook
DLPolestico STAT 325 STATISTICAL ANALYSIS WITH STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Commands...
summarize, inspect The inspect command provides a quick summary of the data characteristics that will allow the user to become more familiar with the data, while the summarize command yields some preliminary analysis of the data through some summary statistics. The syntax are as follows: summarize [varlist] [if] [in] [weight] [,options] inspect [varlist] [if] [in] where options could be detail, meanonly, format, or separator(number). Examples are:
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Commands...
summarize, inspect The inspect command provides a quick summary of the data characteristics that will allow the user to become more familiar with the data, while the summarize command yields some preliminary analysis of the data through some summary statistics. The syntax are as follows: summarize [varlist] [if] [in] [weight] [,options] inspect [varlist] [if] [in] where options could be detail, meanonly, format, or separator(number). Examples are: 1 summarize
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Commands...
summarize, inspect The inspect command provides a quick summary of the data characteristics that will allow the user to become more familiar with the data, while the summarize command yields some preliminary analysis of the data through some summary statistics. The syntax are as follows: summarize [varlist] [if] [in] [weight] [,options] inspect [varlist] [if] [in] where options could be detail, meanonly, format, or separator(number). Examples are: 1 summarize
2
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Commands...
summarize, inspect The inspect command provides a quick summary of the data characteristics that will allow the user to become more familiar with the data, while the summarize command yields some preliminary analysis of the data through some summary statistics. The syntax are as follows: summarize [varlist] [if] [in] [weight] [,options] inspect [varlist] [if] [in] where options could be detail, meanonly, format, or separator(number). Examples are: 1 summarize
2 3
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Commands...
summarize, inspect The inspect command provides a quick summary of the data characteristics that will allow the user to become more familiar with the data, while the summarize command yields some preliminary analysis of the data through some summary statistics. The syntax are as follows: summarize [varlist] [if] [in] [weight] [,options] inspect [varlist] [if] [in] where options could be detail, meanonly, format, or separator(number). Examples are: 1 summarize
2 3 4
summarize mpg weight summarize mpg weight if foreign summarize mpg weight if foreign, detail
DLPolestico STAT 325 STATISTICAL ANALYSIS WITH STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Commands...
Tabulate and table commands The tabulate command is useful for obtaining frequency tables. The plot option can be added to make a plot to visually show the tabulated values. e.g. tabulate foreign or tabulate rep78, plot
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Commands...
Tabulate and table commands The tabulate command is useful for obtaining frequency tables. The plot option can be added to make a plot to visually show the tabulated values. e.g. tabulate foreign or tabulate rep78, plot The tab1 command can be used as a shortcut to request tables for a series of variables, instead of typing the tabulate command over and over again. e.g. tab1 foreign rep78
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Commands...
Tabulate and table commands The tabulate command is useful for obtaining frequency tables. The plot option can be added to make a plot to visually show the tabulated values. e.g. tabulate foreign or tabulate rep78, plot The tab1 command can be used as a shortcut to request tables for a series of variables, instead of typing the tabulate command over and over again. e.g. tab1 foreign rep78 The command tabulate rowvar columnvar [, options] produces a cross tabulation of the two named variables. The column option requests column percentages. The nofreq option suppresses the frequencies and focuses only on the percentages. tabulate rep78 foreign, column nofreq
DLPolestico STAT 325 STATISTICAL ANALYSIS WITH STATA
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Saving a Dataset
Exercise: Explore with the command
1
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Saving a Dataset
Exercise: Explore with the command
1 2
TITLE PAGE CONTENTS of the Course Introduction to STATA Getting Started with STATA
Saving a Dataset
Exercise: Explore with the command
1 2
save, replace The save command saves data in memory to a le. The syntax is save [lename] [, save options] The replace option overwrites the existing dataset. Specifying a dierent lename after the save command saves the data onto a new le, without losing the original version of the data.