Organizing a project, making a table Biostatistics 212 Lecture 7.

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.
Exploring Office Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 1 – Introduction to Excel: What is a Spreadsheet?
Understanding Microsoft Excel
Generating new variables and manipulating data with STATA Biostatistics 212 Lecture 3.
Tutorial 7: Using Advanced Functions and Conditional Formatting
Introduction to Statistical Computing in Clinical Research Biostatistics 212 Course director: Mark Pletcher Teaching Assistant: Lee Zane.
Petrophase 2008 Poster Presentation Title
Introduction to Spreadsheets Presented by Frank H. Osborne, Ph. D. © 2005 Bio 2900 Computer Applications in Biology.
Generating new variables and manipulating data with STATA Biostatistics 212 Session 2.
Basic epidemiologic analysis with Stata Biostatistics 212 Lecture 5.
Introduction to Excel 2007 Bar Graphs & Histograms Psych 209 February 1st, 2011.
E XCEL P ROJECT T UTORIAL. G ETTING YOUR UNIQUE DATA SET … Go to the stat 216 homepage: and.
Graphing with Excel: Graphing Made Easy Mac 2008 Version.
Docs, Spreadsheets, & Presentations. What Do YOU Know???
Lesson: 4 Spreadsheets After completing this lesson, you will be able to: Identify the components of a spreadsheet. Enter data into a spreadsheet. Perform.
RefWorks: Advanced February 13, What We’ll Cover Today Managing Your Personal Database Searching Your Personal Database Linking to the Full Text.
Google Training By: Amy Shannon and Dave Auwerda.
Exploring Excel 2003 Revised - Grauer and Barber 1 Committed to Shaping the Next Generation of IT Experts. Chapter 1 – Introduction to Excel: What is a.
L2: BECOMING SELF- SUFFICIENT IN STATA Getting started with Stata Angela Ambroz May 2015.
Making a figure, dates, and other advanced topics Biostatistics 212 Lecture 6.
Using Excel Biostatistics 212 Lecture 4. Housekeeping Questions about Lab 3? Final Project Dataset! –Check in.
Computers: Tools for an Information Age Chapter 12 Spreadsheets and Business Graphics: Facts and Figures.
Making a figure with Stata or Excel Biostatistics 212 Lecture 7.
MS Word – Mail Merge Basic Steps Create Letter/Labels general information Create Excel File with variable Data Link Files through Mail Merge in Word Print.
P366: Lecture #1 Use of Excel for analysis Lei Chen, MD Jan 6, 2002.
Making Tables and Figures with Stata Biostatistics 212 Lecture 6.
Exploring Microsoft Office XP - Microsoft Word 2002 Chapter 71 Exploring Microsoft Word Chapter 7 The Expert User: Workgroups, Forms, Master Documents,
Tables and Figures. The “Big Picture” For other scientists to understand the significance of your data/experiments, they must be able to: understand precisely.
McGraw-Hill/Irwin The Interactive Computing Series © 2002 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft Excel 2002 Lesson 1 Introduction.
Organizing a project, making a table Biostatistics 212 Lecture 7.
Organizing a project, making a table Biostatistics 212 Session 5.
1 Lesson 18 Organizing and Enhancing Worksheets Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Basic epidemiologic analysis with Stata Part II Biostatistics 212 Lecture 6.
Basic epidemiologic analysis with Stata Biostatistics 212 Lecture 5.
By: Jennifer Huff & Courtney Stenzhorn. What Do YOU Know???
Using PTOManager.co m to create a Student Directory May 4, 2009 L.P.S. VIPS Meeting.
Using Excel Biostatistics 212 Lecture 4. Housekeeping Questions about Lab 3? –replace vs. recode –Cross-checking/recoding missing values –Analysis of.
XP New Perspectives on Integrating Microsoft Office XP Tutorial 3 1 Integrating Microsoft Office XP Tutorial 3 – Integrating Word, Excel, Access, and PowerPoint.
Introduction to Statistical Computing in Clinical Research Biostatistics 212.
Basic Excel The Purpose of this course is to support the student in learning to how to do calculations using Excel Presented by John Mudie, Ph.D., & Stephanie.
Principles of Physics. Download the following files: Syllabus All the documents are available at the website:
Making Tables and Figures with Stata Biostatistics 212 Lecture 6.
Lesson 1 – Microsoft Excel * The goal of this lesson is for students to successfully explore and describe the Excel window and to create a new worksheet.
1. 2 Word Processing Word Processing is writing words and sentences on the computer. It is easy to change or move text in a word document. People use.
Lab Report Guidelines Physical Science Ms. McClammey.
1 Lesson 13 Organizing and Enhancing Worksheets Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Comparison of different output options from Stata
MS Word 2010 Tutorial Prepared by: Mr. R. De Vera ii.
1. Tables, Charts, and Graphs Microsoft Word & Excel 2003.
Prepared by the Academic Faculty Members of IT. Tables Creating Tables. Merging Cells. Splitting Cells. Sorting Tables. Performing Calculations.
An electronic document that stores various types of data.
COM: 111 Introduction to Computer Applications Department of Information & Communication Technology Panayiotis Christodoulou.
It’s a Spreadsheet What’s a Spreadsheet. A spreadsheet is: An interactive computer program that organizes and analyzes data.
Understanding Microsoft Excel
Understanding Microsoft Excel
We know about inserting numbers in Excel and how to sum and average numbers. Insert these numbers and in Cell A9, find the average of the numbers. In.
UW-Superior V10.7 for Instructors
Lesson 2 Tables and Charts
Microsoft Excel Basic Skills
Mail Merge Instructions (Yanick’s Version)
Managing Multiple Worksheets and Workbooks
MS-Office It is a Software Package It contains some programs like
Understanding Microsoft Excel
SUMMER INSTITUTE 2018.
Microsoft Excel 101.
Understanding Microsoft Excel
Charts A chart is a graphic or visual representation of data
Spreadsheets and Data Management
Presentation transcript:

Organizing a project, making a table Biostatistics 212 Lecture 7

Housekeeping Lab 6 issues –Saving, naming graphs and combining graphs –demo Lab 5 issues –Review p-values Evaluations Final Project –Print and hand in to Olivia or Allison (5 th floor) by the end of the day on 9/22/09 –20 points docked for each 1 day late – or call for help!

Saving, naming, and combining graphs Name a graph –option: name(graphname) –graph drop _all at beginning of the do file Save a graph –option: saving(graphname.gph) Combine graphs –graph combine graph1 graph2…

Final Project Follow instructions in the handout Any reasonable table and figure is acceptable

Final Project, grading Grading –80% 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 almost half of the points (170 total) –Table – 85 points 35 for do file log –Housekeeping commands: open/close log, use dataset, etc –Analysis: generate numbers in the Table 50 for Table itself –Architecture –Documentation –Formatting/appearance

Final Project, grading Final Project will count for almost half of the points (170 total) –Figure – 85 points 35 for do file log –Housekeeping commands: open/close log, use dataset, etc –Analysis 50 for Figure itself –Design –Documentation –Formatting/appearance

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

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

Today... How do you keep all those datasets, do files, and log files organized? Steps in making a Table Formatting a Table with Microsoft Word Formatting a Table with Microsoft Excel

Organizing your Stata files Pitfalls –Proliferating dataset –Can’t remember what you did –Can’t remember why you did it –Can’t easily redo with new data

Organizing your Stata files My system (it’s not perfect) 1) Import data into Stata, and SAVE raw dataset 2) Write a do file that “cleans” your data, and saves it as a new clean dataset 3) Write do files for each component of your analysis

Raw data.xls My organizational scheme

Raw data.xls Raw data.dta Cut and paste My organizational scheme

Raw data.xls Raw data.dta In Stata Cut and paste My organizational scheme

Raw data.xls Raw data.dta In Stata Cut and paste Clean data.dta Data prep.doData prep.log My organizational scheme

Raw data.xls Raw data.dta In Stata Cut and paste Clean data.dta Data prep.doData prep.logTable 1.do Table 1.log My organizational scheme

Raw data.xls Raw data.dta In Stata Cut and paste Clean data.dta Data prep.doData prep.logTable 1.do Table 1.log Table 1.xls Cut and paste My organizational scheme

Raw data.xls Raw data.dta In Stata Cut and paste Clean data.dta Data prep.doData prep.logTable 1.do Table 1.log Table 1.xls Cut and paste My organizational scheme Table 1.doc Cut and paste

Raw data.xls Raw data.dta In Stata Cut and paste Clean data.dta Data prep.doData prep.logTable 1.do Table 2.do Table 1.log Table 2.log Table 1.xls Table 2.xls Cut and paste My organizational scheme Table 1.doc Table 2.doc Cut and paste

Organizing your Stata files My system, Step 1 Import data –Minimal pre-processing before importation –Save your raw file – this is the ONLY time you should save a Stata dataset “manually” (i.e. not from a do file)

Organizing your Stata files My system, Step 2 Do file to clean the data should: –Load the RAW data –Generate, modify and label variables as needed –Save the CLEAN data (save command in the do file) –Log the output

Organizing your Stata files My system, Step 3 Analysis do files should –Load the CLEAN data –Do the analysis –Log the output –EVERY number in every table, figure and in the text should be in the logged output

Organizing your Stata files You will end up with: –2 Stata datasets Data, from Excel.dta Data.dta –1 do file used for cleaning Data prep.do –1 do file to create each Table and Figure Table 1.do, Figure 1.do, Text data.do, etc –Matching log files (with the same names) for each do file Data prep.log, Table 1.log, Figure 2.log, Text data.log, etc

Organizing your Stata files Put them all in one folder called, “Stata files”, sort by file type. Example

Organizing your Stata files What do you do if… You want to try 2 different ways of doing something –DON’T create more datasets –DO add more variables in the Data Prep.do (agecat1, agecat2), or add to your analysis do file

Organizing your Stata files What do you do if… You can’t remember what you did –Just look up the correct do file/log file and see

Organizing your Stata files What do you do if… You can’t remember why you did it –DOCUMENT your reasoning with comments in both data prep and analysis do files –Remember how to insert comments: * Comment on 1 line only /* Comment on multiple lines */

Organizing your Stata files What do you do if… You need to redo with new data –Import the new data, save over the RAW dataset –Rerun your Data Prep.do file –Rerun your analysis do files

Organizing your Stata files What do you do if… You need to redo with new age categories, etc –Fix your Data Prep.do file –Rerun your Data Prep.do file –Rerun your analysis do files

Organizing your Stata files What do you do if… You need to redo with new analytic approach –Fix your analysis do file –Rerun your analysis do file

Organizing your Stata files Questions?

Raw data.xls Raw data.dta In Stata Cut and paste Clean data.dta Data prep.doData prep.logTable 1.do Table 2.do Table 1.log Table 2.log Table 1.xls Table 2.xls Cut and paste My organizational scheme Table 1.doc Table 2.doc Cut and paste

Raw data.xls Raw data.dta In Stata Cut and paste Clean data.dta Data prep.doData prep.logTable 1.do Table 2.do Table 1.log Table 2.log Table 1.xls Table 2.xls Cut and paste My organizational scheme Table 1.doc Table 2.doc Cut and paste Lecture 3

Raw data.xls Raw data.dta In Stata Cut and paste Clean data.dta Data prep.doData prep.logTable 1.do Table 2.do Table 1.log Table 2.log Table 1.xls Table 2.xls Cut and paste My organizational scheme Table 1.doc Table 2.doc Cut and paste Lecture 3Lecture 5

Raw data.xls Raw data.dta In Stata Cut and paste Clean data.dta Data prep.doData prep.logTable 1.do Table 2.do Table 1.log Table 2.log Table 1.xls Table 2.xls Cut and paste My organizational scheme Table 1.doc Table 2.doc Cut and paste Lecture 3Lecture 5 Lecture 7

Tables Two main purposes –Present the facts in a compact format –Provide side-by-side comparisons Six main components: –Data –Title, row heading, column headings –Row names –Footnotes Browner, W. Publishing and Presenting Clinical Research

Steps to making a Table Decide what the Table will be about Make the dummy table –Do this FIRST!! Write a do file that will produce each number you need Copy and paste the data in (if possible) Format so it looks nice

Steps to making a Table Deciding what the Table will be about –I like to sketch it out first (on paper) –Logical flow Table 1 describes the sample (stratified by a predictor?) Table 2+ explores bivariate relationship of main predictor with the outcome Table 3+ explores results of adjusting for confounders Other Tables, Figures for interactions, etc.

Steps to making a Table Make the dummy table first –Makes you specify what you actually want! –Guides the analysis –Excel or Word

Steps to making a Table Write a do file that will produce each number you need –Iterative process, as you know

Steps to making a Table Copy and Paste the data in –Copy and Paste each number, or –“Copy Table” (under the “Edit” menu) –Minimize manual retyping, rounding –Use Excel to calculate and round for you

Steps to making a Table Format it so it looks nice –Choose a journal you like, copy the format! You should be able to duplicate it exactly Note horizontal lines, not vertical ones… Double-space your version Footnote as you go - *, †, ‡, §, ║, ¶ (or a,b,c,d,…) –Create a template

Word vs. Excel for Tables Stata  Word –Fewer steps, fewer files –But… More cells to create Can’t cut and paste full tables Doesn’t do any calculations for you

Word vs. Excel for Tables Stata  Excel  Word –Can cut and paste values or whole tables –Set rounding, do calculations easily –Formatting easier? –Copy and Paste into Word (extra step)

Demo Table 1 for “Moderate drinking and coronary calcium in young adults: The CARDIA Study” –Basic content –Sketch –Mock-up in Excel –Generate numbers in Stata –Transfer numbers to Excel –Copy and paste into Word

Summary It’s worth putting thought into your file organization Document everything you do! Mock up your table before doing the analysis Make your tables clear, and pretty

Lab today Your time to work on the Final Project But first – Do Your Evaluation

Thank you! For your active participation in the course Good luck!