text stringlengths 0 538k |
|---|
force -freeze sim:/AXI_top/ACLK 1 2, 0 {52 ns} -r 100
force -freeze sim:/AXI_top/ARESETn 0 0
force -freeze sim:/AXI_top/awaddr 32'h00000001 0
force -freeze sim:/AXI_top/araddr 32'H00000000 0
force -freeze sim:/AXI_top/wdata 32'hcdaccafe 0
force -freeze sim:/AXI_top/mstr/wstrb 1111 0
run
force -freeze sim:/AXI_top/ARESE... |
vlog -novopt AXI_top.v
vsim -novopt AXI_top
do wave_top.do
do force_top.do
|
onerror {resume}
quietly WaveActivateNextPane {} 0
add wave -noupdate -expand -group {GLOBAL SIGNALS} -radix hexadecimal /AXI_top/slv/ACLK
add wave -noupdate -expand -group {GLOBAL SIGNALS} -radix hexadecimal /AXI_top/ARESETn
add wave -noupdate -group {USER INPUT'S} -radix hexadecimal /AXI_top/araddr
add wave -noupdate... |
clear all
set more off
set matsize 5000
cd "/Users/muhammed/Copy/CEPII"
import excel "/Users/muhammed/Copy/CEPII/Observatory/beta_observatory_country.xlsx", sheet("beta_observatory_country.csv") firstrow clear
keep id name name_3char
rename name_3char iso3
rename name name_observatory
save "Observatory/country_names... |
clear all
set more off
set matsize 5000
// Author: Muhammed A. Yildirim
// Version: 2.0
// Date: April 24, 2014
// License: BSD License
// Created using Stata/MP 12.1
// This file generates the Complexity Variables, namely Economic Complexity Index (ECI),
// Product Complexity Index (PCI), Complexity Outlook Index (OP... |
clear all
set more off
cd "/Users/muhammed/Copy/CEPII"
import excel "/Users/muhammed/Desktop/Data/BACI/country_code_baci92.xlsx", sheet("country_code_baci92.csv") firstrow clear
keep iso3 i
drop if i==.
drop if iso3 == ""
drop if length(iso3) != 3
duplicates drop iso3 i, force
rename id exporter
use "/Users/muhammed... |
clear all
set more off
// Author: Muhammed A. Yildirim
// Version: 2.0
// Date: April 24, 2014
// License: BSD License
// Created using Stata/MP 12.1
// This file generates the ID match between teh Observatory and CEPII.
cd "$directory"
********************************************************************************... |
clear all
set more off
// Author: Muhammed A. Yildirim
// Version: 2.0
// Date: April 24, 2014
// License: BSD License
// Created using Stata/MP 12.1
// This file creates the files for the Atlas website.
cd "$directory"
/*
Complexity File: country_id product_id year export_value import_value selected rca mcp eci pci... |
clear all
set more off
// Author: Muhammed A. Yildirim
// Version: 2.0
// Date: April 24, 2014
// License: BSD License
// Created using Stata/MP 12.1
// This file creates the population, GDP and Wholesale Price Index variables used
// in the calculations and also reported in the Atlsa.
cd "$directory"
local wdifile "... |
clear all
set more off
// Author: Muhammed A. Yildirim
// Version: 2.0
// Date: April 24, 2014
// License: BSD License
// Created using Stata/MP 12.1
// This file reads the file created by CEPII and released in BACI dataset.
// Your institution should have access to UN COMTRADE Database to download the BACI dataset.
/... |
clear all
set more off
set matsize 5000
// Author: Muhammed A. Yildirim
// Version: 2.0
// Date: April 24, 2014
// License: BSD License
// Created using Stata/MP 12.1
// This file contains the preferred order of running the do files.
// First two lines create the support files used in the next stages.
// Current versi... |
*! cdifdif: Estimating difference-in-differences in the presence of local spillovers
*! Version 1.0.0 august 14, 2017 @ 16:25:00
*! Author: Damian Clarke
*! Department of Economics
*! Universidad de Santiago de Chile
*! damian.clarke@usach.cl
cap program drop cdifdif
program cdifdif, eclass
vers 11.0
#delimit ;
synt... |
/* resultsMunic.do v1.00 damiancclarke yyyy-mm-dd:2017-07-23
----|----1----|----2----|----3----|----4----|----5----|----6----|----7----|----8
This file replicates the results from Abouk and Adams (2013)' analysis of the
impact of text messaging bans on fatal single-vehicle-single occupant acci... |
*! cdifdif: Estimating difference-in-differences in the presence of local spillovers
*! Version 1.0.0 august 14, 2017 @ 16:25:00
*! Author: Damian Clarke
*! Department of Economics
*! Universidad de Santiago de Chile
*! damian.clarke@usach.cl
cap program drop cdifdif
program cdifdif, eclass
vers 11.0
#delimit ;
synt... |
*! comtrade version 1.03
*! Jan Ditzen
*! June 2020
program define comtrade, rclass
syntax [anything ], [ ///
/// program options
append(string) /// append dataset
variables(string) /// obtains only specific variables
load /// load data at end
nocheck /// no check for val... |
// Drop program if already loaded in memory
cap prog drop libd3
// Define program to automate compiling mata classes for D3js wrappers
prog def libd3, rclass
// Version of Stata to use
version 12
// Define syntax structure for program
syntax [, DIsplay MLib MOSave dir(passthru) REPlace size(integer 2048) /... |
**** FIGURE 1:
// highschool:
clear all
global dir= "/Users/louisleibovici/Desktop/EC2C1 Project"
use "project1.dta", clear
gen window44 = abs(dif) <=44
gen dif_x_before1955 = dif * before1955
reg highschool before1955 dif dif_x_before1955 i.month i.province_n i.ethnicity i.education i.female i.survey_taker_id... |
**** FIGURE 2:
// Days outside last week:
clear all
global dir= "/Users/louisleibovici/Desktop/EC2C1 Project"
use "project1.dta", clear
gen window44 = abs(dif) <=44
gen dif_x_before1955 = dif * before1955
reg outside_week before1955 dif dif_x_before1955 i.month i.province_n i.ethnicity i.education i.female i.surve... |
**** FIGURE 3:
// mental distress index:
clear all
global dir= "/Users/louisleibovici/Desktop/EC2C1 Project"
use "project1.dta", clear
gen window44 = abs(dif) <=44
gen dif_x_before1955 = dif * before1955
reg z_depression before1955 dif dif_x_before1955 i.month i.province_n i.ethnicity i.education i.female i.sur... |
**** TABLE 3:
clear all
global dir= "/Users/louisleibovici/Desktop/EC2C1 Project"
use "project1.dta", clear
ssc install outreg2
gen window17 = abs(dif) <=17
gen window30 = abs(dif) <=30
gen window45 = abs(dif) <=45
gen window60 = abs(dif) <=60
gen dif_x_before1955 = dif * before1955
eststo clear
// Days outside... |
**** TABLE 4:
clear all
global dir= "/Users/louisleibovici/Desktop/EC2C1 Project"
use "project1.dta", clear
ssc install outreg2
gen window17 = abs(dif) <=17
gen window30 = abs(dif) <=30
gen window45 = abs(dif) <=45
gen window60 = abs(dif) <=60
gen dif_x_before1955 = dif * before1955
eststo clear
// for mental d... |
**** TABLE 6:
clear all
global dir= "/Users/louisleibovici/Desktop/EC2C1 Project"
use "project1.dta", clear
gen window17 = abs(dif) <=17
gen window30 = abs(dif) <=30
gen window45 = abs(dif) <=45
gen window60 = abs(dif) <=60
gen dif_x_before1955 = dif * before1955
gen before1955_x_hhsize = before1955 * hh_size
g... |
**** TABLE 7:
clear all
global dir= "/Users/louisleibovici/Desktop/EC2C1 Project"
use "project1.dta", clear
#delimit ;
global list1 "outside_week under_curfew never_out";
#delimit cr
gen controldummy = 0
replace controldummy = 1 if before1955 == 0
egen index_mobility = weightave2($list1), normby(controldummy)
ss... |
*Use Urban Institute's Education Data Portal to pull number of graduates by race*gender in a specificied major*college, 1994-2016
*Source: IPEDS awards by 6-digit CIP code (Documentation: https://educationdata.urban.org/documentation/colleges.html#ipeds-awards-by-6-digit-cip-code)
*Install the educationdata Stata pack... |
*! version 0.4.3
program educationdata
version 11.0
mata: if (findfile("libjson.mlib") != "") {} else stata("ssc install libjson");
mata: if (libjson::checkVersion((1,0,2))) {} else printf("{err: The JSON library version is not compatible with this command and so will likely fail. Please update libjson by running the f... |
*! version 0.4.3
program educationdata
version 11.0
mata: if (findfile("libjson.mlib") != "") {} else stata("ssc install libjson");
mata: if (libjson::checkVersion((1,0,2))) {} else printf("{err: The JSON library version is not compatible with this command and so will likely fail. Please update libjson by running the f... |
/*** DO NOT EDIT THIS LINE -----------------------------------------------------
Version: 0.0.1
Title: numplusone
Description: input a number, it will add one to it and print the output
[Education Data Package](http://www.github.com/UI-Research/education-data-package-stata) website
-------------------------------------... |
*! version 1.2
program define elasticregress, eclass byable(recall)
version 13
syntax varlist(min=2 numeric fv) [if] [in] [aweight], [ ///
alpha(real -1) numalpha(integer 6) ///
lambda(real -1) numlambda(integer 100) lambdamin lambda1se ///
numfolds(integer 10) epsilon... |
*! version 1.2
* This command calculates the LASSO estimator of a linear regression. It is a
* wrapper for elasticregress.
program define lassoregress, eclass byable(onecall)
version 13
syntax varlist(min=2 numeric fv) [if] [in] [aweight], [ ///
lambda(real -1) numlambda(integer 100) lambda1se lambdamin... |
*! version 1.2
* This command calculates the ridge regression estimator of a linear regression.
* It is a wrapper for elasticregress.
program define ridgeregress, eclass byable(onecall)
version 13
syntax varlist(min=2 numeric fv) [if] [in] [aweight], [ ///
lambda(real -1) numlambda(integer 100) lambda1s... |
cap program drop fect
cap program drop cross_validation
cap program drop fect_counter
cap program drop placebo_Test
cap program drop carryover_Test
cap program drop permutation
cap program drop _gwtmean
program define fect,eclass
version 15.1
syntax varlist(min=1 max=1) [if], Treat(varlist min=1 max=1) ///
... |
*! version 0.0.8 18feb2019 Isaac M. E. Dodd
*##############################################################################*
********************************************************************************
*** FLOWCHART - SUBJECT DISPOSITION FLOW DIAGRAM FIGURE GENERATOR ****
******************************... |
********************************************************************************
****** EXAMPLE
********************************************************************************
*
********************
* INTRODUCTION: Producing a Subject Disposition Flowchart
********************
*
* A similar example flowchart can be s... |
********************
* EXAMPLE 2:
********************
* TESTS: This is a barebones test file for running tests. Use this as a template
* of the flowchart syntax to follow.
flowchart init using "filename.data"
* |||||| TEST1: Row with 2 blocks.
flowchart writerow(rownametest1): "lblock1_line1" 46 "This is one line, ... |
* Compare the variables region-no_good_at_all of the datasets firstEntry.dta and
* secondEntry.dta, using variable uniqueid to match observations
use firstEntry
cfout region-no_good_at_all using secondEntry, id(uniqueid)
* Save the differences to the file diffs.dta
cfout region-no_good_at_all using secondEntry, id(uni... |
G75*
%MOIN*%
%OFA0B0*%
%FSLAX25Y25*%
%IPPOS*%
%LPD*%
%AMOC8*
5,1,8,0,0,1.08239X$1,22.5*
%
%ADD10C,0.00000*%
%ADD11C,0.00100*%
D10*
X0002038Y0001200D02*
X0002038Y0148650D01*
X0376959Y0148650D01*
X0376959Y0001200D01*
X0002038Y0001200D01*
X0012018Y0030550D02*
X0012018Y0033050D01*
X0115768Y0033050D01*
X0115768Y0030550D01*
... |
*! version 1.1.1 24aug2021 Ben Jann
capt which colorpalette
if _rc {
di as err "-colorpalette- is required; type {stata ssc install palettes, replace}"
if c(stata_version)>=14.2 {
capt findfile lcolrspace.mlib
if _rc {
di as error "-colrspace- is required; type {stata ssc install ... |
*! version 1.0.1 19jul2021 Ben Jann
program hexplot
version 13
_parse comma spec 0 : 0
syntax [, VERTical HORizontal odd even left right ///
HEXagon HEXagon2(passthru) scatter scatter2(passthru) ///
BCuts(passthru) XBCuts(passthru) YBCuts(passthru) * ]
if `"`hexagon'`hexagon2'"'!="" {... |
*TITLE: HISTORICAL MINIMUM WAGES, Expanding the Daily Minimum Wage Changes File
*Description: This .do file expands the daily minimum wage changes by state file and merges it with a daily federal minimum wage changes file.
set more off
clear all
*SETTING GLOBAL DIRECTORIES
* You will need to change the $home directo... |
*TITLE: SUBSTATE MINIMUM WAGES, Expanding the daily Minimum Wage Changes File
*Description: This .do file expands the daily minimum wage changes by city/locality file.
*IT REQUIRES the state-level minimum wage output of state_mw.do.
set more off
clear all
*SETTING GLOBAL DIRECTORIES
* You will need to change the $ho... |
github install haghish/weaver
github install haghish/md2smcl
github install haghish/datadoc
|
// the 'make.do' file is automatically created by 'github' package.
// execute the code below to generate the package installation files.
// DO NOT FORGET to update the version of the package, if changed!
// for more information visit http://github.com/haghish/github
make markdoc, replace toc pkg version(5.0.0) ... |
// documentation is written for markdoc package (github.com/haghish/markdoc)
// . markdoc markdoc.ado, mini export(sthlp) replace
/***
_version 5.0.0_
markdoc
=======
__markdoc__ is a general-purpose literate programming package for Stata that
produces _dynamic analysis documents_, _presentation slides_, as well as... |
// documentation is written for markdoc package (github.com/haghish/markdoc)
// . markdoc markdoc.ado, mini export(sthlp) replace
/***
_version 5.1.0_
markdoc
=======
__markdoc__ is a general-purpose literate programming package for Stata that
produces _dynamic analysis documents_, _presentation slides_, as well as... |
/*
Developed by E. F. Haghish (2014)
Center for Medical Biometry and Medical Informatics
University of Freiburg, Germany
haghish@imbi.uni-freiburg.de
* MarkDoc comes with no warranty *
MarkDoc Package
===============
This ado file is a part... |
/*
Developed by E. F. Haghish (2014)
Center for Medical Biometry and Medical Informatics
University of Freiburg, Germany
haghish@imbi.uni-freiburg.de
* MarkDoc comes with no warranty *
MarkDoc Package
===============
This ado file is a part... |
*capture program drop markdocstyle
program markdocstyle
version 11
syntax [anything] , export(str) tmp(str) tmp1(str) [master] [markup(str)] ///
[STYle(name)] [debug] [noisily] [figure] [toc] [date] [title(str)] ///
[affiliation(str) author(str) address(str) summary(str) ] ///
[template(str)] [mathjax] [sta... |
/*
Developed by E. F. Haghish (2014)
Center for Medical Biometry and Medical Informatics
University of Freiburg, Germany
haghish@imbi.uni-freiburg.de
* MarkDoc comes with no warranty *
MarkDoc Package
===============
This ado file is a part... |
/*
Developed by E. F. Haghish (2014)
Center for Medical Biometry and Medical Informatics
University of Freiburg, Germany
haghish@imbi.uni-freiburg.de
* MarkDoc comes with no warranty *
*/
program define markdocwkhtmltopdf
version 11
**... |
/*
Developed by E. F. Haghish (2014)
Center for Medical Biometry and Medical Informatics
University of Freiburg, Germany
haghish@imbi.uni-freiburg.de
* MarkDoc comes with no warranty *
markup program
===============
This program is a part o... |
// documentation is written for markdoc package (github.com/haghish/markdoc)
// . markdoc mdconvert.ado, mini export(sthlp) replace
/***
_v. 1.3_
mdconvert
=========
__mdconvert__ converts [Markdown](https://daringfireball.net/projects/markdown/) to
Microsoft Word __docx__ or __pdf__ within Stata
Syntax
------
... |
// documentation is written for markdoc package (github.com/haghish/markdoc)
// . markdoc mdminor.ado, mini export(sthlp) replace
/***
_v. 1.3_
mdminor
=======
__mdminor__ interprets Markdown syntax and converts it in
Microrosoft Word's __docx__ format or __pdf__ format
Syntax
------
> __mdminor__ _text_ [, _... |
// documentation is written for markdoc package (github.com/haghish/markdoc)
// . markdoc mini.ado, mini export(sthlp) replace
/***
_version 4.8_
mini
=====
__mini__ is a simplified command to call the _mini_ engine from the __markdoc__
package
Syntax
------
> __mini__ _filename_ [, _options_ ]
where _options_... |
// documentation is written for markdoc package (github.com/haghish/markdoc)
// . markdoc wpandoc.ado, mini export(sthlp) replace
/***
_v. 1.1_
pandoc
======
__pandoc__ executing [Pandoc](http://pandoc.org/) from Stata
Syntax
------
> __pandoc__ _anything_
Description
-----------
[Pandoc](http://pandoc.org/) i... |
local namelist aliceblue ghostwhite navajowhite ///
antiquewhite gold navy ///
aqua goldenrod oldlace ///
aquamarine gray olive ///
azure green olivedrab ///
beige... |
// CREATES A LOG AND CALLS MARKDOC!
*capture prog drop rundoc
program define rundoc
syntax [anything(name=dofile id="The do file name is")] ///
[, ///
replace /// replaces the exported file
mini /// run in mini mode, independent of Pandoc and wkhtmltopdf
MARKup... |
// THIS PROGRAM NEEDS CLEANING! YOU'RE WELCOME TO FORK IT
/*
Developed by E. F. Haghish (2014)
Center for Medical Biometry and Medical Informatics
University of Freiburg, Germany
haghish@imbi.uni-freiburg.de
* MarkDoc comes with no warranty *
... |
/***
\newpage
\part{\texttt{markdoc} package commands}
\newpage
***/
//IMPORT markdoc.md
//IMPORT mini.md
//IMPORT pandoc.md
//IMPORT wkhtmltopdf.md
/***
\newpage
\part{Additional commands}
\newpage
***/
//IMPORT ../weaver/txt.md
//IMPORT ../weaver/img.md
//IMPORT ../weaver/tbl.md
|
// documentation is written for markdoc package (github.com/haghish/markdoc)
// . markdoc wkhtmltopdf.ado, mini export(sthlp) replace
/***
_v. 1.1_
wkhtmltopdf
===========
__wkhtmltopdf__ renders __html__ documents to __pdf__ within Stata
Syntax
------
> __wkhtmltopdf__ [[_options_](http://wkhtmltopdf.org/usage/w... |
/*
Examples
========
MarkDoc has 3 different engines:
1. convert smcl log-file to document or presentation slides
2. execute a do-file, examine if it's reproducible, and produces dynamic
document or slides
3. reads the documentation written in ado or mata files and export Stata help
files of package vignette
Thi... |
di "hi"
|
/***
Making the source code really reproducible
==========================================
To make the do-file really reproducible, we have to make sure it does not
access the data that is already loaded in Stata. Think about it, if you execute
a do-file on a data that is already loaded and you have been working on... |
// Execute this file to create dynamic slides. Remember that you will need
// pdfLaTeX to be installed
/***
Header
======
sthing will appear
Header 2
--------
### Header 3
#### Header 4
##### Header 5
Part 2
=======
This is a text paragraph. Text can be *italic* or
_italic_. Also, it can be **Bold** or __B... |
// Execute this file to create dynamic slides. Remember that you will need
// pdfLaTeX to be installed
/***
Header
======
sthing will appear
Header 2
--------
### Header 3
#### Header 4
##### Header 5
Part 2
=======
This is a text paragraph. Text can be *italic* or
_italic_. Also, it can be **Bold** or __B... |
display "Hi"
di "what!!"
di "funny"
di "oh ojk"
/***
perhaps something?
***/
scalar a = 10.847958758976
matrix A = (1,2\ 3, 4)
scalar b = A[2,1]
local a = 999
sysuse auto, clear
/***
How about <!a!>?
-----------------
__Price__ equals: <!price[10]!>
And here is Scalar <!b!>
or even <!A[1,1]!> or <!A[2,2]!... |
//OFF
sysuse auto, clear
summarize foreign
scalar c = "Dynamic"
local min = `r(min)'
scalar max = r(max)
matrix Mat = (`r(min)', `r(max)')
//ON
/***
###<!c!> text
The 24^th^ observation in the data is `<!make[24]!>` with a `price` of
<!price[24]!>. The values of the `foreign` variable range between <!`min'!> to
... |
local a = 1
display "Hello World"
/***
The is heading <!`a'!>
======================
***/
|
sysuse auto, clear
summarize foreign
scalar c = "Dynamic"
local min = `r(min)'
scalar max = r(max)
/***
###<!c!> text
The documentation can include numeric and string macros and scalars. For example,
the values of the `foreign` variable range between <!`min'!> to <!max!>.
***/
|
qui log using example, replace
/***
Writing mathematical notations
==============================
The text paragraph can include mathematical notations. For example, this
formula $Y_i = \beta_0 + \beta_1 X_i + \epsilon_i$ will be displayed within
the text paragraph, whereas this next formula will be placed on a se... |
// 1. change the working directory to where this file is saved
// Execute this file with markdoc mini to create dynamic document/slides/sthlp
/***
Header
======
something will appear
---
Header 2
--------
### Header 3
#### Header 4
##### Header 5
---
Part 2
=======
This is a text paragraph. Text can be *ita... |
/***
Title
=====
subtitle
--------
---
# Tables
Your documents, slides, and help files can include tables!
| Tables | style of table | Cool |
| :-------------- |:-------------------- | :------ |
| col 3 is | right-aligned | $1600 |
| col 2 is | centered | $1... |
// the MAIN.do executes examples from Stata Blog
// visit https://blog.stata.com/ for more informatin
cd datamanagement
// Web scraping NBA data into Stata
clear
do "./NBA.do"
markdoc "_NBA.smcl" , mini export(md) replace statax // Markdown
markdoc "_NBA.smcl" , mini export(html) replace statax // html
... |
qui log using _timeseries, replace
/***
Handling gaps in time series using business calendars
=====================================================
Author: Ashish Rajbhandari, Senior Econometrician
https://blog.stata.com/2016/02/04/handling-gaps-in-time-series-using-business-calendars/
This is a replication of a po... |
qui log using 0, replace
/***
\begin{table}[]
\centering
\caption{My caption}
\label{my-label}
\begin{tabular}{|l|l|l|}
\hline
\textbf{Animals} & \textbf{Sports} & \textbf{Fruits} \\ \hline
Cat & Soccer & Apple \\ \hline
Dog & Basketball & Orange \\ \hline
\end{tabular}
\end{table}
***/
qui log c
markdo... |
qui log using 0, replace
/***
| Animals | Sports | Fruits |
|---------|------------|--------|
| Cat | Soccer | Apple |
| Dog | Basketball | Orange |
***/
qui log c
markdoc 0, expor() replace
|
qui log using 0, replace
/***
Creating dynamic tables using the `txt` command
===============================================
When you use the `tbl` command for creating a dynamic table, you __MUST__ add an
empty line below the table. Otherwise, the next chunk of text will be appended to
the table, causing the tab... |
qui log using 0, replace
/***
| $\beta$ | __Sports__ | __Fruits__ |
|-------------|------------|------------|
| num1 | soccer | banana |
| num2 | basketball | apple |
***/
tbl ({l}"$$\\beta$$", {c}"Centered", {r}"Right" \ c(os), c(machine_type), c(username))
/***
---
Using inline... |
cd "/Users/haghish/Documents/Packages/markdoc/Examples/Workshops/2018"
/***
Workshop Examples
===============================
This document includes some of the examples of the workshop. I have organized
them in separate do files and the dynamic document will include all of the
examples.
Help
----
If you need h... |
/***
Summarize the data
-------------------
***/
sysuse auto, clear
summarize
histogram price
img, title("Histogram of the `price` variable") w(200) h(130)
|
// Comments will not be in the rendered document
/*
This is a comment
*/
* Another comment
// --------------------------------------------
//OFF
displa "this will be hidden"
//ON
/**/ display "Hellow World"
/***/ display "hello world"
/***
Header
======
sthing will appear
Header 2
--------
### Header 3
##... |
/***
Writing mathematical notations
==============================
The text paragraph can include mathematical notations. For example, this
formula $Y_i = \beta_0 + \beta_1 X_i + \epsilon_i$ will be displayed within
the text paragraph, whereas this next formula will be placed on a separate
line: $$Y_i = \beta_0 + ... |
//IMPORT ./documentation/preparation.txt
clear
sysuse auto
|
clear
sysuse auto
/***
Dealining with the returned values
-----------------------------------
Use the `return list` command to list the returned values. Most of the
estimations are stored in a matrix. Therefore, we copy the matrix
and use it to extract the values dynamically.
***/
regress price mpg foreign
/***... |
//!!!CHANGE THIS PATH ON YOUR COMPUTER!!!
cd "/Users/haghish/Documents/Packages/markdoc/Examples/Workshops/2018/passive"
set linesize 80
capture quietly log close
qui log using example, replace
/*
THIS IS A COMMENT AND WILL NOT BE IN THE DYNAMIC DOCUMENT
*/
/***
Introduction to MarkDoc (heading 1)
============... |
/***
MarkDoc can be executed in 2 seperate modes, which are:
1. Active mode, examining a do-file in a fresh environment
2. Passive mode, converting a smcl log-file to a document
Accordingly, I will create 2 sets of examples to examine
each engine
***/
/***
Active Mode
-----------
Navigate to the active_mini_mode... |
/***
Workshop Example
================
Subheader, Markdown syntax
--------------------------
This is a normal paragraph. We are trying to import
an image to our document. The image is stored in the
working directory. The syntax for importing an image
is as follows
... |
display "Hi"
di "what!!"
di "funny"
di "oh ojk"
/***
perhaps something?
***/
scalar a = 10.847958758976
matrix A = (1,2\ 3, 4)
scalar b = A[2,1]
local a = 999
sysuse auto, clear
/***
How about <!a!>?
-----------------
__Price__ equals: <!price[10]!>
And here is Scalar <!b!>
or even <!A[1,1]!> or <!A[2,2]!... |
/***
Hello World!
============
Just display "Hello World" for now!
***/
display "Hello World"
|
//OFF
sysuse auto, clear
summarize foreign
scalar c = "Dynamic"
local min = `r(min)'
scalar max = r(max)
matrix Mat = (`r(min)', `r(max)')
//ON
/***
### <!c!> `text`
The 24^th^ observation in the data is `<!make[24]!>` with a `price` of
<!price[24]!>. The values of the `foreign` variable range between <!`min'!>... |
// this document produces the dynamic document passively, because a log-file is
// used to generate the PDF file, instead of a do-file!
qui log using summary, replace
/***
Notes
--------
Here are a few important notes
1. As I noted, I have a book about `markdoc` that is nearly finished. I will
send the PDF of ... |
/***
MarkDoc Mini
============
It is just a tradition to begin with __Hello__ _World_!
This is a new text paragraph. I can also use asterisk instead of
underscore to make the text **bold** or *italic*, but the latter
is not supported in Stata help files (supported in html,docx,pdf).
You can separate your document... |
qui log using tbl, replace
sysuse auto, clear
//OFF
foreach var of varlist weight price mpg {
summarize `var'
local `var'_mean : display %9.2f r(mean)
local `var'_sd : display %9.2f r(sd)
}
//ON
tbl ("Variable Name", "Mean", "SD" \ ///
"__weight__", `weight_mean', `weight_sd' \ ///
"__p... |
local a = 1
display "Hello World"
/***
The is heading <!`a'!>
======================
***/
|
sysuse auto, clear
summarize foreign
scalar c = "Dynamic"
local min = `r(min)'
scalar max = r(max)
/***
# <!c!> text
The documentation can include numeric and string macros and scalars. For example,
the values of the `foreign` variable range between <!`min'!> to <!max!>.
***/
|
/*******************************************************************************
MarkDoc Torture Test
====================
The following do files test different features of MarkDoc package. Run these
files one after another. Note that each do file erases the output of the
previous do-file to ensure the output is rec... |
// -----------------------------------------------------------------------------
// HTML Document Exportation
// =============================================================================
qui log using example, replace smcl
/***
This is heading 1
=================
<h1>This is also HTML written with HTML tag<... |
//capture prog drop markdoc
capture erase example.pdf
sysuse auto, clear
capture log c
qui log using example, replace
/***
---
title: "Dynamic Slides in MarkDoc Package"
author: E. F. Haghish
date: or anything else
fontsize: 14pt
output:
beamer_presentation:
theme: "Boadilla"
colortheme: "lily"
fontthe... |
//cap prog drop markdoc
cap erase example.pdf
qui log using example, replace
/***
---
title: "Habits"
output:
beamer_presentation:
includes:
in_header: body.tex
---
Slide 1
=======
- Writing with __markdown__ syntax al... |
//capture prog drop markdoc
capture erase example.pdf
sysuse auto, clear
capture log c
qui log using example, replace
/***
---
title: "Dynamic Slides in MarkDoc Package"
author: E. F. Haghish
date: February 2016
fontsize: 14pt
output:
beamer_presentation:
theme: "CambridgeUS"
colortheme: "lily"
fontthe... |
//If you produce the slide from the do-file, instead of smcl, remove the log from the
//top line, because the document must begine with the latex heading.
qui log using example, replace
/***
\documentclass{beamer}
\title{Generating PDF slides with LaTeX Markup with MarkDoc package}
\author{E. F. Haghish}
\date{Augu... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.