Data Analysis Using Stata

2y ago
34 Views
3 Downloads
548.11 KB
30 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Grady Mosby
Transcription

Data Analysis Using StataThird Edition

Copyright c 2005, 2009, 2012 by StataCorp LPAll rights reserved. First edition 2005Second edition 2009Third edition 2012Published by Stata Press, 4905 Lakeway Drive, College Station, Texas 77845Typeset in LATEX 2εPrinted in the United States of America10 9 8 7 6 5 4 3 2 1ISBN-10: 1-59718-110-2ISBN-13: 978-1-59718-110-5Library of Congress Control Number: 2012934051No part of this book may be reproduced, stored in a retrieval system, or transcribed, in anyform or by any means—electronic, mechanical, photocopy, recording, or otherwise—withoutthe prior written permission of StataCorp LP., Stata Press, Mata,Stata,StataCorp LP., and NetCourse are registered trademarks ofStata and Stata Press are registered trademarks with the World Intellectual Property Organization of the United Nations.LATEX 2ε is a trademark of the American Mathematical Society.

ContentsList of tablesxviiList of figuresxixPrefacexxiAcknowledgments1xxviiThe first time11.1Starting Stata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.2Setting up your screen . . . . . . . . . . . . . . . . . . . . . . . . . .21.3Your first analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . .21.3.1Inputting commands . . . . . . . . . . . . . . . . . . . . . .21.3.2Files and the working memory . . . . . . . . . . . . . . . . .31.3.3Loading data . . . . . . . . . . . . . . . . . . . . . . . . . .31.3.4Variables and observations . . . . . . . . . . . . . . . . . . .51.3.5Looking at data . . . . . . . . . . . . . . . . . . . . . . . . .71.3.6Interrupting a command and repeating a command . . . . .81.3.7The variable list . . . . . . . . . . . . . . . . . . . . . . . . .81.3.8The in qualifier . . . . . . . . . . . . . . . . . . . . . . . . .91.3.9Summary statistics . . . . . . . . . . . . . . . . . . . . . . .91.3.10The if qualifier . . . . . . . . . . . . . . . . . . . . . . . . .111.3.11Defining missing values . . . . . . . . . . . . . . . . . . . . .111.3.12The by prefix . . . . . . . . . . . . . . . . . . . . . . . . . .121.3.13Command options . . . . . . . . . . . . . . . . . . . . . . . .131.3.14Frequency tables . . . . . . . . . . . . . . . . . . . . . . . .141.3.15Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .151.3.16Getting help . . . . . . . . . . . . . . . . . . . . . . . . . . .16

vi2ContentsRecoding variables . . . . . . . . . . . . . . . . . . . . . . .171.3.18Variable labels and value labels . . . . . . . . . . . . . . . .181.3.19Linear regression . . . . . . . . . . . . . . . . . . . . . . . .191.4Do-files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .201.5Exiting Stata . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221.6Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .23Working with do-files252.1From interactive work to working with a do-file . . . . . . . . . . . .252.1.1Alternative 1 . . . . . . . . . . . . . . . . . . . . . . . . . .262.1.2Alternative 2 . . . . . . . . . . . . . . . . . . . . . . . . . .27Designing do-files . . . . . . . . . . . . . . . . . . . . . . . . . . . . .302.2.1Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . .312.2.2Line breaks . . . . . . . . . . . . . . . . . . . . . . . . . . .322.2.3Some crucial commands . . . . . . . . . . . . . . . . . . . .332.3Organizing your work . . . . . . . . . . . . . . . . . . . . . . . . . .352.4Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .392.231.3.17The grammar of Stata413.1The elements of Stata commands . . . . . . . . . . . . . . . . . . . .413.1.1Stata commands . . . . . . . . . . . . . . . . . . . . . . . .413.1.2The variable list . . . . . . . . . . . . . . . . . . . . . . . . .43List of variables: Required or optional . . . . . . . . . . . .43Abbreviation rules . . . . . . . . . . . . . . . . . . . . . . .43Special listings. . . . . . . . . . . . . . . . . . . . . . . . .453.1.3Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . .453.1.4The in qualifier . . . . . . . . . . . . . . . . . . . . . . . . .473.1.5The if qualifier . . . . . . . . . . . . . . . . . . . . . . . . .483.1.6Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . .51Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . .52Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . .54Lists of numbers553.1.7. . . . . . . . . . . . . . . . . . . . . . . .

Contentsvii3.1.83.2Using filenames . . . . . . . . . . . . . . . . . . . . . . . . .56Repeating similar commands . . . . . . . . . . . . . . . . . . . . . .573.2.1The by prefix . . . . . . . . . . . . . . . . . . . . . . . . . .583.2.2The foreach loop . . . . . . . . . . . . . . . . . . . . . . . .59The types of foreach lists . . . . . . . . . . . . . . . . . . . .61Several commands within a foreach loop . . . . . . . . . . .62The forvalues loop . . . . . . . . . . . . . . . . . . . . . . .62Weights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .633.2.33.3Frequency weights3.445. . . . . . . . . . . . . . . . . . . . . . .64Analytic weights . . . . . . . . . . . . . . . . . . . . . . . .66Sampling weights . . . . . . . . . . . . . . . . . . . . . . . .67Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .68General comments on the statistical commands714.1Regular statistical commands . . . . . . . . . . . . . . . . . . . . . .714.2Estimation commands . . . . . . . . . . . . . . . . . . . . . . . . . .744.3Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76Creating and changing variables775.1The commands generate and replace . . . . . . . . . . . . . . . . . .775.1.1Variable names . . . . . . . . . . . . . . . . . . . . . . . . .785.1.2Some examples . . . . . . . . . . . . . . . . . . . . . . . . .795.1.3Useful functions . . . . . . . . . . . . . . . . . . . . . . . . .825.1.4Changing codes with by, n, and N . . . . . . . . . . . . . .855.1.5Subscripts . . . . . . . . . . . . . . . . . . . . . . . . . . . .89Specialized recoding commands . . . . . . . . . . . . . . . . . . . . .915.2.1The recode command . . . . . . . . . . . . . . . . . . . . . .915.2.2The egen command . . . . . . . . . . . . . . . . . . . . . . .925.3Recoding string variables . . . . . . . . . . . . . . . . . . . . . . . . .945.4Recoding date and time . . . . . . . . . . . . . . . . . . . . . . . . .985.4.1Dates . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .985.4.2Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1025.2

viii6Contents5.5Setting missing values . . . . . . . . . . . . . . . . . . . . . . . . . . 1055.6Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1075.7Storage types, or the ghost in the machine . . . . . . . . . . . . . . . 1115.8Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112Creating and changing graphs1156.1A primer on graph syntax . . . . . . . . . . . . . . . . . . . . . . . . 1156.2Graph types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1166.36.2.1Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1176.2.2Specialized graphs. . . . . . . . . . . . . . . . . . . . . . . 119Graph elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1196.3.1Appearance of data . . . . . . . . . . . . . . . . . . . . . . . 121Choice of marker . . . . . . . . . . . . . . . . . . . . . . . . 123Marker colors . . . . . . . . . . . . . . . . . . . . . . . . . . 125Marker size . . . . . . . . . . . . . . . . . . . . . . . . . . . 126Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1266.3.2Graph and plot regions . . . . . . . . . . . . . . . . . . . . . 129Graph size . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130Plot region . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130Scaling the axes . . . . . . . . . . . . . . . . . . . . . . . . . 1316.3.3Information inside the plot region . . . . . . . . . . . . . . . 133Reference lines . . . . . . . . . . . . . . . . . . . . . . . . . 133Labeling inside the plot region . . . . . . . . . . . . . . . . . 1346.3.4Information outside the plot region . . . . . . . . . . . . . . 138Labeling the axes . . . . . . . . . . . . . . . . . . . . . . . . 139Tick lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142Axis titles . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143The legend . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144Graph titles . . . . . . . . . . . . . . . . . . . . . . . . . . . 1466.4Multiple graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1476.4.1Overlaying many twoway graphs. . . . . . . . . . . . . . . 147

Contents7ix6.4.2Option by() . . . . . . . . . . . . . . . . . . . . . . . . . . . 1496.4.3Combining graphs . . . . . . . . . . . . . . . . . . . . . . . . 1506.5Saving and printing graphs . . . . . . . . . . . . . . . . . . . . . . . 1526.6Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154Describing and comparing distributions1577.1Categories: Few or many? . . . . . . . . . . . . . . . . . . . . . . . . 1587.2Variables with few categories . . . . . . . . . . . . . . . . . . . . . . 1597.2.1Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159Frequency tables . . . . . . . . . . . . . . . . . . . . . . . . 159More than one frequency table . . . . . . . . . . . . . . . . . 160Comparing distributions . . . . . . . . . . . . . . . . . . . . 160Summary statistics . . . . . . . . . . . . . . . . . . . . . . . 162More than one contingency table . . . . . . . . . . . . . . . 1637.2.2Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163Histograms . . . . . . . . . . . . . . . . . . . . . . . . . . . 164Bar charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166Pie charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168Dot charts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1697.3Variables with many categories . . . . . . . . . . . . . . . . . . . . . 1707.3.1Frequencies of grouped data . . . . . . . . . . . . . . . . . . 171Some remarks on grouping data . . . . . . . . . . . . . . . . 171Special techniques for grouping data . . . . . . . . . . . . . 1727.3.2Describing data using statistics . . . . . . . . . . . . . . . . 173Important summary statistics . . . . . . . . . . . . . . . . . 174The summarize command . . . . . . . . . . . . . . . . . . . 176The tabstat command . . . . . . . . . . . . . . . . . . . . . 177Comparing distributions using statistics . . . . . . . . . . . 1787.3.3Graphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186Box plots . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187Histograms . . . . . . . . . . . . . . . . . . . . . . . . . . . 189

xContentsKernel density estimation . . . . . . . . . . . . . . . . . . . 191Quantile plot . . . . . . . . . . . . . . . . . . . . . . . . . . 195Comparing distributions with Q–Q plots . . . . . . . . . . . 1997.48Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200Statistical inference8.18.2201Random samples and sampling distributions . . . . . . . . . . . . . . 2028.1.1Random numbers . . . . . . . . . . . . . . . . . . . . . . . . 2028.1.2Creating fictitious datasets . . . . . . . . . . . . . . . . . . . 2038.1.3Drawing random samples . . . . . . . . . . . . . . . . . . . . 2078.1.4The sampling distribution . . . . . . . . . . . . . . . . . . . 208Descriptive inference . . . . . . . . . . . . . . . . . . . . . . . . . . . 2138.2.1Standard errors for simple random samples. . . . . . . . . 2138.2.2Standard errors for complex samples . . . . . . . . . . . . . 215Typical forms of complex samples . . . . . . . . . . . . . . . 215Sampling distributions for complex samples . . . . . . . . . 217Using Stata’s svy commands . . . . . . . . . . . . . . . . . . 2198.2.3Standard errors with nonresponse . . . . . . . . . . . . . . . 222Unit nonresponse and poststratification weights . . . . . . . 222Item nonresponse and multiple imputation . . . . . . . . . . 2238.2.4Uses of standard errors . . . . . . . . . . . . . . . . . . . . . 230Confidence intervals . . . . . . . . . . . . . . . . . . . . . . . 231Significance tests . . . . . . . . . . . . . . . . . . . . . . . . 233Two-group mean comparison test . . . . . . . . . . . . . . . 2388.3Causal inference8.3.1. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242Basic concepts . . . . . . . . . . . . . . . . . . . . . . . . . . 242Data-generating processes . . . . . . . . . . . . . . . . . . . 242Counterfactual concept of causality . . . . . . . . . . . . . . 2448.48.3.2The effect of third-class tickets . . . . . . . . . . . . . . . . 2468.3.3Some problems of causal inference . . . . . . . . . . . . . . . 248Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250

Contents9xiIntroduction to linear regression9.1253Simple linear regression . . . . . . . . . . . . . . . . . . . . . . . . . 2569.1.1The basic principle . . . . . . . . . . . . . . . . . . . . . . . 2569.1.2Linear regression using Stata. . . . . . . . . . . . . . . . . 260The table of coefficients . . . . . . . . . . . . . . . . . . . . 261The table of ANOVA results . . . . . . . . . . . . . . . . . . 266The model fit table . . . . . . . . . . . . . . . . . . . . . . . 2689.2Multiple regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2709.2.1Multiple regression using Stata . . . . . . . . . . . . . . . . 2719.2.2More computations . . . . . . . . . . . . . . . . . . . . . . . 274Adjusted R2 . . . . . . . . . . . . . . . . . . . . . . . . . . . 274Standardized regression coefficients . . . . . . . . . . . . . . 2769.2.39.3What does “under control” mean? . . . . . . . . . . . . . . 277Regression diagnostics . . . . . . . . . . . . . . . . . . . . . . . . . . 2799.3.1Violation of E(ǫi ) 0. . . . . . . . . . . . . . . . . . . . . 280Linearity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283Influential cases . . . . . . . . . . . . . . . . . . . . . . . . . 286Omitted variables . . . . . . . . . . . . . . . . . . . . . . . . 295Multicollinearity9.4. . . . . . . . . . . . . . . . . . . . . . . . 2969.3.2Violation of Var(ǫi ) σ 2 . . . . . . . . . . . . . . . . . . . . 2969.3.3Violation of Cov(ǫi , ǫj ) 0, i 6 j . . . . . . . . . . . . . . . 299Model extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3009.4.1Categorical independent variables . . . . . . . . . . . . . . . 3019.4.2Interaction terms . . . . . . . . . . . . . . . . . . . . . . . . 3049.4.3Regression models using transformed variables . . . . . . . . 308Nonlinear relationships . . . . . . . . . . . . . . . . . . . . . 309Eliminating heteroskedasticity . . . . . . . . . . . . . . . . . 3129.5Reporting regression results . . . . . . . . . . . . . . . . . . . . . . . 3139.5.1Tables of similar regression models . . . . . . . . . . . . . . 3139.5.2Plots of coefficients . . . . . . . . . . . . . . . . . . . . . . . 316

xiiContents9.5.39.6Conditional-effects plots . . . . . . . . . . . . . . . . . . . . 321Advanced techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . 3249.6.1Median regression . . . . . . . . . . . . . . . . . . . . . . . . 3249.6.2Regression models for panel data . . . . . . . . . . . . . . . 327From wide to long format . . . . . . . . . . . . . . . . . . . 328Fixed-effects models . . . . . . . . . . . . . . . . . . . . . . 3329.6.39.710Error-components models . . . . . . . . . . . . . . . . . . . 337Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339Regression models for categorical dependent variables10.1The linear probability model10.2Basic concepts10.3341. . . . . . . . . . . . . . . . . . . . . . 342. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34610.2.1Odds, log odds, and odds ratios . . . . . . . . . . . . . . . . 34610.2.2Excursion: The maximum likelihood principle . . . . . . . . 351Logistic regression with Stata . . . . . . . . . . . . . . . . . . . . . . 35410.3.1The coefficient table . . . . . . . . . . . . . . . . . . . . . . 356Sign interpretation . . . . . . . . . . . . . . . . . . . . . . . 357Interpretation with odds ratios . . . . . . . . . . . . . . . . 357Probability interpretation . . . . . . . . . . . . . . . . . . . 359Average marginal effects . . . . . . . . . . . . . . . . . . . . 36110.3.2The iteration block . . . . . . . . . . . . . . . . . . . . . . . 36210.3.3The model fit block . . . . . . . . . . . . . . . . . . . . . . . 363Classification tables . . . . . . . . . . . . . . . . . . . . . . . 364Pearson chi-squared . . . . . . . . . . . . . . . . . . . . . . . 36710.4Logistic regression diagnostics . . . . . . . . . . . . . . . . . . . . . . 36810.4.1Linearity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36910.4.2Influential cases . . . . . . . . . . . . . . . . . . . . . . . . . 37210.5Likelihood-ratio test . . . . . . . . . . . . . . . . . . . . . . . . . . . 37710.6Refined models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37910.6.1Nonlinear relationships . . . . . . . . . . . . . . . . . . . . . 37910.6.2Interaction effects . . . . . . . . . . . . . . . . . . . . . . . . 381

Contents10.710.811xiiiAdvanced techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . 38410.7.1Probit models . . . . . . . . . . . . . . . . . . . . . . . . . . 38510.7.2Multinomial logistic regression . . . . . . . . . . . . . . . . . 38710.7.3Models for ordinal data . . . . . . . . . . . . . . . . . . . . . 391Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393Reading and writing data39511.1The goal: The data matrix . . . . . . . . . . . . . . . . . . . . . . . . 39511.2Importing machine-readable data . . . . . . . . . . . . . . . . . . . . 39711.2.1Reading system files from other packages . . . . . . . . . . . 398Reading Excel files . . . . . . . . . . . . . . . . . . . . . . . 398Reading SAS transport files . . . . . . . . . . . . . . . . . . 402Reading other system files . . . . . . . . . . . . . . . . . . . 40211.2.2Reading ASCII text files . . . . . . . . . . . . . . . . . . . . 402Reading data in spreadsheet format . . . . . . . . . . . . . . 402Reading data in free format . . . . . . . . . . . . . . . . . . 405Reading data in fixed format11.311.4. . . . . . . . . . . . . . . . . 407Inputting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41011.3.1Input data using the Data Editor . . . . . . . . . . . . . . . 41011.3.2The input command . . . . . . . . . . . . . . . . . . . . . . 411Combining data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41511.4.1The GSOEP database . . . . . . . . . . . . . . . . . . . . . 41511.4.2The merge command . . . . . . . . . . . . . . . . . . . . . . 417Merge 1:1 matches with rectangular data . . . . . . . . . . . 418Merge 1:1 matches with nonrectangular data . . . . . . . . . 421Merging more than two files . . . . . . . . . . . . . . . . . . 424Merging m:1 and 1:m matches . . . . . . . . . . . . . . . . . 42511.4.3The append command . . . . . . . . . . . . . . . . . . . . . 42911.5Saving and exporting data . . . . . . . . . . . . . . . . . . . . . . . . 43311.6Handling large datasets . . . . . . . . . . . . . . . . . . . . . . . . . 43411.6.1Rules for handling the working memory . . . . . . . . . . . 434

xivContents11.6.211.712Using oversized datasets . . . . . . . . . . . . . . . . . . . . 435Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435Do-files for advanced users and user-written programs43712.1Two examples of usage . . . . . . . . . . . . . . . . . . . . . . . . . . 43712.2Four programming tools . . . . . . . . . . . . . . . . . . . . . . . . . 43912.2.1Local macros . . . . . . . . . . . . . . . . .

As you may have guessed, this book discusses data analysis, especially data analysis using Stata. We intend for this book to be an introduction to Stata; at the same time, the book also explains, for beginners, the techniques used to analyze data.

Related Documents:

Categorical Data Analysis Getting Started Using Stata Scott Long and Shawna Rohrman cda12 StataGettingStarted 2012‐05‐11.docx Getting Started Using Stata – May 2012 – Page 2 Getting Started in Stata Opening Stata When you open Stata, the screen has seven key parts (This is Stata 12. Some of the later screen shots .

Stata is available in several versions: Stata/IC (the standard version), Stata/SE (an extended version) and Stata/MP (for multiprocessing). The major difference between the versions is the number of variables allowed in memory, which is limited to 2,047 in standard Stata/IC, but can be much larger in Stata/SE or Stata/MP. The number of

To open STATA on the host computer, click on the “Start” Menu. Then, when you look through “All Programs”, open the “Statistics” folder you should see a folder that says “STATA”. Click on the folde r and it will open up three STATA programs (STATA 10, STATA 11, and STATA 12). These are all the

There are several versions of STATA 14, such as STATA/IC, STATA/SE, and STATA/MP. The difference is basically in terms of the number of variables STATA can handle and the speed at which information is processed. Most users will probably work with the “Intercooled” (IC) version. STATA runs on the Windows, Mac, and Unix computers platform.

Stata/IC and Stata/SE use only one core. Stata/MP supports multiple cores, but only commands are speeded up. . I am using Stata 14 and not Stata 15) Setting up the seed using dataset lename. type can be F create creates a dataset with empty seeds for each variation. If option fill is used, then seeds are random numbers.

Stata/MP, Stata/SE, Stata/IC, or Small Stata. Stata for Windows installation 1. Insert the installation media. 2. If you have Auto-insert Notification enabled, the installer will start auto-matically. Otherwise, you will want to navigate to your installation media and double-click on Setup.exe to start the installer. 3.

STATA/IC, STATA/SE, and STATA/MP. The difference is basically in terms of the number of variables STATA can handle and the speed at which information is processed. Most users will probably work with the “Intercooled” (IC) version. STATA runs on the Windows (2000, 2003, XP, Vista, Server 2008, or Windows 7), Mac, and Unix computers platform.

- However, as of Stata 11: can record edits and apply them to other graphs . A Visual Guide To Stata Graphics, Third Edition, by Michael Mitchell Stata 12 Graphics Manual (may want to start with "graph intro") Stata 12 Graphics. 3 Stata Graphics Syntax graph graphtype graph bar graph twoway plottype graph twoway scatter