1 / 15

Scottish Social Survey Network: Master Class 1 Data Analysis with Stata

Scottish Social Survey Network: Master Class 1 Data Analysis with Stata. Dr Vernon Gayle and Dr Paul Lambert 23 rd January 2008, University of Stirling The SSSN is funded under Phase II of the ESRC Research Development Initiative. Introducing Stata. W indows environment

Download Presentation

Scottish Social Survey Network: Master Class 1 Data Analysis with Stata

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Scottish Social Survey Network: Master Class 1Data Analysis with Stata Dr Vernon Gayle and Dr Paul Lambert 23rd January 2008, University of Stirling The SSSN is funded under Phase II of the ESRC Research Development Initiative

  2. Introducing Stata • Windows environment • Opening and processing commands – the do-file editor • Opening and saving data • Viewing data • Preserving outputs (logs) • Tips (and wrinkles) • Further examples on our website

  3. STATA SOFTWARE – GOOD POINTS • Does all the simple stuff (SPSS) • Fits many more models than standard software (esp. Longitudinal) • Specialist survey analysis functions (Svy) • You can get started easily (menus and help) • Strong documentation • There is a growing user community (lists etc) • New features emerge almost daily • There are good labour market opportunities (UK little known; USA well known)

  4. Variable names Main data window Review – what you’ve done Command window – interactive use

  5. A Do File (.do) Open the do file editor (or ‘ctrl-8’)

  6. Highlight the command and run it from the icon (or ctrl D)

  7. Opening and Saving Data • use “C:\data\dataset2.dta” • save “C:\data\dataset2.dta” To overwrite… • use “C:\data\dataset2.dta”, clear • save “C:\data\dataset2.dta”, replace

  8. variables names & descriptions

  9. Data Windows Data editor (dangerous - can edit here) Data browser (can’t edit here)

  10. Data Editor (familiar spreadsheet)

  11. Log files (keeping track) log using “C:\data\temp1.log”, replace

  12. Using Stata – Some tips • Session settings • set more off (once in command window) • set mem 64M (, permanently) • Data overwrite • use dataset1.dta, clear • save dataset1.dta, replace • Do not double click on .do files in windows they will crash • Generate variables • drop varname before gen varname • See values and labels • numlabel _all, add • File information • codebook

  13. Using Stata – Some tips • File locations • global path1 "d:\lda\work\" • use “$path1\data1.dta”, clear • Output • capture – suppresses output (*including errors*) • nolog – e.g. suppresses interactions in logit • noheader - suppresses the display of the ANOVA table etc in regression • nodots – jacknife “not a lot of people know that” • Line breaks • /// tells Stata to read the next line too • Looking at the data • edit • browse • list in1/10 – shows data forcases 1 to 10

  14. STATA SOFTWARE – BAD POINTS • Poor data visualisation (compared with SPSS etc) • In practice, survey analysis functionality comes with limitations (complex methods but weak data) • There are some models that can’t be fitted / some critiques of estimation procedures • Stata syntax has some quirks (set more off) • There is a growing user community, but they are generally GEEKBOYS (like myself!) • New features emerge almost daily these are sometimes tricky to get to grips with

  15. Taking Stata further • Online resources • Stata website for FAQs, manual, training • Net use and update • Specialist modelling suites • XT – Cross sectional panel • ST – Survival data • SV – Survey data • Xtmixed - Multilevel models (v9) • GLLAMM • Programming: .do; .ado; macros

More Related