Advanced Stata Workshop FHSS Research Support Center.

Slides:



Advertisements
Similar presentations
Creating posters and flyers Lesson -IV. Editing pictures inside Office Office 2007 has tools to edit photos and pictures in the document. Office 2007.
Advertisements

Installing DOS and Windows98 under MS Virtual PC.
Introduction to Formatting VistaPHw Charts Brought to you by: The Vista Partnership February 2007.
KompoZer. This is what KompoZer will look like with a blank document open. As you can see, there are a lot of icons for beginning users. But don't be.
Excel Tutorial 4: Enhancing a Workbook with Charts and Graphs
® Microsoft Office 2010 Excel Tutorial 4: Enhancing a Workbook with Charts and Graphs.
MODULE 4 File and Folder Management. Creating file and folder A computer file is a resource for storing information, which is available to a computer.
Chapter 10—Creating Presentations
Lesson 4 Operating System Customization
Introduction to Excel 2007 Part 2: Bar Graphs and Histograms February 5, 2008.
Excel Charts – Basic Skills Creating Charts in Excel.
1 ADVANCED MICROSOFT POWERPOINT Lesson 5 – Using Advanced Text Features Microsoft Office 2003: Advanced.
LSP 120: Quantitative Reasoning and Technological Literacy Section 118 Özlem Elgün.
Scripts and Flow Control. Scripts So far we have been entering commands directly into the command line But there is a better way Script files (and functions)
Charts and Macros Pretty Pictures. Charts Graphical display of information Often referred to as “Visualization” Allows a more innate grasp of numeric.
Graphing With Excel Presented by Frank H. Osborne, Ph. D. © 2008 ID 2950 Technology and the Young Child.
Introduction to Excel 2007 Bar Graphs & Histograms Psych 209 February 1st, 2011.
Introduction to Excel 2007 Part 1: Basics and Descriptive Statistics Psych 209.
SPSS Statistical Package for the Social Sciences is a statistical analysis and data management software package. SPSS can take data from almost any type.
How To Make Graphs in Microsoft Excel Outline Making Bar Graphs Making Scatter Plots – 1 series Making Scatter Plots – Multiple Series.
Introduction to Excel 2007 Part 3: Bar Graphs and Histograms Psych 209.
Graphing with Excel: Graphing Made Easy Mac 2008 Version.
Adobe Forms THE FORM ELEMENT PANEL. Creating a form using the Adobe FormsCentral is a quick and easy way to distribute a variety of forms including surveys.
How to Analyze Data? Aravinda Guntupalli. SPSS windows process Data window Variable view window Output window Chart editor window.
Histograms Kevin Zhou, Joshua Zhong, and Daniel Falvo.
MBAC 611.  Within your private mbac611 folder create a lab5 folder.  Copy the Moodle file lab3_vars to your lab5 folder.  Start Mathematica  Enter.
Graphs in Science You Can Do It!!!.
Copyright 2007, Paradigm Publishing Inc. EXCEL 2007 Chapter 7 BACKNEXTEND 7-1 LINKS TO OBJECTIVES Record & run a macro Record & run a macro Save as a macro-
MICROSOFT WORD GETTING STARTED WITH WORD. CONTENTS 1.STARTING THE PROGRAMSTARTING THE PROGRAM 2.BASIC TEXT EDITINGBASIC TEXT EDITING 3.SAVING A DOCUMENTSAVING.
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Website Development with Dreamweaver
Key Data Management Tasks in Stata
GUI development with Matlab: GUI Front Panel Components 1 GUI front panel components In this section, we will look at -GUI front panel components -Programming.
1 ADVANCED MICROSOFT POWERPOINT Lesson 10 –Using Advanced Presentation Features Microsoft Office 2003: Advanced.
Microsoft ® Office Excel 2007 Working with Charts.
Name : Tatiana “Tania” Harrison Office : 216 Phone number: CWU page: Syllabus Name :
An Introduction to Office  Office XP and Office 2007 look very different  This introduction should: ◦ Introduce you to some of the basic changes.
Advanced GIS Using ESRI ArcGIS 9.3 3D Analyst part 2.
© 2004 by the McGraw-Hill Companies, Inc. All rights reserved. Creating Charts Lecture 19.
ISU Basic SAS commands Laboratory No. 1 Computer Techniques for Biological Research Animal Science 500 Ken Stalder, Professor Department of Animal Science.
Introduction to SPSS. Object of the class About the windows in SPSS The basics of managing data files The basic analysis in SPSS.
Getting Started with TI-Interactive. TI-Interactive TI-Interactive can be used to create a variety of graphs. Scatter Plots, Line Plots, Histograms, Modified.
Click to add text © 2012 IBM Corporation 1 Visualization of View Data Susan L. Cline SWS Visualization.
CREATING CHARTS By: Dr. Ennis - Cole OBJECTIVES b Identify the elements of an Excel chart b Identify the type of chart represents your data most effectively.
Session 9 Managerial Spreadsheet Modeling -- Prof. Juran1.
GISMO/GEBndPlan Overview Geographic Information System Mapping Object.
WS11-1 ADM , Workshop 11, August 2005 Copyright  2005 MSC.Software Corporation WORKSHOP 11 MACROS: OVERVIEW.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft PowerPoint 2002 Lesson 4 Strengthening.
Graphing Graphing used to Display the Data that scientists collected during a controlled experiment.
Bar Graphs Used for comparing separate groups. Axes X- axis: independent variable (what the scientist controls) Horizontal D – dependent R – responding.
Processing Lab 2 – Geometry Bryce Hutchinson Objectives: Add a dictionary Gain a better understanding of header issues Display geometry correctly Visualize.
 To begin you first need to sign up to Weebly by going to or alternatively and we will create an account.
Chapter One, Section 5: Graphs in Science
Making Bar Graphs and Scatter Plots in Microsoft Excel 2007.
An Introduction to Forms. The Major Steps of a MicroSoft Access Database  Tables  Queries  Forms  Macros  Reports  Modules On our road map, we are.
Computer Programming Modeling a Passive Solar Home.
Introduction to Drafting and Design In order to begin our drawing we have to set the drawing limits or the paper size.
EXCEL GRAPHING *Basic Graphing Steps* by A.B. -NNHS.
Compare and Contrast : Blackboard & a Personal Web Page www3.ltu.edu/~s_schneider/howto/faculty.htm You’ll find this presentation (and another) here :
Progress and Outcome Measures - Part 3 Progress and Outcome Measures Part 3, Slide 1Copyright © 2004, Jim Schwab, University of Texas at Austin.
{ How to Create a Flipchart in ActivInspire Lara Daniel.
COM: 111 Introduction to Computer Applications Department of Information & Communication Technology Panayiotis Christodoulou.
IENG-385 Statistical Methods for Engineers SPSS (Statistical package for social science) LAB # 1 (An Introduction to SPSS)
QM222 A1 Visualizing data using Excel graphs
Unit 7 – Excel Graphs.
Tutorial Tutorial Read all the directions before proceeding
Introduction To Computing BBA & MBA
Stata Basic Course Lab 2.
Introduction to Excel 2007 Part 3: Bar Graphs and Histograms
Microsoft Excel 2007 – Level 2
Presentation transcript:

Advanced Stata Workshop FHSS Research Support Center

Presentation Layout Visualization and Graphing Macros and Looping Panel and Survey Data Postestimation

Visualization and Graphing in Stata

Intro To Graphing In Stata “graph” is often optional. So is “twoway” in this case. Note: Nearly all graphing commands start with “graph”, and “twoway” is a large family of graphs.

Creating Multiple Graphs with “by():” Note that the value label is displayed above the graphs, and the variable label is displayed in the bottom right hand corner.

Overlaying “twoway” graphs The || tells Stata to put the second graph on top of the first one – order matters! You don’t need to type “twoway” twice; it applies to both. This is another way of writing the command – it doesn’t matter which one you use.

"by()" statements with overlaid graphs “qfitci” is a type of graph which plots the prediction line from a quadratic regression, and adds a confidence interval. The “stdf” option specifies that the confidence interval be created on the basis stdf is an option of qfitci. by(foreign) is an option of twoway.

"by()" statements with overlaid graphs Another way of writing the previous command is: So: This was is easier to read. This way is easier to type.

Graphs with Many Options and Overlays You can make pretty impressive graphs just from code, if you overlay the graphs and specify certain options like: multiple axes, notes, titles and subtitles, axis titles and labels, and legends.

Code for Previous Graph This may look scary, but it is actually fairly straightforward. See the accompanying do-file for explanation of each component.

Using the Graph Editor It is often easier to make changes in the graph editor than to specify all the options in code. Let’s make graph 1 into graph 2 by using the graph editor tools.

Recording Edits in the Graph Editor Graph ElementChange Graph TitleEnter Title using quotes to separate lines, color=black Graph SubtitleEnter subtitle Graph RegionColor = Bluish-gray Y-Axis Range = 0 to 16 by 2, axis line = medium thick, add title, label angle = horizontal, grid lines = off X- Axis title = off, minor ticks = off, suggest # of ticks = 8, alternate spacing of adjacent labels = on, change label format, label size=small, axis line = medium thick Plot 1 linecolor=green, width = thick Plot 2 linecolor = blue, width = thick CaptionAdd caption Before you start making changes, click the record button. After you are done, click it again, and save your changes as a recording so you can “play” them back later. We will save this recording as advanced_workshop_1.

Play Your Graph Recording You can create a graph, open the graph editor, click the green play button, and then play back your recorded edits. Or, you can play your edits right from the code: You can also run all of your recorded edits on a different graph, and just change the title: You can run your recorded edits on a graph of a different type, though in this case not all of your edits will make sense:

Storing and Moving Your Recordings Graph recordings are stored as.grec files in your “personal” folder, under the “grec” folder. Type “personal” to see where this is; normally it is C:\ado\personal. So by default Stata should store your.grec files in C:\ado\personal\grec. Unfortunately, if you are not faculty, you are probably using lab computers to use Stata, and when they are re-imaged, you will lose the files in your grec folder. So you can store the recordings on your flash drive by clicking the Browse button when you save your recording. Now, when you are in the graph editor and click the play button, your recording will not appear in the list because it is not stored where Stata knows to look for it. Never fear, just click Browse, and navigate to where your.grec file is. If you want your recording to be available right from code, as in play(advanced_workshop_1), you will need to move it (at least temporarily) to the “grec” folder, or write the directory location in the code: play(E:\flashdrive\Graph Recordings\advanced_workshop_1)

Using Schemes in Graphing Recordings are great if you are going to be making the same kind of graph a lot. But a recording for a scatter plot will hardly affect a histogram at all, and might even make it look terrible. If you want to change the look of all graphs that you make, you may want to make a scheme. Schemes are text files which tell Stata how to draw graphs.

More on Schemes Schemes are very powerful, because they let your implement a certain look without specifying a long series of options in every graph, or running every graph through the graph editor. However, creating schemes is fairly time consuming. For more on creating your own schemes, see: And

Manipulating Graphs: Memory vs. Disk When you draw a graph, it is stored in memory, under the name Graph. If you draw another graph, it replaces the previous one in memory, and is now called Graph. If you want to have multiple graphs up at the same time, you can use the name option. graph save moves your graph from memory to disk, saving it as a.gph file. graph dir lists all graphs in memory and on disk (in the current directory) graph drop drops a graph from memory. Graphs contain the data files they represent, so if the dataset is large, they can actually take up quite a bit of memory.

Manipulating Graphs Demo See do file for demo

More Example Graphs Note: Annotated code is in the do file for all of these Histogram, with overlaid normal distribution

More Example Graphs Use graph bar to make bar graphs

More Example Graphs Use graph combine to combine 3 graphs into one:

More Example Graphs Graph matrix is a great alternative to a correlation matrix to investigate relationships between variables

More Example Graphs Get data labels (called marker labels in Stata) from the values of another variable

More Example Graphs Xtline from a panel data set can overlay lines for each value of panel variable. The labels on the x-axis are often a bit off to start though, as shown.