L1: INTRODUCTION Getting started with Stata Angela Ambroz May 2015.

Slides:



Advertisements
Similar presentations
MICS4 Data Processing Workshop Multiple Indicator Cluster Surveys Data Processing Workshop SPSS general commands Overview.
Advertisements

Introduction to Programming using Matlab Session 2 P DuffourJan 2008.
Do files, log files, and workflow in Stata Biostatistics 212 Lecture 2.
Stata and logit recap. Topics Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with.
FORTRAN Short Course Week 1 Kate T-C February 17, 2008.
Generating new variables and manipulating data with STATA Biostatistics 212 Lecture 3.
Introduction to SPSS Allen Risley Academic Technology Services, CSUSM
INTRODUCTION TO STATA Võ Tuấn Khoa Trần Thế Trung.
Generating new variables and manipulating data with STATA Biostatistics 212 Lecture 3.
“Working with Fractions” A Review of Addition and Subtraction CLICK HERE TO BEGIN.
Introduction to Statistical Computing in Clinical Research Biostatistics 212 Course director: Mark Pletcher Teaching Assistant: Lee Zane.
CIS101 Introduction to Computing Week 11. Agenda Your questions Copy and Paste Assignment Practice Test JavaScript: Functions and Selection Lesson 06,
Stata Introduction Sociology 229A, Class 2 Copyright © 2008 by Evan Schofer Do not copy or distribute without permission.
Introduction to a Programming Environment
Generating new variables and manipulating data with STATA Biostatistics 212 Session 2.
Introduction to Python: Slides Referenced in Homework 0 CSE-391: Artificial Intelligence University of Pennsylvania Matt Huenerfauth January 2005.
Please open your laptops and pull up Quiz 7.1. If you have any time left after finishing the quiz problems, CHECK YOUR FACTORING before you submit the.
Kids Computer Club House
Get the most out of SKYPE 1.Sign in 2.Pick up your webcam 3.Try Skype activities 4.Eat Trainers are around should you need help – or Skype us Jimskeane.
Visual Basic Chapter 1 Mr. Wangler.
CS110/CS119 Introduction to Computing (Java)
L2: BECOMING SELF- SUFFICIENT IN STATA Getting started with Stata Angela Ambroz May 2015.
Introduction to SPSS Edward A. Greenberg, PhD
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Multiple Indicator Cluster Surveys Data Processing Workshop
Python Programming Using Variables and input. Objectives We’re learning to make use of if statements to enable code to ask questions. Outcomes Build an.
CS161 Topic #21 CS161 Introduction to Computer Science Topic #2.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Chapter Three The UNIX Editors. 2 Lesson A The vi Editor.
Moodle (Course Management Systems). Forums, Chats, and Messaging.
Introduction to R Lecture 1: Getting Started Andrew Jaffe 8/30/10.
Introduction to MATLAB ENGR 1181 MATLAB 1. Programming In The Real World Programming is a powerful tool for solving problems in every day industry settings.
STATA Mini Course Fall 2015 Jane Leber Herr Littauer 113 1Stata Mini Course – Spring 2015.
BMTRY 789 Introduction to SAS Programming Lecturer: Annie N. Simpson, MSc.
1 ITI 1120 Lab # 1 An Introduction to the Lab Environment Contributors: G. Arbez, M. Eid, D. Inkpen, A. Williams, D. Amyot.
L3: BIG STATA CONCEPTS Getting started with Stata Angela Ambroz May 2015.
Please CLOSE YOUR LAPTOPS, and turn off and put away your cell phones, and get out your note- taking materials.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
5 BASIC CONCEPTS OF ANY PROGRAMMING LANGUAGE Let’s get started …
Excel: Basic Math Functions Computer Information Technology Section 6-5 Some text and examples used with permission from: Note:
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
Introduction to Statistical Computing in Clinical Research Biostatistics 212.
CSC Intro. to Computing Lecture 12: PALGO. Announcements Homework #3 solutions available  Download from Blackboard/web Quiz #3 will be in class.
Writing ODK Surveys in XLSFORM
Chapter Three The UNIX Editors.
Introduction to R October 10, 2008 Please go to: Find the workshop materials for this course Download them.
Basics of Biostatistics for Health Research Session 1 – February 7 th, 2013 Dr. Scott Patten, Professor of Epidemiology Department of Community Health.
Chapter 2 – Approaches to Reading and Writing
Introduction Today Overview of office schedule. Term 2 Overview No more computer theory Using MS Office in detail –Word processing –Excel Spreadsheets.
Homework #1.
The Hashemite University Computer Engineering Department
Python Lesson 1 1. Starter Create the following Excel spreadsheet and complete the calculations using formulae: 2 Add A1 and B1 A2 minus B2 A3 times B3.
Querying Databases A query is a program that allows us to VIEW the data or operate on the data Several types of queries –Select query –Merge query –Summary.
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.,
CSS 290: Video Games and Computer Programming Instructor: Mike Panitz Tuesdays and Thursdays, 1:15pm-3:20pm UW
Do Now. Laws of Exponents -Evaluating Exponents MAFS.8.EE.1.1: Know and apply the properties of integer exponents to generate equivalent numerical expressions.
COMPUTER PROGRAMMING Year 9 – lesson 1. Objective and Outcome Teaching Objective We are going to look at how to construct a computer program. We will.
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
Data Entry, Coding & Cleaning SPSS Training Thomas Joshua, MS July, 2008.
Department of Computer Engineering
CSCI 203: Introduction to Computer Science I
A Playful Introduction to Programming by Jason R. Briggs
Getting started with Stata
Matlab Training Session 4: Control, Flow and Functions
ECONOMETRICS ii – spring 2018
Stata Basic Course Lab 2.
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Introduction to Python
CSCI 203: Introduction to Computer Science I
Presentation transcript:

L1: INTRODUCTION Getting started with Stata Angela Ambroz May 2015

Today Admin What is Stata? Basics of the basics

Admin 3 lectures Homework assignment for each lecture Course website: 24/7 Support: Skype group chat – CUPCAKE PROMISE Make sure you have Stata 10 on your computer Confused? Interrupt me! GOAL: Not being scared/intimidated by Stata. Understanding the basics of how Stata operates. Being able to write and understand.do files.

Pre-course survey results 74% of you have used Stata before 53% of you knew what browse does 95% of you have used Excel 74% of you have used SPSS session 2 session 3 not doing this (sorry) session 1

Why do we use Stata? ProsCons - Logistics: Easy to learn, cross-platform, industry standard! - Working with very large datasets (multiple GBs) - Analysis: Many of our most useful tools are built-in and ready to use (e.g. power calcs) - Making graphs/tables is time-consuming (faster in Excel) - Reproducible research: Stata is command-driven, saved in.do files - Pricey - Flexibility

The basics

How to talk to Stata Stata has both a command-line and graphical user interface It uses a specific syntax, similar to programming languages Most people write commands in a.do file, save it, and then run it

Graphical user interface

Command line interface

Save your commands:.do files

What is a.do file? A.do file is a plain text file where you save your Stata commands. It’s kind of like a mini program. Saving commands in a.do file makes sure that your work is reproducible and understandable. Added bonus: you can do and save your analysis in a.do file without altering the dataset! (unlike Excel)

Three ways to do the same thing RAW DATA SUMMARY STATISTICS OF DATA Use the drop-down menus Type everything in the Command Editor Prepare a.do file, save it, run it

Word to the wise Best practice Test ideas in the Command Editor window Do your analysis (and save it!) in a.do file!

How does Stata see data? Stata won’t show you the data unless you explicitly ask it (via browse) Data can be either: numeric: -1, , string: “Angela”, “ Dar es Salaam”, “1,000”, “1/4”, “ ” Encoded: 100 (“Dar es Salaam”) Missing values show up as. (numeric) and “ ” (string)

How does Stata see data? Values The answers in your questionnaire Variables The questions in your questionnaire Labels Meta-data on your questions and answers

How to talk to Stata (via commands) There are thousands* of official Stata commands There are hundreds* of unofficial, user-written Stata commands (.ado) There is no point in trying to memorize a lot of commands – this is a giant waste of time Instead, memorize only one: help * I think, I’m not actually sure.

How to use “help” You type help browse, and Stata will open this: A key Stata skill: Learning how to read and understand “help” files

General syntax structure Stata’s commands following programming conventions. As such, they use logic symbols (&,, etc.) Variable names never have spaces Variable names never start with numbers Strings always have “quotes around them” All commands can be shortened: generate browse tabulate

General syntax structure: Logic symbols This…means this…Example +-*/+-*/ Add, subtract, multiply, divide =Assignment generate weekly_amount = daily_average * 7 ==Equals browse if region==“Dar es Salaam” !=Does not equal browse if region!=“Dar es Salaam” >=,, < Greater/Less than browse if age<=5 &And browse if age<=5 & gender==“Female” |Or browse if party==“CHADEMA” | party==“CUF”

In-class exercise Let’s now take 5-10 minutes, and translate this into English: gen adult_respondent=1 if age>=18 & name!=“” hint: help...

Homework homework1-1.do - Read and explain a simple.do file (written by someone else) homework1-2 (online Google form) – Practice writing and running some simple commands Goal: To be able to open a.do file To get familiar with the different windows in Stata To be able to use and understand the “help” command To start writing your first commands Questions? /Skype. Finished? me your.do file. Fill out the Google form. DEADLINE: COB Monday, May 18, 2015