1 / 16

I ntroduction to STATA

NYU DataServices. I ntroduction to STATA. Outline. Overview of STATA Interface Getting Started Managing Data Descriptive Statistics Basic Analysis Additional Resources. NYU DataServices. Overview of STATA.

carol
Download Presentation

I ntroduction to 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. NYUDataServices Introduction to STATA

  2. Outline • Overview of STATA • Interface • Getting Started • Managing Data • Descriptive Statistics • Basic Analysis • Additional Resources NYUDataServices

  3. Overview of STATA • STATA is a statistical package that allows advanced data analysis, management, and graphics. • You can choose a perpetual license or an annual one. • Available for Windows and Mac. • NYUDataServices

  4. STATA INTERFACE • Command window: NYUDataServices

  5. STATA INTERFACE • Data window activated usingbrcommand NYUDataServices

  6. STATA INTERFACE • Do File syntax equivalent in SPSS and R • Commands should be written and saved in Do files rather then entered directly into the command window • Some advantages to using Do files: • allows reusing commands (the same analysis can be quickly repeated on different data sets as long as the variables name match) • allows to copy, past and edit commands • easier to read complex expressions • allows sharing commands / methods with other researchers NYUDataServices

  7. Getting Started • Working Directories • To CHECK the current directory: • pwd • To CHANGE the directory: • cd • To VIEW files in the directory: • dir NYUDataServices

  8. Opening Datasets in STATA Creating / Opening datasets: • To create a new dataset: clear input var1 var2 var3 01 02 03 04 05 06 07 08 09 10 11 12 end NYUDataServices

  9. Datasets in STATA • To read a Stata dataset: use dataset name • To read non-stata formats: .csv: insheet using “datasetname.csv” .dat : infile & infix • To read a non-Stata format where first row is the variables’ name: import excel ”datasetname.xls", sheet(”sheet 1") firstrow clear • To save a Stata dataset: save dataset name, replace outsheet using dataname.csv, comma replace NYUDataServices

  10. Managing Data Creating and managing new variables • To create a new variable egen variable name • To delete one drop variable name • To recode a variable recode replace NYUDataServices

  11. Descriptive Statistics • For a summary: sum variable name sum variable name, detail • For a cross tabulation tabulate var1 var2, chi2 • For frequencies tabulate oneway variable name NYUDataServices

  12. Graphs • Histogram: histogram Scatter Plot dotplot • Box Plot graph box NYUDataServices

  13. Basic Analysis • Some examples: pwcorr // pairwise correlation coefficients    ttest         // Mean Comparison Test regress   // OLS regression anova   // Analysis of Variancelogit       // Logistic Regression ologit    // Ordererd  Logistic Regression sem     // Build a Structural Equation Model NYUDataServices

  14. The winner of all commands help NYUDataServices

  15. Additional Resources • http://nyu.libguides.com/content.php?pid=38898&sid=1554472 • http://www.ats.ucla.edu/stat/stata/ NYUDataServices

  16. Tutorial Evaluation • Please follow the link below: • This will only take a few minutes and help us a great lot in improving the tutorial • http://bit.ly/Stata1 NYUDataServices

More Related