1 / 31

API-208: Stata Review Session

API-208: Stata Review Session. Daniel Yew Mao Lim Harvard University Spring 2013. Roadmap. Getting Started. Importing Data. Data management. Data analysis. Programming. Getting Started: Orientation. REVIEW WINDOW : past commands appear here.

debbie
Download Presentation

API-208: Stata Review Session

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. API-208: Stata Review Session Daniel Yew Mao Lim Harvard University Spring 2013

  2. Roadmap Getting Started Importing Data Data management Data analysis Programming

  3. Getting Started: Orientation REVIEW WINDOW: past commands appear here RESULTS WINDOW: results and commands displayed here VARIABLES WINDOW: variable list shown here COMMAND WINDOW: commands typed here

  4. Getting Started: Syntax

  5. Getting Started: Syntax Example

  6. Getting Started: Syntax Example

  7. Getting Started: Useful Commands I if by help in sum ssc install

  8. Getting Started: Useful Commands II Arithmetic Operators “+”addition “-”subtraction “*”multiplication “/”division “^”power

  9. Getting Started: Useful Commands III Relational Operators “>” Greater than “<” Less than “>=” Equal or greater than “<=” Equal or less than “==” Equal to “~=” Not equal to “!=” Not equal to

  10. Getting Started: Useful Commands IV A B A B Logical (Boolean) Operators • “&” =and • Example: A & B • “|” = or • Example: A | B

  11. Getting Started: Example

  12. Getting Started: Worked Example Average share of ADB loans during first and second years on UNSC Between 1985 and 2004 Average share of ADB loans during first and second years on UNSC Between 1985 and 2004, for each country

  13. Getting Started: Creating Do-files Text file containing all commands relevant to analysis Useful for batch processing

  14. Getting Started: Creating Do-files

  15. Getting Started: Commenting in Do-files * Ignore stuff written on this line /* Text Here*/ Ignore stuff written in between

  16. Getting Started: Commenting in Do-files

  17. Importing Data: Data Types Stata Data .xls .csv

  18. Data Management: Data Structure Cross-sectional Time-series Panel

  19. Data Management: Datasets merge: add variables across datasets. append: add observations across datasets. reshape: convert data from wide/longor long/wide rename: change the name of a variable. drop: eliminate variables or observations. keep: keep variables or observations. sort: arrange into ascending order.

  20. Data Management: Missing Data Recode List-wise deletion Multiple Imputation

  21. Data Management: Outliers Impossible values Extreme values Logarithmic function

  22. Data Management: Modifying Data • generate: create new variable. • replace: replace old values. • recode: change values by conditions. • label define: defines value labels (or “dictionary”). • label values: attaches value labels (or “dictionary”) to a variable.

  23. Data Analysis: Exploring Data summarize: descriptive statistics. codebook: display contents of variables. describe: display properties of variables. count: counts cases. list: show values.

  24. Data Analysis: Analyzing Data tabstat: tables with statistics. tabulate: one- or two-way frequency tables (related: tab1 and tab2). table: calculates and displays tables of statistics.

  25. Data Analysis: Worked Example Exercise 1: Create an aidsize variable with three categories based on the amount of ADB loans received (adbconstant): small (0 to 99), medium (100 to 999), and large (1000 or more). Include labels.

  26. Data Analysis: MLE regress: standard OLS. Probit/logit: binary dependent variable. oprobit: ordered probit regression. ologit: ordered logistic regression. xtreg: fixed, between, and random effects, and population averaged linear models. xtregar: fixed and random effects models with AR(1) disturbance.

  27. Data Analysis: Matching psmatch2: propensity score matching. cem: coarsened exact matching.

  28. Data Analysis: Interpreting Coefficients

  29. Programming

  30. Conclusion Pattern recognition Self-learning Programming

  31. Q&A Thank you!

More Related