Reproducible Research And Dynamic Documents in Stata

Slides:



Advertisements
Similar presentations
HTML Basics Customizing your site using the basics of HTML.
Advertisements

Computers: Tools for an Information Age Writing Your Own Web Page: Using HTML and Web Authoring Tools.
A complete citation, notecard, and outlining tool
HTML: HyperText Markup Language Hello World Welcome to the world!
WeB application development
Website Design.
ASHIMA KALRA.  WHAT IS HTML WHAT IS HTML  HTML TAGS HTML TAGS  FORMATTING TAGS FORMATTING TAGS.
Tutorial 8: Developing an Excel Application
The Web Warrior Guide to Web Design Technologies
Midterm October : Dithering Dithering is using two different colored pixels to produce a third color in between. It is used when the color needed.
CIS101 Introduction to Computing Week 05. Agenda Your questions CIS101 Survey Introduction to the Internet & HTML Online HTML Resources Using the HTML.
CIS101 Introduction to Computing
Chapter 1 Understanding the Web Design Environment
Create a Web Site with Frames
Developing a Basic Web Page with HTML
How to Open Microsoft Word Click Start Click All Programs Click Microsoft Office Click Microsoft Word 2013.
Glencoe Digital Communication Tools Create a Web Page with HTML Chapter Contents Lesson 4.1Lesson 4.1 Get Started with HTML (85) Lesson 4.2Lesson 4.2 Format.
XP Tutorial 5New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Designing a Web Site with Frames Using Frames to Display Multiple Web Pages Tutorial.
Basic HTML The Magic Of Web Pages. Create an HTML folder  Make a folder in your H drive and name it “HTML”. We will save EVERYTHING for this unit here.
Chapter 1 Variables in the Web Design Environment
Web page - A Web page is a simple text file that contains HTML tags (code) that describe what should be displayed on the browser. -The Web browser interprets.
Creating a Simple Page: HTML Overview
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering Da-Yeh University.
XML introduction to Ahmed I. Deeb Dr. Anwar Mousa  presenter  instructor University Of Palestine-2009.
DAT602 Database Application Development Lecture 14 HTML.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
Amber Annett David Bell October 13 th, What will happen What is this business about personal web pages? Designated location of your own web page.
Programming in HTML.  Programming Language  Used to design/create web pages  Hyper Text Markup Language  Markup Language  Series of Markup tags 
HTML history, Tags, Element. HTML: HyperText Markup Language Hello World Welcome to the world!
Reading & Exam Zeid: Chapter 9: XHTML Essential p Read before EXAM 1 Exam is Monday Oct. 25 th Review on Friday Oct. 22 nd.
Learning Web Design: Chapter 4. HTML  Hypertext Markup Language (HTML)  Uses tags to tell the browser the start and end of a certain kind of formatting.
HTML INTRODUCTION, EDITORS, BASIC, ELEMENTS, ATTRIBUTES.
1 CSC 121 Computers and Scientific Thinking David Reed Creighton University HTML and Web Pages.
XP Mohammad Moizuddin Creating Web Pages with HTML Tutorial 1 1 New Perspectives on Creating Web Pages With HTML Tutorial 1: Developing a Basic Web Page.
Programming in HTML.  Programming Language  Used to design/create web pages  Hyper Text Markup Language  Markup Language  Series of Markup tags 
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Copyright 2006 South-Western/Thomson Learning Chapter 17 Creating and Linking Web Pages.
What is Markup and Markup Languages? What is HTML? A Basic HTML Document Basic HTML Tags Tag Attributes and Text Formatting Tags Insert Hyperlinks Add.
IS1811 Multimedia Development for Internet Applications Lecture 4: Introduction to HTML Rob Gleasure
INTRODUCTION. What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is not a programming language,
XML eXtensible Markup Language. Topics  What is XML  An XML example  Why is XML important  XML introduction  XML applications  XML support CSEB.
HTML: Hyptertext Markup Language Doman’s Sections.
LEARNING HTML PowerPoint #1 Cyrus Saadat, Webmaster.
What it is and how it works
Introducing the World Wide Web Internet- a structure made up of millions of interconnected computers whose users communicate with each other and share.
Sahar Mosleh California State University San MarcosPage 1 JavaScript Basic.
HTML Basics. HTML Coding HTML Hypertext markup language The code used to create web pages.
WEEK -1 ACM 262 ACM 262 Course Notes. HTML What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML.
HTML HYPER TEXT MARKUP LANGUAGE. INTRODUCTION Normal text” surrounded by bracketed tags that tell browsers how to display web pages Pages end with “.htm”
XP Review 1 New Perspectives on JavaScript, Comprehensive1 Introducing HTML and XHTML Creating Web Pages with HTML.
LBSC 690 Session 4 Programming. Languages How do we learn a language? Learn by listening Then reading Then writing How do we teach programming? Learn.
Writing Your Own Web Page: Using HTML and FrontPage Chapter 10.
Department of Computer Science, Florida State University CGS 3066: Web Programming and Design Spring
HTML HTML stands for Hyper Text Markup Language. HTML is used in making the base of a Website You can just use an online website maker like weebly.com.
Web Design Terminology Unit 2 STEM. 1. Accessibility – a web page or site that address the users limitations or disabilities 2. Active server page (ASP)
XML Introduction to XML Extensible Markup Language.
What is a Computer An electronic, digital device that stores and processes information. A machine that accepts input, processes it according to specified.
Formatting a Research Paper Lesson 10 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft Word 2013.
Poster Print Size: This poster template is 36” high by 48” wide. It can be used to print a Tri-Fold poster with 12” wings. Placeholders: The various elements.
Blended HTML and CSS Fundamentals 3 rd EDITION Tutorial 1 Using HTML to Create Web Pages.
Online PD Basic HTML The Magic Of Web Pages
HTML Basics.
Introduction to Programming the WWW I
Microsoft Office Illustrated
Microsoft PowerPoint 2007 – Unit 2
Creating Accessible Documents
ICT Word Processing Lesson 1: Introduction to Word Processing
Stata Basic Course Lab 2.
Tutorial 7 – Integrating Access With the Web and With Other Programs
Presentation transcript:

Reproducible Research And Dynamic Documents in Stata ----- Meeting Notes (01/09/15 12:14) ----- What's your experience with Stata? You have your Laptops E. F. Haghish University of Freiburg

Part 1: Reproducible Analyses Why data analysis should be reproducible? How can we communicate the results of the analysis effectively? What kind of errors/obstacles might make the procedure inefficient.

It Is The Statistics Era! Faster and cheaper computers Data is everywhere Internet makes gathering data easy and cheap Many jobs are available in data science Quantitative studies are flourishing

Changes in the traditional Statistics practice Doing more data analysis compared to the past Many exploratory analyses might be done which never make it to the published work Analyses are shared over the internet with colleagues Writing scientific publication has become more cooperative than before Statistical programming has become popular Web-based and interactive statistical applications are emerging

Reproducible Analysis Reproducible Research is more general term, pertaining to broader scope Unreproducible quantitative research = Unreliable Results Unintentional Errors can happen at any stage of research. Design, procedure, assessments, data collection, data management and preparation, analysis procedure, witting, and publication We can devide these errors to two parts. Pre-digitalized data and after digitalized data Reproducible Analysis focuses on the procedure from the time data is digitalized till witting the results

Obstacles of Statistical Analysis A major problem in social sciences where students are tought statistics using ”mouse & click”, although most software support writing syntax Easy to forget Not reproducible Slow Mistakes cannot be corrected Cannot be supervised or checked The procedure cannot be shared Cannot be reused

Improving Reproducibility? Writing syntax alone does not guarantee reproducibility Make the codes easily rerunable, by connecting the whole procedure within a ”main file” do and run cause Stata to execute the commands stored in filename just as if they were entered from the keyboard. do echoes the commands as it executes them, whereas run is silent. Store different codes in separete files and connect them into the master file. Then, running the master file will run every code in the right order. Always use the raw data to avoid confusion. Comment your codes. Always assume you are intending to share your codes. Write beautifully and explain the code, when it’s needed.

Example of Master file use rawdata.dta, clear do preparation.do do descriptive.do do analysis.do do report.do In the Master file, the procedure becomes observable in a logical order. If the data analysis is complicated and the number of files increases, it makes re-reading the project analysis much easier, faster, and more efficient. Dynamic document can be written within the do files. This procedure is specially useful for Weaver package.

Dynamic Documents Literate Programming Producing analysis reports Taking notes of complex statistics procedures Teaching statistics

Markup Language Markup, in a broad sense is a ”computer language” used for annoting, formatting, and styling a document using text tags. Example: HTML, RTF, XML, LaTeX

HTML Markup Example Try it now http://www.onlinehtmleditor.net/

LaTeX Markup Example Very sophisticated, and you can do literally anything with it, yet, keep your document light and fast. Try it online at http://papeeria.com/

Markdown Invented by John Gruber (2004), it is a light-weight markup language There are different versions of it available, which are developed by other programmers It’s very popular It has very simple syntax for annoting document But it is limited and is not as sophisticated as HTML or LaTeX It is used for creating a ”Standard Document” that only has the most essentials. It supports headings, paragraph, basic tables, adding image and link, making text bold, italic, etc

Markdown In contrast to HTML and LaTeX, Markdown focuses merely on the ”content” of the document and does not provide anything for changing the formatting of the document. The streangth of Markdown, is its simplicity. After exporting Microsoft Word docx, reduce the left and right margins of the document to 1 cm.

Markdown Make text Italic *text* _text_ Mak text bold **text** Italic and bold ***text*** ___text___

Markdown Header 1 This is Header 1 ============ Header 2 ---------------------

Markdown Alternatively, headers can be specified at the beginning of the text using hashtags # This is header 1 ## This is header 2 ### This is header 3 #### This is header 4 ##### This is header 5 ###### This is header 6

Markdown

Markdown Adding web link [text](http://url.com/) Adding Image ! [explanation](./path.png) Note that the image CANNOT be resized or aligned in the document. It will be imported in its current dimentions, and always placed at the left side of the document. If the image is in a large size, it will ruin the document, especially in Microsoft Office, Office Libre, and PDF formats.

Markdown Creating an ordered list Apple Orange Cherry

Markdown Creating unordered list, which also can be nested using tab. * Abacus * answer * Bubbles 1. bunk 2. bupkis * BELITTLER 3. burper * Cunning

Markdown To add a horisontal line --- * * * To begin a new line, leave one line empty between the paragraphs. To avoid line wrap, leave 2 or more spaces at the end of the line

Remember! Write your document ONLY WITH ONE MARKUP LANGUAGE Markdown’s simplicity can improve the readability of your document, so consider writing with Markdown unless you want to write a very sophisticated document in LaTeX or HTML…

Part 2: Lab Session 3 software are taught in the Lab session MarkDoc Weaver CodeMap

ssc install markdoc ssc install weaver http://www.haghish.com/codemap/download.php CodeMap only works on Mac

MarkDoc vs Weaver Weaver only creates HTML and PDF MarkDoc creates HTML, PDF, Microsoft Word DOCX, Open Office ODT, and LaTeX Weaver is very robust and is completely programmed in Stata MarkDoc relies on third-party software, named Pandoc which is a document convertor MarkDoc is suitable for writing documents that include a lot of text. Also, when the author intends to do further work on the generated Docx, LaTeX, etc. Weaver is suitable for briefly explaining the results of a data analysis and sharing the PDF. Weaver also provides live-preview of the document while weaving.

MarkDoc Everything should be wrapped in smcl log file qui log using example, replace … qui log c //removes this command from the document markdoc example, export(html) replace

MarkDoc See markdoc-text.do Text is written as comment inside the log file and can be written using 3 markup languages, Markdown, HTML, and LaTeX This do file includes 3 documents written in Markdown, HTML, and LaTeX. Which one is nicer? /* Writing text in MarkDoc ======================= This is heading 2 ----------------- Text should be written as comment */

MarkDoc Stata commands are used between the commands as usual. MarkDoc automatically include them in the document, regardless of the markup language you are writing with. There are many ways for adding an image/figure to the document. HTML, PDF, and LaTeX formats are very versatile but for adding an image to Microsoft Word document only Markdown can be used.

Writing Dynamic Text Use macros or returned values with text to refer to them. The txt command allows writing text to the document. This cannot be done within the comments signs because the macros will not be interpreted. The txt command can also contain markup signs.

Hiding Commands Use /**/ before a command to hide it. This DOES NOT hide the output. To hide the output use Stata “quietly” command Using “qui log on” and “qui log off” you can excludes some parts of the codes and results from the document. See markdoc_dynamic_text.do

Dynamic Tables MarkDoc can also create dynamic tables use tble command

Stata Journal Publications Use Markdown to create LaTeX files Use style(stata) Use texmaster option

Weaver Weaver has a set of commands for writing the document. weave for starting a new document div puts the commands and results in separate frames img works the same as in markDoc knit for writing dynamic text report for printing a PDF while working on the document weavend for closing the document

Weaver codes only shows the command results only shows the results

CodeMap For understanding the structure of a complicated Statistical package or data analysis It reveals the connections between code files and functions Useful for high-end users are interested to learn statistical programming.