Presentation, data and programs at:

Slides:



Advertisements
Similar presentations
Housekeeping: Variable labels, value labels, calculations and recoding
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.
Stata Intro Practice Exercises Debby Kermer, George Mason University Libraries Data Services.
1. Overview Brief guide to the display windows and toolbar
INTRODUCTION TO STATA Võ Tuấn Khoa Trần Thế Trung.
Spreadsheets and Non- Spatial Databases Unit 4: Module 15, Lecture 2- Advanced Microsoft Excel.
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.
An Introduction into Stata I Prof. Dr. Herbert Brücker University of Bamberg Seminar “Migration and the Labour Market” Session 3, June 9, 2011.
Getting Started with your data
SPSS Statistical Package for the Social Sciences is a statistical analysis and data management software package. SPSS can take data from almost any type.
Welcome to SAS…Session..!. What is SAS..! A Complete programming language with report formatting with statistical and mathematical capabilities.
DEVELOPING A CODING SCHEME AND SETTING UP YOUR SPSS DATA FILE
How to Analyze Data? Aravinda Guntupalli. SPSS windows process Data window Variable view window Output window Chart editor window.
Stata 12 Merging Guide Nathan Favero Texas A&M University October 19, 2012.
1 CCPR Computing Services Workshop: Introduction to Stata June, 2006.
Introduction to SPSS Edward A. Greenberg, PhD
Key Data Management Tasks in Stata
STATA Mini Course Fall 2015 Jane Leber Herr Littauer 113 1Stata Mini Course – Spring 2015.
DLI Boot Camp 2011 Finding Statistics: Tools and Techniques Jean Blackburn Vancouver Island University Library SDA.
Generating new variables and manipulating data with STATA Biostatistics 212 Lecture 3.
Using Excel Biostatistics 212 Lecture 4. Housekeeping Questions about Lab 3? –replace vs. recode –Cross-checking/recoding missing values –Analysis of.
Introduction to Statistical Computing in Clinical Research Biostatistics 212.
Developed By Information Technology Services University Of Saskatchewan.
A Simple Guide to Using SPSS ( Statistical Package for the Social Sciences) for Windows.
STATA for S-052 M. Shane Tutwiler Your Friendly S-040 Lecturer William Johnston IT Services Harvard Graduate School of Education.
Dec-15H.S.1 Stata 8, Programing Hein Stigum Presentation, data and programs at:
1.Introduction to SPSS By: MHM. Nafas At HARDY ATI For HNDT Agriculture.
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.
Data Management Research Methods Professional Development Institute December 4, 2015.
Use SPSS for solving the problems Lecture#21. Opening SPSS The default window will have the data editor There are two sheets in the window: 1. Data view2.
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.,
Rasch model (MML estimation) for 12 GHQ items. Loevinger H, ppp pmm for 12 GHQ items.
Problem Set 1 Troubleshooting. Log Files Save in text format for readability: log using ps1.log, replace or: log using ps1, text.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 16 & 17 By Tasha Chapman, Oregon Health Authority.
Topics Introduction to Stata – Files / directories – Stata syntax – Useful commands / functions Logistic regression analysis with Stata – Estimation –
Advanced Quantitative Techniques
Introduction to the SPSS Interface
SPSS For a Beginner CHAR By Adebisi A. Abdullateef
EMPA Statistical Analysis
Applied Business Forecasting and Regression Analysis
Stata Intro Mixed Models
ICT AND PRINCIPLES OF DATA ANALYSIS
Lecture 3: Changing Data
QS101 – Introduction to Quantitative Methods in Social Science Week 2: Introduction to Stata and Preparation of Field Work Florian Reiche Teaching Fellow.
Econometrics 704 Emilio Cuilty
A statistical package for epidemiologists
ECONOMETRICS ii – spring 2018
Introduction Introduction to Stata 2016.
2018 NM Community Survey Data Entry Training
Topics Introduction to File Input and Output
Introduction to Stata Spring 2017.
STATA User Group September 2007
SPSS Intro and Analysis
Stata 9, Summing up.
Introduction to Stata II
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 4.
Introduction to SAS Essentials Mastering SAS for Data Analytics
Stata Basic Course Lab 2.
SPSS tips and tricks for the initiated
Two Issues on Remote Data Access
By A.Arul Xavier Department of mathematics
Topics Introduction to File Input and Output
A Brief Introduction to Stata(2)
Introduction to the SPSS Interface
Evaluation of Public Policy
Login Main Functions Via SAS Information Delivery Portal
Presentation transcript:

Presentation, data and programs at: Stata0, Introduction Hein Stigum Presentation, data and programs at: http://folk.uio.no/heins/

Why Stata Pro Con Aimed at epidemiology Many methods, growing Graphics Structured, Programmable Coming soon to a course near you Con Memory>file size Copy tables Time: 1 h 15 min Used by leading univ, and at many summer schools Apr-19 H.S.

Data handling

Import data Using SPSS 14.0 Save as, Stata Version 8 SE Apr-19 H.S. New version of DBMSCopy support lonf variable names Apr-19 H.S.

Interface Apr-19 H.S.

Do Editor New Run Ctrl-8, or: Mark commands, Ctrl-D to do (execute) Open do file Copy commands Copy review to clipboard Run commands Apr-19 H.S.

Do-file example Apr-19 H.S.

Syntax Syntax Examples [bysort varlist:] command [varlist] [if exp] [in range][, opts] Examples mean age mean age if sex==1 bysort sex: summarize age summarize age ,detail All commands same Some simple and some advanced options (and prefixes) Apr-19 H.S.

Use and save data Open data Describe Save data set memory 200m use “C:\Course\Myfile.dta”, clear Describe describe describe all variables list x1 x2 in 1/20 list obs nr 1 to 20 Save data save “C:\Course\Myfile.dta” ,replace Default memory=10m Have we seen in 1/20 before? Apr-19 H.S.

Drop and keep Drop Keep drop x1 x2 drop variables x1 and x2 drop if sex==1 drop males drop if age==. drop missing Keep same as drop Drop var =columns Drop obs =lines Apr-19 H.S.

Recode Syntax From 4 to 2 groups: recode educ (1 2=1) (3 4=2)(missing=.), gen(educ2) From cont. to 3 groups: recode age (min/19=1) (20/29=2) (30/max=3), gen(age3) Auto: 3 equal sized groups with labels at() values outside set to missing String destring stringvar, generate(newvar) force force specifies that any string values containing non-numeric characters be treated as indicating missing numeric values. Apr-19 H.S.

Labels Variable Value List label variable q1 ”Age” 1 ) label define freqLab 1”Low” 2”Med” 3”High” 2a) label values smoke freqLab 2b) label values drink freqLab List label list Label list: show all variables with their labels Names and labels are used in plots: define good english names May also add information in labels (N=230) Add numeric coding to labels: numlab, add/remove Apr-19 H.S.

Generate, replace Age square Young/Old Alternatives generate ageSqr=age^2 Young/Old generate old=0 if (age<=50) replace old=1 if (age>50) Observation numbers gen id=_n gen lag=age[ _n-1] Alternatives generate old=(age>50) generate old=(age>50) if age<. Missing defined in next slide Apr-19 H.S.

Dates From numeric to date From string to date ex: m=12, d=2, y=1987 generate bdate=mdy(m,d,y) format bdate %d From string to date ex: bstr=“01.12.1987” generate bdate=date(bstr,”dmy”) Apr-19 H.S.

Missing Obs!!! Test Remove Change Missing values are large numbers age>30 will include missing. age>30 if age<. will not. Test replace x=0 if (x==.) Remove drop if age==. Change replace educ=. if educ==99 gen age2=(age>30) if age!=. Also .a .b .c … Apr-19 H.S.

Describe missing Summarize variables Missing in tables Apr-19 H.S.

Handle data with many variables Describe describe vars format and labels summarize vars N, mean, std, min and max codebook vars range, missing, mean and std, percentiles Find variables describe, simple list all variables lookfor age list variables with “age” in name or label describe age*, n list vars starting with “age” and show var number Change order order vars change order of variables Apr-19 H.S.

Help General Examples help command findit keyword search Stata+net help table findit aflogit findit key=search key,all rc=return code Apr-19 H.S.

Summing up Use do files Syntax Missing Help Mark, Ctrl-D to do (execute) Syntax command [varlist] [if exp] [in range] [, options] Missing age>30 & age<. generate old=(age>50) if age<. Help help describe Apr-19 H.S.

Books Data Analysis Using Stata by Ulrich Kohler and Frauke Kreuter Statistics with Stata (Updated for Version 9) by Lawrence C. Hamilton A visual guide to Stata graphics by M.N. Mitchell Multilevel and longitudinal modeling using Stata by S. Rabe-Hesketh, A. Skrondal Apr-19 H.S.