Making a figure, dates, and other advanced topics Biostatistics 212 Lecture 6.

Slides:



Advertisements
Similar presentations
Do files, log files, and workflow in Stata Biostatistics 212 Lecture 2.
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.
Making effective plots: 1.Don’t use default Excel plots! 2.Figure should highlight the key relationships in the data. 3.Should be clear - no extraneous.
Excel Tutorial 4: Enhancing a Workbook with Charts and Graphs
® Microsoft Office 2010 Excel Tutorial 4: Enhancing a Workbook with Charts and Graphs.
TEMPLATE DESIGN © Professional Template for a 48x36 poster presentation Your name and the names of the people who have.
Petrophase 2008 Poster Presentation Title
Basic epidemiologic analysis with Stata
1 Committed to Shaping the Next Generation of IT Experts. Chapter 3 – Graphs and Charts: Delivering a Message Robert Grauer and Maryann Barber Exploring.
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.
TEMPLATE DESIGN © Template for a 36x48 poster presentation Your name and the names of the people who have contributed.
Chapter 9 Creating Graphs in Illustrator. Objectives Create a graph Edit a graph using the Graph Data window Use the Group Selection tool Use the Graph.
NU Data Excel Orientation Graphing of Screening Data and Basic Graphing Functions.
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
XP New Perspectives on Integrating Microsoft Office XP Tutorial 1 1 Integrating Microsoft Office XP Tutorial 1 – Integrating Word and Excel.
Instructor: Professor Cora Martinez, PhD Department of Civil and Environmental Engineering Florida International University.
Key Applications Module Lesson 19 — PowerPoint Essentials
Using a Spreadsheet Chapter 5.
Basic epidemiologic analysis with Stata Biostatistics 212 Lecture 5.
Making a figure with Stata or Excel Biostatistics 212 Lecture 7.
To make a graph in Excel, first you have to highlight the data you want to graph. To do this, click and drag over the “blocks” you need. Be sure to include.
Making Tables and Figures with Stata Biostatistics 212 Lecture 6.
Exploring Excel 2003 Revised - Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 3 – Graphs and Charts: Delivering a.
Examples of different formulas and their uses....
Organizing a project, making a table Biostatistics 212 Lecture 7.
Organizing a project, making a table Biostatistics 212 Session 5.
Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6.
Basic epidemiologic analysis with Stata Biostatistics 212 Lecture 5.
Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill/Irwin TECHNOLOGY PLUG-IN T2 BASIC SKILLS USING EXCEL.
Key Applications Module Lesson 21 — Access Essentials
Organizing a project, making a table Biostatistics 212 Lecture 7.
Making Tables and Figures with Stata Biostatistics 212 Lecture 6.
Session 9 Managerial Spreadsheet Modeling -- Prof. Juran1.
Self-Discovery Concept: Discovering things about yourself can lead to personal success and satisfaction. Unit Essential Question How Can My Principles,
Creating Graphs in PowerPoint Step 1 Open a new PowerPoint Document.
TEMPLATE DESIGN © Professional Template for a 24x36 poster presentation Your name and the names of the people who have.
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.
PowerPoint: Charts Computer Information Technology Section 5-12 Some text and examples used with permission from: Note: We are.
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.
TEMPLATE DESIGN © Professional Template for a 36x48 poster presentation Your name and the names of the people who have.
Professional Template for a 48x36 poster presentation
The poster title goes here and here
Finalizing a Worksheet
Tutorial 4: Enhancing a Workbook with Charts and Graphs
Professional Template for a 48x36 poster presentation
The poster title goes here and here
Professional Template for a 48x36 poster presentation
Professional Template for a 36x48 poster presentation
Poster title Author(s) Institution(s) Corresponding author’s Name
OPTIONAL LOGO HERE Professional Template for a 36 inch high x 48 inch wide Poster Presentation Your name and the names of the people who have contributed.
Poster title Author(s) Institution(s) Corresponding author’s Name
The poster title goes here and here
The poster title goes here and here
Professional Template for a 36x48 poster presentation
The poster title goes here and here
Poster Template for a 841mm x 594mm poster presentation
Professional Template for a 36x48 poster presentation
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.
Business Team With Solutions For Problems
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, dates, and other advanced topics Biostatistics 212 Lecture 6

Housekeeping List of confusing Lab 5 terms –Confounders –Effect modifiers –Moderators –Mediators –Interaction –Adjust for –Control for

Housekeeping List of confusing Lab 5 terms –Confounders –Adjust for = Control for –Effect modification = Interaction Effect modifiers = Modifier = “Interaction factor” –Mediators

Housekeeping Does A cause B? –“A is associated with B before adjusting for C, but not afterwards” –“A is associated with B because A causes C and C causes B” A B C ABC confounder mediator

Housekeeping Does A cause B? –“A is associated with B, and much more so when C is present” A B C Effect modifier

Binge CAC Binge CAC Binge In menIn women (34%)(14%) (15%)(7%) RR = 1.57 ( )RR = 1.50 ( ) RR = 1.94 ( ) RRadj = 1.51 ( )

In men In women RR = 1.57 ( ) RR = 1.50 ( ) Crude RR = 1.94 ( ) RRadj = 1.51 ( ) Compare these to look for CONFOUNDING

In men In women RR = 1.57 ( ) RR = 1.50 ( ) Crude RR = 1.94 ( ) RRadj = 1.51 ( ) Compare these to look for EFFECT MODIFICATION (none here)

In htn In no htn RR = 1.69 ( ) RR = 3.39 ( ) Crude RR = 2.51 ( ) RRadj = 2.38 ( ) Compare these to look for EFFECT MODIFICATION (maybe here?)

Housekeeping Other Lab 5 issues? Lab 4 issues? Final Project questions?

Two-part lecture Making a figure Dates and other fancy stuff –Extra handouts on the web!

Dedication To Andy Choi –Andy helped develop this part of the course –These are adapted from his slides –He will be missed.

Agenda 1.Figure basics –Why make a figure? –Types of figures –Elements of a figure 2.Steps in making a figure with Excel 3.Steps in making a figure with Stata

Why use figures? When a graphical display of information more effectively conveys the intended message than words. “A picture is worth a thousand words”

Types of Figures Photographs Diagrams Figures that Present Numerical Data –Pie charts –Scatter plots –Bar graphs –Line graphs

Figures that Present Numerical Data GOOD for presenting overall effects NOT GOOD for presenting specific measurements EXPENSIVE (in time and $ for journal) Browner, W. Publishing and Presenting Clinical Research

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? (and avoid pie charts in general…)

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? Proportion with CAC AbstainerMod drinker Black women White women Black men White men Can you see the interaction in this table without a figure? (Figures are good for illustrating interactions)

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? Nice to show actual data points along with main effect, if possible!

Steps in making an Excel figure Sketch your figure Make a dummy TABLE Write a.do file to fill in the table Copy and paste from the log file or the results window into the Table Use the Chart Wizard to create the Figure Format, format, format until it looks nice

Steps in making an Excel figure Sketch your figure Make a dummy TABLE Write a.do file Copy and paste from the log file or the results window into the Table Use the Chart Wizard to create the Figure Format, format, format until it looks nice

Steps in making an Excel figure First, ask yourself: “What is the purpose of the figure?” Sketch the Figure, with title –Try several versions –Point should be clear at a glance –Requires some artistic vision…

Steps in making an Excel figure Make a dummy TABLE –Contains the data for the figure –Doesn’t have to look nice

Steps in making an Excel figure Make a dummy TABLE –Contains the data for the figure –Doesn’t have to look nice Write a.do file to fill in the table

Steps in making an Excel figure Make a dummy TABLE –Contains the data for the figure –Doesn’t have to look nice Write a.do file to fill in the table Copy and paste from log file into the Table

Steps in making an Excel figure Make a dummy TABLE –Contains the data for the figure –Doesn’t have to look nice Write a.do file to fill in the table Copy and paste from log file into the Table Use the Chart Wizard to create the Figure

Steps in making an Excel figure Sketch your figure Make a dummy TABLE Write a.do file to fill in the table Copy and paste from the log file or the results window into the Table Use the Chart Wizard to create the Figure Format, format, format until it looks nice

Excel Demonstration…

Pay attention to… Formatting –Make it look nice and professional, but not gaudy –The time-consuming part of making a figure is usually related to formatting.

Pay attention to… Labeling –Your figure should be understandable by itself –All axes should be labeled. –Include important p-values

Pay attention to… The Figure Legend –Title, explanations, extra p-values, etc –Separate section in manuscript or at bottom of page – depends on journal

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, good for bar graphs, etc –But… Requires an extra step – copy/pasting to Excel Harder to reproduce Much harder to do scatter plots

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? Difficult to format: Graphic Editor helps address this

Steps in making an Excel figure Sketch the figure Make a dummy TABLE Write a.do file to fill in the table Copy and paste from the log file or the results window into the Table Use the Chart Wizard to create the Figure Format, format, format until it looks nice

Steps in making a Stata figure Sketch the figure Make a dummy TABLE Write a.do file Copy and paste from the log file or the results window into the Table Use the Chart Wizard to create the Figure Format, format, format until it looks nice

Steps in making a Stata figure 1.Sketch the figure 2.Write a.do file –Compose the command using the dialog box Get the syntax down, multiple iterations –Transfer to your do file and edit

Steps in making a Stata figure 1.Sketch the figure 2.Write a.do file –Compose the command using the dialog box Get the syntax down, multiple iterations –Transfer to your do file and edit 3.Produce graph and edit more? –Graph editor function

Steps in making a Stata figure 1.Sketch the figure 2.Write a.do file –Compose the command using the dialog box Get the syntax down, multiple iterations –Transfer to your do file and edit 3.Produce graph and edit more? –Graph editor function –May need additional Stata commands for calculating p-values, figure legend, etc

Stata commands intro –Pie charts graph pie, over(catvar) –Bar graphs graph bar (mean) yvar1 yvar2, over(catvar1) over(catvar2) asyvars –Box plots graph box contvar1 contvar2, over(catvar1) over(catvar2) –Scatter plots twoway (graphtype yvar xvar) (graphtype yvar xvar) scatter, line, connect, lowess, lfit, qfit, etc

Demo Scatter plots: bmi vs. lipids –Iterative process of adding commands to do file –Cutting and pasting with substitution –Combining plots –Post-graph editing

Final Checklist for Figures 1.Does the figure make its point clearly? 2.Are the axes, line, bars, and points labeled? Are the scales correct? Sig figs appropriate? 3.Does each figure have a legend, not a title? 4.Are the figures numbered, and do they appear in the text in that order? 5.Does the text complement the information in the figures?

Today’s Lab You will create a pie chart, a box plot, and a scatter plot using stata. The focus will be on bringing the figure to publication grade.

graph bar (mean) anycac ///, over(male) /// over(agecat) /// asyvars /// ytitle(Prevalence of coronary calcification) /// title("Prevalence of coronary calcification by age and sex")

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))