A Brief Introduction to Stata(1). 1. Getting Started.

Slides:



Advertisements
Similar presentations
1 SESSION 6 Using tables and graphs in project work.
Advertisements

File management GAP Toolkit 5 Training in basic drug abuse data management and analysis Training session 2.
XP New Perspectives on Introducing Microsoft Office 2003 Tutorial 1 1 Using Common Features of Microsoft Office 2003 Tutorial 1.
ITEC 1001 Tutorial 1 Using Common Features of Microsoft Office 2003.
The SAS ® System Additional Information on Statistical Analysis Programming.
Microsoft Excel. Click on “Start,” then “Microsoft Office Excel.”
Stata and logit recap. Topics Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with.
Excel Lesson 1 Microsoft Excel Basics
Loading Excel Double click the Excel icon on the desktop (if you have this) OR Click on Start All Programs Microsoft Office Microsoft Office Excel 2003.
Excel Tutorial 1 Getting Started with Excel
Understanding Microsoft Excel
Objectives 1.Identify the functions of a spreadsheet 2.Identify how spreadsheets can be used. 3.Explain the difference in columns and rows. 4.Locate specific.
Introduction to Windows File Management
Access - Project 1 l What Is a Database? –A Collection of Data –Organized in a manner to allow: »Access »Retrieval »Use of That Data.
1 An Introduction to IBM SPSS PSY450 Experimental Psychology Dr. Dwight Hennessy.
XP New Perspectives on Microsoft Office Excel 2003, Second Edition- Tutorial 6 1 Microsoft Office Excel 2003 Tutorial 6 – Working With Multiple Worksheets.
European Computer Driving Licence
Chapter 1 Introduction to Spreadsheet. Agenda Download the practice files Spreadsheet application Workbook and worksheet Toolbar Cell Formatting Printing.
XP 1 Using Common Features of Microsoft Office 2003 Rod Rodrigues.
XP Using Common Features of Microsoft Office Tutorial 1.
SPSS 1: An Introduction to the Statistical Package SPSS Suzie Cro MRC Clinical Trials Unit.
SPSS Statistical Package for the Social Sciences is a statistical analysis and data management software package. SPSS can take data from almost any type.
RIMS II Online Order and Delivery System Tutorial on Downloading and Viewing Multipliers.
Moving data on the worksheet Copying and Pasting Data, Slide 1Copyright © 2004, Jim Schwab, University of Texas at Austin Like other windows applications,
File Management and Organisation © Copyright William Rowan 2007.
Microsoft Visual Basic 2005 CHAPTER 12 Cell Phone Applications and Web Services.
I Can… Define basic file management and related terms Identify levels of a file system Identify and explain ways to view files in Windows OS Explain the.
Lesson 1 – Microsoft Excel The goal of this lesson is for students to successfully explore and describe the Excel window and to create a new worksheet.
XP New Perspectives on Introducing Microsoft Office XP Tutorial 1 1 Introducing Microsoft Office XP Tutorial 1.
EC501 Gabriella Conti University of Essex
CHAPTER 13 Creating a Workbook Part 1. Learning Objectives Understand spreadsheets and Excel Enter data in cells Edit cell content Work with columns and.
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
XP New Perspectives on Integrating Microsoft Office XP Tutorial 2 1 Integrating Microsoft Office XP Tutorial 2 – Integrating Word, Excel, and Access.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
1 The EDIT Program The Edit program is a full screen text editor that allows you to: Create text files Create text files Edit an existing text files Edit.
Teacher’s Assessment Assistant Worksheet Builder Starting the Program
File Management Presented to The Glades Computer Club January 4, 2001.
Cell Alignment By default, text is left aligned and values are right aligned. You can also adjust vertical alignment.
Windows Tutorial Common Objects ACOS: 1, 4. Using the Taskbar 1. Using the taskbar, you can switch between open programs and between open documents within.
Chapter 1: Introduction to SAS  SAS programs: A sequence of statements in a particular order  Rules for SAS statements: –Every SAS statement ends in.
Introduction to SAS Essentials Mastering SAS for Data Analytics
Excel Lesson 1 Excel Basics
WINKS 7 Tutorial 7 – Advanced Topic: Labels and Formats Permission granted for use for instruction and for personal use. © Alan C. Elliott,
A Simple Guide to Using SPSS ( Statistical Package for the Social Sciences) for Windows.
Lesson 1 – Microsoft Excel * The goal of this lesson is for students to successfully explore and describe the Excel window and to create a new worksheet.
SPSS- Tutorial The following power-point slides show you how to use some of the features in SPSS. A survey of 20 randomly selected companies asked them.
Chapter Three The UNIX Editors.
Fall 2003Sylnovie Merchant, Ph.D. ACCESS Tutorial Note: The purpose of this tutorial is to provide an introduction to some of the functions of ACCESS in.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 7 1 Microsoft Office FrontPage 2003 Tutorial 8 – Integrating a Database with a FrontPage.
1 Excel Lesson 1 Microsoft Excel Basics Microsoft Office 2010 Pasewark & Pasewark.
Understanding Microsoft Excel Lesson 1 – Microsoft Excel 2013.
Introducing Dreamweaver. Dreamweaver The web development application used to create web pages Part of the Adobe creative suite.
1 Excel Lesson 1 Microsoft Excel Basics Microsoft Office 2010 Introductory Pasewark & Pasewark.
Today We Will Review: Operating Systems (Windows) (week 3 & 4) Starting up MS Windows Desktop and its contents Functions of the desktop components Brain.
XP New Perspectives on Creating Web Pages With Word Tutorial 1 1 Creating Web Pages With Word Tutorial 1.
Pasewark & Pasewark 1 Excel Lesson 1 Excel Basics Microsoft Office 2007: Introductory.
Understanding Microsoft Excel
Using a set-up file to read ASCII data into Stata
Understanding Microsoft Excel
Understanding Microsoft Excel
International Computer Driving Licence Syllabus version 5.0
Microsoft Excel Basics
ECONOMETRICS ii – spring 2018
Understanding Microsoft Excel
Windows Internet Explorer 7-Illustrated Essentials
Chapter 1: Introduction to SAS
Stata Basic Course Lab 2.
Understanding Microsoft Excel
Presentation transcript:

A Brief Introduction to Stata(1)

1. Getting Started

 1.1 Starting STATA  1.2 Running Stata  1.3 Open and Save Datasets in Stata  1.4 Exiting STATA  1.5 Getting help and information  1.6 Notes on STATA Commands  1.7. Entering Data into STATA

1.1 Starting STATA  Start a STATA session by performing either of the following three procedures:  double-click the STATA icon in your desktop.  find the STAR button.  Use Windows Explorer to navigate across the STATA8 folder and find the button of the executable file named wsestata. Double click on this button.

STATA 的用户界面 菜单和工具栏 已执行过的 命令窗口 变量窗口 结果输出窗口 命令窗口

STATA windows  Stata Command  Stata Results  Review  Variables

1.2 Running Stata  A command may be typed in the Stata Command window and executed by press the Enter key.  Stata running can be interrupted by holding down Ctrl and pressing Pause/Break key.

 It is good to open a log_file, press the button or use ‘.log using filename ’. When you want to close the file,use ‘.log close ’.  Append onto the end of the current log. Type.log using myses, append.  Discard the old log and replace it with the new one. Type.log using myses, replace.  The first choice is probably the best.

 You can find out what directory you're in by typing. pwd F:\StataStuff  If you wanted to make a dirctory on the F drive using Stata, type:. cd F:\ F:\

Do-file  Do-file editor  Running do-file Button Do dofile

Data editor  Data Browser  Data Editor Rows represent obserbvation. Columns represent variables.

1.3 Open and Save Datasets in Stata  Stata has its own data format with default extension.dta.

Open a data file  If the file is in the current directory, .Use filename  If the data are not stored in the current directory, .use c:\user\data  Or .use c:\user\data,clear  In the first form, use filename says to load the data, but Stata will refuse if (1) there is something in memory and (2) that something has not been saved on disk.

 If the memory allocated to STATA (which is 1,000K or 1M by default) is too little for the data file to be opened we will see an error message like the following:. use hh no room to add more observations r(901);  The following commands allocate 30M to STATA and then tries again to open the file:. set memory 30m. use hh  If you continue to get an error message, you can try 40m or 50m.

 Another important thing to remember is that the memory allocation command (set memory 30m for example) works only if no data set is open. Otherwise you will get following error message:.use hh.set memory 30m no; data in memory would be lost r(4);  You can clear the memory using one of the two commands: clear or drop _all.

Save a data file  To save, type:. save 1998Data. save 1998Data, replace. Save,replace  Without the replace option, the file must not already exist. If it does, Stata will refuse to overwrite it.  With the replace option, the file may exist or not. If the file does exist, it will be overwritten.

.cd c:\user\data .use bank .save bank

1.4 Exiting STATA  Stata may be exited in three ways: Click into the Close button Select the File menu from the menu bar and select Exit Type. Exit or. exit, clear in the Stata command windows and press return.

 if you have an unsaved data set open, STATA will issue the following error message:. exit no; data in memory would be lost r(4);  To remedy this problem you can save the data file and then issue the exit command. If you really want to exit STATA without saving the data file: . exit, clear

1.5 Getting help and information  Stata's help system consists of two commands: 1).help 2).search  You use help when you know the name of the Stata command on which you want information. This command only works if you type the full command name or keyword unabbreviated.

 If you can not recall the full command name or keyword, or you are not sure about which command you want you can use the command lookup or search followed by the command name or keyword.. search mem  The STATA website (http: // com) has excellent help facilities, for example, Online Tutorial, Frequently Asked Questions (FAQ), etc.http: // com

1.6 Notes on STATA Commands  STATA commands are typed in lower case.  All names, including commands or variable names, can be abbreviated as long as there is no ambiguity.  e.g..describe.des

 To display the previous command in Stata Command window, you can press Page- Up key. You can keep doing that until the first command of the session appears. Similarly, the Page-Down key displays the command that follows the currently displayed command in the Stata Command window.

1.7. Entering Data into STATA  the simplest way is to enter data directly into STATA ’ s spreadsheet-like Data Editor window. The nineth button. edit  Note that data from spreadsheets can also be copied and pasted into the Editor.

 you can entering data variable-by-variable with the TAB key; or observation-by- observation with the ENTER key.  a missing value is coded as a period “. ”  numerical values should not include commas; otherwise STATA considered these values as string.

 string variable values can nearly be almost any combination of letters, numbers, and symbols up to 80 characters in length for Intercooled/ Small and up to 244 characters in length for STATA/SE. t_stata.htm  variable names can be changed by double clicking anywhere in the variable ‘ s column resulting in a dialogue box. It is suggested that variable names should have 8 characters.

Reading different types of datafile  Using Stata transfer  Other ways  read data into STATA from ASCII files and worksheets, We can use the infile command. cd c:\intropov\data. infile domain hcn age using try.txt

 use the infix command. clear. infix domain 1 hcn 2 age 3-4 using try2.txt  Excel worksheets such as the.xls file can also be read into STATA. However, we have to first read the file with Excel, and convert the file into a comma-delimited file, i.e., click on File, Save AS, and choose as file type CSV. Then, enter . insheet using filename.csv, clear

Review  Ctrl + Pause/Break .log using myses, append . pwd . cd F:\  use c:\user\data,clear  set memory 30m . save 1998Data, replace . Save,replace

. exit .help .search .describe .des .edit .infile .infix .insheet