Making a figure with Stata or Excel Biostatistics 212 Lecture 7.

Slides:



Advertisements
Similar presentations
Using Charts and Graphs in the Classroom
Advertisements

Using Excel Biostatistics 212 Lecture 4. Housekeeping Questions about Lab 3? –replace vs. recode Final Project Dataset! –“Housekeeping” commands vs. data.
Copywrite Digital Printers
Professional Template for a 72x48 poster presentation
Poster Template for a 841mm x 594mm poster presentation Your name and the names of the people who have contributed to this presentation go here. The names.
Basic epidemiologic analysis with Stata Biostatistics 212 Lecture 5.
Petrophase 2008 Poster Presentation Title
Basic epidemiologic analysis with Stata
Introduction to Spreadsheets Presented by Frank H. Osborne, Ph. D. © 2005 Bio 2900 Computer Applications in Biology.
Basic epidemiologic analysis with Stata Biostatistics 212 Lecture 5.
SW318 Social Work Statistics Slide 1 Using SPSS for Graphic Presentation  Various Graphics in SPSS  Pie chart  Bar chart  Histogram  Area chart 
Pasewark & Pasewark Microsoft Office XP: Introductory Course INTRODUCTORY MICROSOFT EXCEL Lesson 8 – Worksheet Charts.
About this template This template was designed to produce a 48x36 poster. You can modify it as needed for your presentation. By using this.
Example layout for an A1 poster presentation
ADVANCED MICROSOFT POWERPOINT Lesson 6 – Creating Tables and Charts
Instructor: Professor Cora Martinez, PhD Department of Civil and Environmental Engineering Florida International University.
Creating Graphs in Excel. Step Summary Input data Highlight data to be graphed Insert  Chart Decide what type of graph to use Finish!
Making a figure, dates, and other advanced topics Biostatistics 212 Lecture 6.
Basic epidemiologic analysis with Stata Biostatistics 212 Lecture 5.
Abstract # 0000 Make the Main Title with Large Bold Type Use Smaller Type for the Subtitle. Above Type is 105pt. This Type is 70pt. Make authors’ names.
Moodle (Course Management Systems). Assignments 1 Assignments are a refreshingly simple method for collecting student work. They are a simple and flexible.
Making Tables and Figures with Stata Biostatistics 212 Lecture 6.
Organizing a project, making a table Biostatistics 212 Lecture 7.
Organizing a project, making a table Biostatistics 212 Session 5.
A Picture Is Worth A Thousand Words. DAY 7: EXCEL CHAPTER 4 Tazin Afrin September 10,
Please put the title here
Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6.
Basic epidemiologic analysis with Stata Biostatistics 212 Lecture 5.
Math 15 Introduction to Scientific Data Analysis Lecture 3 Working With Charts and Graphics.
Organizing a project, making a table Biostatistics 212 Lecture 7.
Introduction to Statistical Computing in Clinical Research Biostatistics 212.
Making Tables and Figures with Stata Biostatistics 212 Lecture 6.
Creating Graphs in PowerPoint Step 1 Open a new PowerPoint Document.
1. Tables, Charts, and Graphs Microsoft Word & Excel 2003.
Abadan Faculty of Petroleum Engineering Petroleum University of Technology Petroleum University of Technology │ About this template This.
The dangers of an immediate use of model based methods The chronic bronchitis study: bronc: 0= no 1=yes poll: pollution level cig: cigarettes smokes per.
PowerPoint: Charts Computer Information Technology Section 5-12 Some text and examples used with permission from: Note: We are.
Conditional Logistic Regression Epidemiology/Biostats VHM812/802 Winter 2016, Atlantic Veterinary College, PEI Raju Gautam.
Advanced Charts Lesson 9. Objectives 1. Create charts by using data from other applications. 2. Modify chart types. 3. Add and modify chart options. 4.
Creating Charts Ms. Hall Spring Using the Insert Tab to Create Charts The Insert tab contains the command groups you’ll use to create charts in.
Ing. Martina Majorová, FEM SUA Statistics Lecture 2 – Introduction to MS Excel 2003.
Painting a Picture Worth 1000 Words: Using Microsoft Excel or R Statistical Software (or Adobe Photoshop Elements) to Create Graphs and Charts with Powerful.
Creating Web Pages in Word. Sharing Office Files Online Many Web pages are created using the HTML programming language. Web page editors are software.
Lesson 1 Notes.  A chart is a representation of worksheet data. A chart can enhance and simplify the of numerical data in a worksheet because the between.
Professional Template for a 48x36 poster presentation
The poster title goes here and here
Biannual Postgraduate Seminar
Professional Template for a 48x36 poster presentation
Professional Template for a 60x36 poster presentation
The poster title goes here and here
Professional Template for a 48x36 poster presentation
Poster Template for a 1189mm x 841mm poster presentation
Introduction to Logistic Regression
Poster title Author(s) Institution(s) Corresponding author’s Name
Poster title Author(s) Institution(s) Corresponding author’s Name
Copywrite Digital Printers
Copywrite Digital Printers
Copywrite Digital Printers
The poster title goes here and here
The poster title goes here and here
Poster Template for a 1189mm x 841mm poster presentation
Title of a Poster Paper for IW-FCV2019
The poster title goes here and here
Professional Template for a 80(width) x 100(height) cm2 poster presentation Your name and the names of the people who have contributed to this presentation.
The poster title goes here and here
The poster title goes here and here
The poster title goes here and here
Presentation transcript:

Making a figure with Stata or Excel Biostatistics 212 Lecture 7

Housekeeping Lab 5 cleanup –Which p-value is which? –Deciding when to “call” an interaction Final Project questions? –Print and hand in to Olivia or Allison (5 th floor) by the end of the day on 9/19/06 –20 points docked for each 1 day late – or call for help! PLEASE DO COURSE EVALUATIONS –You’ll get a link by

. cs dead anycac, by(ageover60) ageover60 | RR [95% Conf. Interval] M-H Weight | | Crude | M-H combined | Test of homogeneity (M-H) chi2(1) = Pr>chi2 =

. mhodds dead anycac, by(ageover60) Maximum likelihood estimate of the odds ratio Comparing anycac==1 vs. anycac==0 by ageover ageov~60 | Odds Ratio chi2(1) P>chi2 [95% Conf. Interval] | | Mantel-Haenszel estimate controlling for ageover Odds Ratio chi2(1) P>chi2 [95% Conf. Interval] Test of homogeneity of ORs (approx): chi2(1) = 0.02 Pr>chi2 =

. xi: logistic dead i.anycac*i.ageover60 i.anycac _Ianycac_0-1 (naturally coded; _Ianycac_0 omitted) i.ageover60 _Iageover60_0-1 (naturally coded; _Iageover60_0 omitted) i.any~c*i.ag~60 _IanyXage_#_# (coded as above) Logistic regression Number of obs = LR chi2(3) = Prob > chi2 = Log likelihood = Pseudo R2 = dead | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] _Ianycac_1 | _Iageover6~1 | _IanyXage_~1 |

. logistic dead anycac ageover60 Logistic regression Number of obs = LR chi2(2) = Prob > chi2 = Log likelihood = Pseudo R2 = dead | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] anycac | ageover60 |

. cs dead anycac, by(male) male | RR [95% Conf. Interval] M-H Weight | | Crude | M-H combined | Test of homogeneity (M-H) chi2(1) = Pr>chi2 =

Housekeeping Lab 5 cleanup –Which p-value is which? –Deciding when to “call” an interaction Final Project questions? –Print and hand in to Olivia or Allison (5 th floor) by the end of the day on 9/19/06 –20 points docked for each 1 day late – or call for help! PLEASE DO COURSE EVALUATIONS –You’ll get a link by

Today... Figure basics –Why make a figure? –Types of figures –Elements of a figure Steps in making a figure Stata versus Excel The Final Project, grading

Figures Figures are GOOD for presenting overall effects Figure are NOT GOOD for presenting specific measurements Browner, W. Publishing and Presenting Clinical Research

Figures “A picture is worth a thousand words”

Figures “A picture is worth a thousand words” How many words is this picture worth?

Figures “A picture is worth a thousand words” How many words is this picture worth? 48% of CARDIA participants consume alcohol moderately. Worth = 7 words

Figures “A picture is worth a thousand words” How many words is this picture worth?

Figures “A picture is worth a thousand words” How many words is this picture worth? WhiteBlack Drinks/dayn=1935n= %57% %26% %9% 2+8%8% Worth = 1 small table

Figures “A picture is worth a thousand words” How many words is this picture worth?

Figures “A picture is worth a thousand words” How many words is this picture worth? % with CAC AbstainerMod drinker Black women White women Black men White men

Figures “A picture is worth a thousand words” How many words is this picture worth? Worth = “A thousand words”?

Figures “A picture is worth a thousand words” How many words is this picture worth?

Figures “A picture is worth a thousand words” How many words is this picture worth? Worth = 968 data points + lines > 1000 words?

Figures “A picture is worth a thousand words” Guidelines –Figures should have a minimum of 4 data points –Convey important effects, or interactions Browner, W. Publishing and Presenting Clinical Research

Figures Types of figures –Photographs –Diagrams –Data representation Browner, W. Publishing and Presenting Clinical Research

Figures Types of data figures –Pie charts –Bar graphs –Line graphs –Scatter plots –Box plots Browner, W. Publishing and Presenting Clinical Research

Figures Elements of a figure –Graphics (non-text) –Labels (axes, lines/bars, etc), other text –Figure legend (Title, explanations, p-values) Browner, W. Publishing and Presenting Clinical Research

Steps in making a Figure In Stata: –Sketch the Figure, with title –Write a do file –Format so it makes sense and looks nice –Compose a figure legend In Excel: –Sketch the Figure, with title –Dummy data table in Excel –Write a do file to fill in table –Copy and paste the data in –Format so it makes sense and looks nice –Compose a figure legend

Steps in making a Figure Sketch the Figure, with title –Try several versions –Point should be clear at a glance –Requires some artistic vision…

Steps in making a Figure Can I make this figure with Stata?

Stata vs. Excel for Figures Stata –Can create very customizable figures using 1 complex Stata command Easy to recreate – simple do file No error Scatter plots are MUCH easier with Stata –But… Harder to create the first time? - no point and click A little less flexible?

Stata vs. Excel for Figures Excel –Flexible and intuitive point-and-click figures Easy to create and modify Flexible, more options, error bars, adjusted estimates, etc –But… Requires an extra step – copy/pasting to Excel Harder to reproduce Much harder to do scatter plots

Stata vs. Excel for Figures Both Stata and Excel can produce very nice- looking figures.

Steps in making a Figure Write a do file –If making a figure with Stata, your do file might contain only 1 actual Stata command

Steps in making a Figure Write a do file –If making a figure with Stata, your do file might contain only 1 actual Stata command twoway (scatter dfev1 cumpy10 if menthol1==1, msymbol(plus) msize(small) mcolor(black)) /// (scatter dfev1 cumpy10 if menthol1==0, msymbol(circle_hollow)) /// (line m cumpy10 if menthol1==1, sort clcolor(black) clpat(dash) clwidth(thick)) /// (line nm cumpy10 if menthol1==0, sort clcolor(black) clpat(solid) clwidth(thick)) ///, ytitle(Change in FEV1 (milliliters), size(large)) yscale(titlegap(5)) /// xtitle(Pack-years of exposure to tobacco, size(large)) /// xscale(titlegap(3)) /// legend(order(1 "Menthol smokers" 2 "Non-menthol smokers" 3 "Menthol regression" /// 4 "Non-menthol regression")) /// scheme(s1mono) /// graphregion(fcolor(none) lcolor(none) ifcolor(none) ilcolor(none)) /// plotregion(fcolor(none) lcolor(none) ifcolor(none) ilcolor(none))

Steps in making a Figure Write a do file –If making a figure with Stata, your do file might contain only 1 actual Stata command Compose using dialog box from menu

Steps in making a Figure Write a do file –If making a figure with Stata, your do file might contain only 1 actual Stata command Compose using dialog box from menu –If making it with Excel, you’ll need to produce all the numbers with analysis Paste into Excel from log file Use Chart Wizard

Steps in making a Figure Write a do file –If making a figure with Stata, your do file might contain only 1 actual Stata command Compose using dialog box from menu –If making it with Excel, you’ll need to produce all the numbers with analysis Paste into Excel from log file Use Chart Wizard –Either way, you may need additional Stata commands for p-values, figure legend, etc

Steps in making a Figure Format so it looks nice, and makes sense –With Stata: Use dialog box Submit, modify, submit again, etc –With Excel Point, click, modify

Steps in making a Figure Compose a figure legend –Title, explanations, p-values, etc –Separate section in manuscript or at bottom of page – depends on journal

Steps in making a Figure Example – Excel Example - Stata

twoway (scatter dfev1 cumpy10 if menthol1==1, msymbol(plus) msize(small) mcolor(black)) /// (scatter dfev1 cumpy10 if menthol1==0, msymbol(circle_hollow)) /// (line m cumpy10 if menthol1==1, sort clcolor(black) clpat(dash) clwidth(thick)) /// (line nm cumpy10 if menthol1==0, sort clcolor(black) clpat(solid) clwidth(thick)) ///, ytitle(Change in FEV1 (milliliters), size(large)) yscale(titlegap(5)) /// xtitle(Pack-years of exposure to tobacco, size(large)) /// xscale(titlegap(3)) /// legend(order(1 "Menthol smokers" 2 "Non-menthol smokers" 3 "Menthol regression" /// 4 "Non-menthol regression")) /// scheme(s1mono) /// graphregion(fcolor(none) lcolor(none) ifcolor(none) ilcolor(none)) /// plotregion(fcolor(none) lcolor(none) ifcolor(none) ilcolor(none))

graph bar (mean) cac ///, over(modalc) /// over(racegender) /// asyvars /// ytitle(Prevalence of coronary calcification) /// title("Prevalence of coronary calcification in moderate drinkers and abstainers", /// size(medium) span) /// subtitle("By race and gender", size(medsmall))

Summary figure tips Only use a Figure if: –There is an important message to convey –The visual will be more compelling and clear Try using both Stata and Excel –Stata will be harder at first, but often worth it –Browner book, Stata book both helpful Document, label, and be creative

Final Project, grading Grading –80% (256 out of 319 possible) required to get a “Satisfactory” score in the class –Also need to turn in all the Labs, even if they are late

Final Project, grading Final Project will count for 150/319 points –Table – 75 points 35 for do file log –Housekeeping commands: open/close log, use dataset, etc –Analysis: generate numbers in the Table 40 for Table itself –Architecture –Documentation –Formatting/appearance

Final Project, grading Final Project will count for 150/319 points –Figure – 75 points 35 for do file log –Housekeeping commands: open/close log, use dataset, etc –Analysis 40 for Figure itself –Design –Documentation –Formatting/appearance

Final Project, grading Extra credit –10 points extra credit and bragging rights for the most artistic, creative, and clear figure turned in

Final Project, grading Advice –Find a classmate, give them your Table and Figure, and get their critiques. See if they can understand it without any verbal explanation

That’s it! Thanks for your active participation in the course.