INTRODUCTION TO STATA Võ Tuấn Khoa Trần Thế Trung.

Slides:



Advertisements
Similar presentations
10. NLTS2 Documentation Overview. 1 Prerequisites Recommended modules to complete before viewing this module  1. Introduction to the NLTS2 Training Modules.
Advertisements

Statistical Methods Lynne Stokes Department of Statistical Science Lecture 7: Introduction to SAS Programming Language.
Apr-15H.S.1Apr-15H.S.1 Stata Introduction, Short v2 Hein Stigum Presentation, data and programs at: courses.
Chapter 3: Editing and Debugging SAS Programs. Some useful tips of using Program Editor Add line number: In the Command Box, type num, enter. Save SAS.
Tutorial 8: Developing an Excel Application
Generating new variables and manipulating data with STATA Biostatistics 212 Lecture 3.
Introduction to SAS Programming Christina L. Ughrin Statistical Software Consulting Some notes pulled from SAS Programming I: Essentials Training.
Introduction to Objective-C and Xcode (Part 1) FA 175 Intro to Mobile App Development.
Ann Arbor ASA ‘Up and Running’ Series: SPSS Prepared by volunteers of the Ann Arbor Chapter of the American Statistical Association, in cooperation with.
Generating new variables and manipulating data with STATA Biostatistics 212 Lecture 3.
Slides prepared by Rose Williams, Binghamton University Chapter 1 Getting Started 1.1 Introduction to Java.
Introduction to Statistical Computing in Clinical Research Biostatistics 212 Course director: Mark Pletcher Teaching Assistant: Lee Zane.
A Simple Guide to Using SPSS© for Windows
Stata Introduction Sociology 229A, Class 2 Copyright © 2008 by Evan Schofer Do not copy or distribute without permission.
Guide To UNIX Using Linux Third Edition
Generating new variables and manipulating data with STATA Biostatistics 212 Session 2.
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
Introduction to Unix (CA263) Introduction to Shell Script Programming By Tariq Ibn Aziz.
Getting Started with your data
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.
Introduction to SPSS Short Courses Last created (Feb, 2008) Kentaka Aruga.
Introduction to SPSS (For SPSS Version 16.0)
1 Macros Presented by Maria G. Martinez. 2 What's a macro?  Macro - set of computer instructions that you can record and associate with a shortcut key.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
A First Program Using C#
1 CCPR Computing Services Introduction to Stata Courtney Engel October 26, 2007.
L1: INTRODUCTION Getting started with Stata Angela Ambroz May 2015.
0 UMN 2011 ERP Terapan ABAP Introduction Session # 8.
JavaScript, Fifth Edition Chapter 1 Introduction to JavaScript.
1 CCPR Computing Services Workshop: Introduction to Stata June, 2006.
Introduction to Shell Script Programming
Session I How to use STATA & Basic Data Management Commands.
PMS /134/182 HEX 0886B6 PMS /39/80 HEX 5E2750 PMS /168/180 HEX 00A8B4 PMS /190/40 HEX 66CC33 By Adrian Gardener Date 9 July 2012.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Using SPSS for Windows Part II Jie Chen Ph.D. Phone: /6/20151.
Introduction to SAS. What is SAS? SAS originally stood for “Statistical Analysis System”. SAS is a computer software system that provides all the tools.
API-208: Stata Review Session Daniel Yew Mao Lim Harvard University Spring 2013.
Math 3400 Computer Applications of Statistics Lecture 1 Introduction and SAS Overview.
Matlab Basics Tutorial. Vectors Let's start off by creating something simple, like a vector. Enter each element of the vector (separated by a space) between.
Output Design. Output design  Output can be: Displayed on a screen/VDU/monitor. Printed on paper as hard copy. Sound.
Introduction to Programming with RAPTOR
Introduction to Statistical Computing in Clinical Research Biostatistics 212.
Introduction to Enterprise Guide Jennifer Schmidt Rhonda Ellis Cassandra Hall.
A Simple Guide to Using SPSS ( Statistical Package for the Social Sciences) for Windows.
Algorithms  Problem: Write pseudocode for a program that keeps asking the user to input integers until the user enters zero, and then determines and outputs.
Confidential ACL Functions Corporate Audit Services Technology Solutions Team Charlene Vallandingham and Jack Hauschild September 29, 2008.
Chapter 5 Reading and Manipulating SAS ® Data Sets and Creating Detailed Reports Xiaogang Su Department of Statistics University of Central Florida.
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
DTC Quantitative Methods Summary of some SPSS commands Weeks 1 & 2, January 2012.
Computing with SAS Software A SAS program consists of SAS statements. 1. The DATA step consists of SAS statements that define your data and create a SAS.
Chapter 6 Concatenating SAS Data Sets and Creating Summary Reports Xiaogang Su Department of Statistics University of Central Florida.
Today Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with Stata – Estimation – GOF.
1 PEER Session 02/04/15. 2  Multiple good data management software options exist – quantitative (e.g., SPSS), qualitative (e.g, atlas.ti), mixed (e.g.,
Topics Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with Stata – Estimation –
Javascript Basic Concepts Presentation By: Er. Sunny Chanday Lecturer CSE/IT RBIENT.
Analyzing Data. Learning Objectives You will learn to: – Import from excel – Add, move, recode, label, and compute variables – Perform descriptive analyses.
Topics Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with Stata – Estimation –
LINGO TUTORIAL.
Introduction to the SPSS Interface
Getting started with Stata
Computer 4 JEOPARDY Bobbie, Sandy, Trudy.
Econometrics 704 Emilio Cuilty
Introduction Introduction to Stata 2016.
Objectives This is an introduction to the statistical software STATA aiming at: Preparing the participants in STATA basics (interphase and commands) for.
Stata Basic Course Lab 2.
Presentation, data and programs at:
A Brief Introduction to Stata(2)
Introduction to the SPSS Interface
Presentation transcript:

INTRODUCTION TO STATA Võ Tuấn Khoa Trần Thế Trung

Stata basics command-driven or menu-driven software modeling complex data from longitudinal studies or surveys  deal for analyzing results from clinical trials or epidemiological studies provides a powerful programming language

Stata interface in Window

Stata command The basic language syntax for STATA commands is [by varlist:] command [varlist] [=exp] [if exp] [in range] [weight] [using filename] [, options] where the elements between brackets are optional.

Stata command [by varlist:] instructs Stata to repeat the command for each combination of values in the list of variables varlist. [command] is the name of the command and can be abbreviated; for example, the command display can be abbreviated as dis. [varlist] is the list of variables to which the command applies. [=exp] is an expression. [if exp] restricts the command to that subset of the observations that satisfies the logical expression exp. [in range] restricts the command to those observations whose indices lie in a particular range. [weight] allows weights to be associated with observations [using filename] specifies the filename to be used. [options] are specific to the command and may be abbreviated.

Stata command Example 1 –Stata Command:.bysort black: summarize age if year >= 80, detail –Results: Summarizes age separately for different values of black, including only observations for which year >= 80, includes extra detail.

Stata command Example 2 –Stata Commands:.generate agelt30 = age.replace agelt30 = 1 if age < 30.replace agelt30 = 0 if age >= 30 & age <. –Result: variable agelt30 set equal to 1, 0, or missing –Generally [= exp] used with commands generate and replace

Stata command Click Help / Stata command Type key word (Ex: summarize) See details

Do Files and Log Files A do file is a text file with STATA code that STATA runs line by line, as if the sentences where written in the STATA command window. A log file is a text file with all the results that appear in the STATA results window. –the user selects when to start and when to stop logging to the log file

Variable name Have up to 32 characters but shorter names are easy to type Stata names are case sensitive (age≠Age) Should: –short lowercase –single word –underscore to separate word effort fpe family_planning_effort familyplanningeffort

Variable type Nummeric variable String variable Missing value –numberic: dot (.) –string: “”

Some Basic Commands computing basic statistics –summarize ypc –summarize ypcf [w=popwt] –summarize ylab [w=popwt] if age >=25 & and age <=55 generate new variables –generate ypc2 = ypc^2 tabulate data –table skill [w=popwt], c(mean ylab)

Some Basic Commands renaming variables –rename ypc2 ypcf22 eliminating variables –drop ypc22 replacing values –replace male=0 if male==1

Open data from Excel format Import data from excel file

Open data from Excel format

Review data

Starting descriptive analysis

Output Window