text stringlengths 0 538k |
|---|
qui log using example, replace
/***
\documentclass{beamer}
\usepackage{default}
\title{Generating PDF slides with LaTeX Markup with MarkDoc package}
\author{E. F. Haghish}
\date{August 15, 2016}
\begin{document}
\maketitle
***/
/***
\begin{frame}
\frametitle{First Slide}
Contents of the first slide
\end{frame}
***/... |
qui log using example, replace
/***
\documentclass{beamer}
\title{Generating PDF slides with LaTeX Markup with MarkDoc package}
\author{E. F. Haghish}
\date{August 15, 2016}
\def\verbatim@font{\ttfamily\tiny}
\makeatother
\begin{document}
\maketitle
***/
/***
\begin{frame}
\frametitle{First Slide}
Contents of the f... |
qui log using example, replace
/***
\documentclass{beamer}
\title{Generating PDF slides with LaTeX Markup with MarkDoc package}
\author{E. F. Haghish}
\date{August 15, 2016}
\begin{document}
\maketitle
***/
/***
\begin{frame}
\frametitle{First Slide}
Contents of the first slide
\end{frame}
***/
display "results fr... |
qui log using example, replace
/***
---
title: "Dynamic Slides in MarkDoc Package"
author: E. F. Haghish
date: February 2016
output:
beamer_presentation:
theme: "Boadilla"
colortheme: "lily"
fonttheme: "structurebold"
---
Creating dynamic slides in Stata
================================
- Dynamic s... |
cap erase programming_course.pdf
capture log c
qui log using programming_course, replace
/***
---
title: "Stata, as a programming language"
author: E. F. Haghish
date: March 2016
fontsize: 14pt
output:
beamer_presentation:
theme: "Boadilla"
colortheme: "lily"
fonttheme: "structurebold"
includes... |
//cd "/Users/haghish/Desktop/new"
/***
\documentclass[11pt]{amsart}
\usepackage{geometry} % See geometry.pdf to learn the layout options. There are lots.
\geometry{letterpaper} % ... or a4paper or a5paper or ...
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{epstopdf}
\Declare... |
/*** DO NOT EDIT THIS LINE -----------------------------------------------------
Version: 0.0.0
Intro Description
=================
packagename -- A new module for ...
Author(s) section
=================
Author name ...
Author affiliation ...
to add more authors, leave an empty line between authors' information... |
/***
Dynamic Graph
=============
1
2
3
+---------+--------
|
+---------+-------+ +--------+ +--------------------+
| markdown|source |------>| mdddia |------+--->| processed markdown |
+---------+-------+ +--------+ | +--------------------+
... |
// -----------------------------------------------------------------------------
// Literate Visualization Notation
// =============================================================================
qui log using 000, replace smcl
/***
Dynamic Software Visualization
=========================
Writing software doc... |
// -----------------------------------------------------------------------------
// empty template
// =============================================================================
qui log using 000, replace smcl
qui log c
markdoc 000, replace exp()
// -----------------------------------------------------------------... |
cd "C:\Users\haghish\Dropbox\STATA\MY PROGRAMS\MarkDoc\MarkDoc 3.6.5"
********************************************************************************
cap qui prog drop markdoc
cap qui log c
qui log using torture, replace
clear
sysuse auto
reg price mpg
/***
This is a text chunk!
=====================
... |
capture erase example.docx
/*
MarkDoc Torture Test 001 : Main Features Test
---------------------------------------------
Author: E. F. Haghish
Institute for Medical Biometry and Statistics (IMBI)
University of Freiburg
http://haghish.com/stat
@haghish
Requirements: Install MarkDoc, Weaver, and S... |
/*
MarkDoc Torture Test 001 : Main Features Test
---------------------------------------------
Author: E. F. Haghish
Institute for Medical Biometry and Statistics (IMBI)
University of Freiburg
http://haghish.com/stat
@haghish
Requirements: Install MarkDoc, Weaver, and Statax packages
Install P... |
// -----------------------------------------------------------------------------
// empty template
// =============================================================================
qui log using example, replace smcl
qui log c
markdoc example, replace markup(latex) exp(tex) //texmaster
qui log using example2, replace ... |
// -----------------------------------------------------------------------------
// begin heading with TXT
// =============================================================================
qui log using example, replace smcl
txt "\documentclass{article}" _n ///
"\usepackage{graphics}" _n ///
"\b... |
// -----------------------------------------------------------------------------
// With MATA
// =============================================================================
qui log using example, replace smcl
/***
Hi there
***/
txt "\section{This is a text heading}"
sysuse auto, clear
summarize price mpg weight
if... |
// -----------------------------------------------------------------------------
// Creating Table of Content
// =============================================================================
cap erase example.pdf
qui log using example, replace smcl
txt \section{This is a text heading}
/***
\subsection{How a... |
// -----------------------------------------------------------------------------
// Creating Table of Content
// =============================================================================
cap erase example.pdf
qui log using example, replace smcl
txt \section{This is a text heading}
/***
\subsection{How a... |
// -----------------------------------------------------------------------------
// template with a TXT & Textmaster command
// =============================================================================
qui log using example, replace smcl
txt \section{This is a text heading}
if 100 > 12 {
local m `n'
}
qui log c... |
capture erase example.smcl
capture erase example.md
// -----------------------------------------------------------------------------
// Stata commands & comments
// =============================================================================
qui log using example, replace smcl
sysuse auto, clear
// this is a commen... |
capture erase example.smcl
capture erase example.md
capture erase example.docx
// -----------------------------------------------------------------------------
// Docx Document Exportation
// =============================================================================
qui log using example, replace smcl
txt "## Te... |
// -----------------------------------------------------------------------------
// empty template
// =============================================================================
qui log using example, replace smcl
qui log c
markdoc example, replace exp()
|
capture erase example.smcl
capture erase example.md
capture erase example.docx
// -----------------------------------------------------------------------------
// HTML Document Exportation
// =============================================================================
qui log using example, replace smcl
/***
Thi... |
capture erase example.smcl
capture erase example.md
// -----------------------------------------------------------------------------
// COMPLEX LOOP
// =============================================================================
qui log using example, replace smcl
/**/ sysuse auto, clear
/***/ sysus... |
capture erase example.smcl
capture erase example.md
// -----------------------------------------------------------------------------
// Special Markups
// =============================================================================
qui log using example, replace smcl
/**/ sysuse auto, clear
/**/ sysuse auto, cl... |
capture erase example.smcl
capture erase example.md
capture erase example.docx
// -----------------------------------------------------------------------------
// Mata
// =============================================================================
qui log using example, replace smcl
txt "## Testing Mata"
clear m... |
capture erase example.smcl
capture erase example.md
// -----------------------------------------------------------------------------
// Markdown notation
// =============================================================================
qui log using example, replace smcl
/***
This is a regular heading
=============... |
capture erase example.smcl
capture erase example.html
// -----------------------------------------------------------------------------
// PDF Document Exportation
// =============================================================================
qui log using example, replace smcl
/***
This is heading 1
===========... |
capture erase example.smcl
capture erase example.pdf
// -----------------------------------------------------------------------------
// Stata Journal Exportation using Markdown
// =============================================================================
qui log using example, replace smcl
/***
This is heading... |
capture erase example.smcl
capture erase example.md
// -----------------------------------------------------------------------------
// Weaver Commands
// =============================================================================
qui log using example, replace smcl
txt "this command can be literally anywhere" _n ... |
/***
`rundoc` command
================
The [`markdoc`](https://github.com/haghish/MarkDoc) command takes a `SMCL` log file
to create a dynamic document or presentation slides. This procedure requires
the user to create a log file and convert it to a dynamic document.
The __`rundoc`__ command, is simply a wrapper f... |
cap erase example.html
cap qui log c
qui log using example, smcl replace
/***
# HTML Slides
- portable
- light
- fit many devices
***/
sysuse auto
summarize price
regress price mpg
forvalues n = 1/5 {
local m 12.3
global sm 23
}
/***
# In the evening
- Eat spaghetti
- Drink wine
... |
cap erase example.html
cap qui log c
qui log using example, smcl replace
/***
# HTML Slides
- portable
- light
- fit many devices
***/
sysuse auto
summarize price
regress price mpg
forvalues n = 1/5 {
local m 12.3
global sm 23
}
/***
# In the evening
- Eat spaghetti
- Drink wine
... |
/***
Adding a list
=============
* this is a text line
* this is also
* how about this?
Dot in the end
==============
It seems that if a line end with a "." dot,
and a new line is
started adter,
the __sthlp__ engine will add 2 space characters.
Like this.
Is that solved?
This is not true if the tex... |
/*** DO NOT EDIT THIS LINE -----------------------------------------------------
Version: 1.0.0
Intro Description
=================
myprogram -- A new module for to print text. This description can include
multiple lines, but not several paragraphs. You may write the title section
in multiple lines. {help MarkDoc... |
program myprogram
display "`0'"
end
|
// -----------------------------------------------------------------------------
// Test Header
// =============================================================================
cap erase myprogram.ado
copy ./Torture_test/sthlp/myprogram.do myprogram.ado, replace
markdoc myprogram.ado, replace export(sthlp) date
/*tem... |
/*** DO NOT EDIT THIS LINE -----------------------------------------------------
Version: 1.0.0
Intro Description
=================
myprogram -- A new module for to print text. This description can include
multiple lines, but not several paragraphs. You may write the title section
in multiple lines. {help MarkDoc... |
qui {
/**********************************************************************************/
/* program masala_merge : Fuzzy match using masalafied levenshtein */
/*
Meta-algorithm:
1. stata outsheets two files, with an id and a name column.
2. python gets filenames and parameters from command lines, read... |
*CCR# Female Form Cleaning
**Make sure you are using the Female Database with a date
*Should automatically use the FRQ but if not, use the directory below
*use "$datadir/CCR#_FRQ_$date.dta"
**Examples
*drop duplicates, drop forms that are incorrectly created
*Drop duplicate RE Celine Dion
*Two forms for same persion... |
*CCR# Household Form Cleaning
**Make sure you are using the Household Database with a date
**Should not need to update the dataset directory but if you do, use the command below
*use "$datadir/CCR#_Combined_$date"
***RE/EA specific cleaning
*IF there are exact duplicates, drop
*If there are households that were ent... |
// ========= Drop duplicate Households =========
*=========== Clean Structure and Household number errors ==========================
|
****PMA 2020 Data Quality Checks****
** Original Version Written in Bootcamp July 21-23, 2014****
set more off
local CCRX $CCRX
******************************
use `CCRX'_Combined_$date.dta, clear
*Check if there are any remaining duplicates
duplicates report member_number
duplicates report FQmetainstanceID
captur... |
****PMA 2020 Data Quality Checks****
***Version Jan 17 2017****
**VERSION HISTORY AT END OF DO FILE
**First do file in series
/*Code is based on Stata 12 but some commands for Stata 11 and below are included and commented with *.
To use Stata 11 and below, comment out Stata 12 comments and remove the * before Stat... |
/****PMA 2020 Indonesia Data Quality Checks****
***Version Created in Bootcamp July 21-24, 2014
**Fourth do file in series***
This do file labels each variable in the Female Respondent questionnaire */
set more off
**If you want to run this file separately from the parent file, change the working directory below
cd... |
clear
clear matrix
clear mata
capture log close
set maxvar 15000
set more off
numlabel, add
/*******************************************************************************
*
* FILENAME: CCRX_HHQFQ_Wealth_Unmet_Generation_$date.do
* PURPOSE: PMA2020 HHQ/FQ wealth and unmet need generation in preparation for data an... |
clear
clear matrix
clear mata
capture log close
set maxvar 15000
set more off
numlabel, add
/*******************************************************************************
*
* FILENAME: PMA_HHQFQ_2Page_Analysis_$date.do
* PURPOSE: PMA2020 HHQ/FQ two page data analysis
* CREATED: Linnea Zimmerman (lzimme12@jhu.ed... |
****PMA 2020 Indonesia Data Quality Checks****
***Version 20 January 2014****
**Third do file in series***
/*This do file labels each variable in the household roster*/
clear
set more off
cd "$datadir"
local today=c(current_date)
local c_today= "`today'"
local date=subinstr("`c_today'", " ", "",.)
local todaystata=... |
****PMA 2020 Data Quality Checks****
***Version Written in Bootcamp July 21-23, 2014****
**Second do file in series***
clear matrix
clear
cd "$datadir"
/*This do file imports the Household Questionnaire (without the roster) into Stata and then cleans it*/
set more off
/*Import Household Questionnaire csv file int... |
** GPS checks for HHQ survey
** Authors Ann Rogers - Sally Ann Safi - Beth Larson - Julien Nobili
** Requirements: Listing.dta file (needs to be generated beforehand)
** version 1.1 (April 2019)
**********************Set directory**************************************
local datadir $datadir
local dofiles $d... |
clear
clear matrix
clear mata
capture log close
set maxvar 15000
set more off
numlabel, add
*******************************************************************************
*
* FILENAME: CCRX_Listing_v1_$date.do
* PURPOSE: Generates listing database and
* CREATED: Linnea Zimmerman (lzimme12@jhu.edu)
* DATA IN: ... |
/*
The purpose of this do file is to select households for reinterview.
1. Update the macros below to be country and round specific
2. Update the EA that you are selecting
3. Update the variable names that you want to export and keep
4. The information will export to an excel spreadsheet with the EA name/number
5. ... |
clear
clear matrix
clear mata
capture log close
set maxvar 15000
set more off
numlabel, add
/*******************************************************************************
*
* FILENAME: CCRX_Selection_11May2015
* PURPOSE: Generate database of households selected for interview
* CREATED: Linnea Zimmerman (lzimme... |
pr ste_odkmeta
vers 11.2
_find_project_root
loc dir "`r(path)'/src/main/write"
#d ;
ste using `"`dir'/templates"',
base(`dir'/ODKMetaBaseWriter.mata)
control(ODKMetaController)
complete(`dir'/ODKMetaWriter.mata)
;
#d cr
end
|
pr write_odkmeta_ado
vers 11.2
qui ste_odkmeta
_find_project_root
#d ;
writeado
using `"`r(path)'/src/build/odkmeta.ado"',
stata(main/odkmeta.do)
class_declarations(
Collection
Group
Repeat
Field
)
mata(
// Classes with declaration dependencies
Collection
Group
Repeat
Field
... |
* -odkmeta- cscript
* -version- intentionally omitted for -cscript-.
* 1 to complete test 124; 0 not to.
local test124 0
* 1 to complete live-project testing; 0 not to.
local project 0
* 1 to execute profile.do after completion; 0 not to.
local profile 1
/* ----------------------------------------------------------... |
* Gets the warning messages of an -odkmeta- do-file.
pr get_warnings, rclass
vers 9
syntax anything(name=do id=filename)
gettoken do rest : do
if `:length loc rest' {
di as err "invalid filename"
ex 198
}
if !c(noisily) {
di as err "quietly not allowed"
ex 198
}
* Set parameters.
loc trace 0
if c(... |
* Changes an -odkmeta- do-file so that it attempts to name variables using their
* short field names.
pr shortnames
vers 9
syntax anything(name=fn id="filename")
gettoken fn rest : fn
if `:length loc rest' {
di as err "invalid filename"
ex 198
}
conf f `"`fn'"'
mata: shortnames(st_local("fn"))
end
vers ... |
* Uses -compdta- to compare two directories' sets of datasets.
pr compall
vers 9
args dir1 dir2
if `:length loc 3' ///
err 198
if !`:length loc dir1' {
di as err "dirname1 required"
ex 198
}
if "`dir2'" == "" {
loc dir2 "`dir1'"
loc dir1 .
}
forv i = 1/2 {
loc dtas`i' : dir "`dir`i''" file "*.d... |
* Compare the list of tests actually completed in the cscript to those described
* in Tests.md.
vers 13.1
* 1 to compare odkmeta.do against Tests.md;
* 0 to compare "Project tests.do" against "Project tests.xlsx" (off GitHub).
loc github 1
set varabbrev off
if `github' ///
c odkmeta
else ///
c odkmeta_development... |
* Import Tests.md as a Stata dataset.
vers 13.1
set varabbrev off
infix str line 1-`c(maxstrvarlen)' using Tests.md, clear
replace line = strtrim(line)
assert !strpos(line, char(9))
gen order = _n
su order if line == "<table>"
assert r(N) == 1
drop in 1/`r(min)'
drop order
assert line == "</table>" in L
drop in L... |
pr odkmeta
vers 11.2
cap mata: mata which specialexp()
if _rc {
* [ID 185]
di as err "SSC package specialexp required"
di as err "to install, type {cmd:ssc install specialexp}"
di as err "{p}after installation, you may need to " ///
"{help mata mlib:index Mata} or restart Stata{p_end}"
ex 198
}
#d ;... |
* Attach value labels.
ds, not(vallab)
if "`r(varlist)'" != "" ///
ds `r(varlist)', has(char <%= char_name("list_name") %>)
foreach var in `r(varlist)' {
if !`:char `var'[<%= char_name("is_other") %>]' {
capture confirm string variable `var', exact
if !_rc {
replace `var' = ".o" if `var' == "other"
destring... |
compress
|
* Date and time variables
<% // Add a type attribute to SubmissionDate. %>
capture confirm variable SubmissionDate, exact
if !_rc {
local type : char SubmissionDate[<%= char_name("type") %>]
assert !`:length local type'
char SubmissionDate[<%= char_name("type") %>] datetime
}
local datetime date today time datetime ... |
capture mata: mata drop `values' `text'
set varabbrev `varabbrev'
* Display warning messages.
quietly {
noisily display
#delimit ;
local problems
<% df.indent() %>
allbadnames
<% df.indent() %>
"The following variables' names differ from their field names,
which could not be {cmd:insheet}ed:"
<% df... |
<% // Notes at the top of the do-file %>
* Created on <%= current_date() %> at <%= c("current_time") %> by the following -odkmeta- command:
* odkmeta <%= command_line %>
* -odkmeta- version 1.1.0 was used.
<% // -version- %>
version 9
<% // User parameters not covered by an option %>
* Change these values as required... |
<% `RS' i
`SR' drop
drop = select(fields.attributes()->vals("char"),
!fields.attributes()->vals("keep"))
if (length(drop) == 0)
return
drop = sort(drop', 1)' %>
foreach var of varlist _all {
<% if (length(drop) <= 3) { %>
<% for (i = 1; i <= length(drop); i++) { %>
char `var'[<%= drop[i] %>]
<% } %>
<% } %>... |
* Drop note variables.
ds, has(char <%= char_name("type") %>)
foreach var in `r(varlist)' {
if "`:char `var'[<%= char_name("type") %>]'" == "note" ///
drop `var'
}
|
save, replace
}
|
foreach dta of local dtas {
use "`dta'", clear
unab all : _all
gettoken first : all
local repeat : char `first'[<%= char_name("repeat") %>]
|
replace `var' = `temp'
drop `temp'
encode `var', gen(`temp') label(`list') noextend
move `temp' `var'
foreach char in `:char `var'[]' {
mata: st_global("`temp'[`char']", st_global("`var'[`char']"))
}
drop `var'
rename `temp' `var'
}
}
|
args(`SS' strlists)
* Encode fields whose list contains a noninteger name.
local lists <%= strlists %>
tempvar temp
ds, has(char <%= char_name("list_name") %>)
foreach var in `r(varlist)' {
local list : char `var'[<%= char_name("list_name") %>]
if `:list list in lists' & !`:char `var'[<%= char_name("is_other") %>]' {... |
* Attach field labels as variable labels and notes.
ds, has(char <%= char_name("long_name") %>)
foreach var in `r(varlist)' {
* Variable label
local label : char `var'[<%= char_name("label") %>]
mata: st_varlabel("`var'", st_local("label"))
* Notes
if `:length local label' {
char `var'[note0] 1
mata: st_globa... |
args(
// The name of the .csv file to -insheet-
`SS' csv,
// `True' if all field names in the .csv file can be -insheet-ed (they are
// all `InsheetOK'); `False' otherwise.
`BooleanS' insheetable
)
<% // "qcsv" for "quote csv"
`SS' qcsv
qcsv = adorn_quotes(csv, "list")
if (!insheetable) { %>
insheet using <%= qc... |
args(
// Merge child dataset into parent
pointer(`RepeatS') scalar parent,
`SS' child,
// SET-OF variable of the parent dataset
`SS' set_of
)
<% `SS' description %>
unab before : _all
<% // Check that there is no unexpected variable list overlap. %>
local pos : list posof <%= adorn_quotes(child) %> in repeats
loca... |
<% `SS' expression, otherval %>
* Add "other" values to value labels that need them.
local otherlabs <%= invtokens(fields.other_lists()) %>
foreach lab of local otherlabs {
mata: st_vlload("`lab'", `values' = ., `text' = "")
<% if (other == "max" | other == "min") { %>
<% expression = other == "max" ? "max(\`values... |
* select or_other variables
forvalues i = 1/`:list sizeof otherlabs' {
local lab : word `i' of `otherlabs'
local otherval : word `i' of `othervals'
ds, has(vallab `lab')
if "`r(varlist)'" != "" ///
recode `r(varlist)' (.o=`otherval')
}
|
<% `SS' repeat
repeat = fields.has_repeat() ? "\`repeat'" : "" %>
local repeats <%= adorn_quotes("\`repeats' " + adorn_quotes(repeat)) %>
<% if (fields.has_repeat()) { %>
tempfile child
local childfiles : list childfiles | child
<% } %>
local badnames
ds, has(char <%= char_name("bad_name") %>)
foreach var in `r(varl... |
args(pointer(`RepeatS') scalar repeat)
<% `SS' mergekey %>
<% // Drop KEY and the SET-OF variable, which will be unused. %>
<% if (repeat->child_set_of()->insheet() == `InsheetOK') { %>
drop KEY <%= repeat->child_set_of()->st_long() %>
<% } %>
<% else { %>
drop KEY
foreach var of varlist _all {
if "`:char `var'[<%... |
args(`SS' repeat)
<% `SS' dta
dta = csv + (repeat != "") * "-" + repeat + (strpos(csv, ".") ? ".dta" : "") %>
local dta `"<%= adorn_quotes(dta) %>"'
save `dta', <%= fields.has_repeat() ? "orphans " : "" %>replace
local dtas : list dtas | dta
<% if (relax) { %>
local allformnotdata `"`allformnotdata' "`formnotdata'""'
... |
* Save label information.
label dir
local labs `r(names)'
foreach lab of local labs {
quietly label list `lab'
* "nassoc" for "number of associations"
local nassoc `nassoc' `r(k)'
}
|
args(`SS' repeat)
local setof
foreach var of varlist _all {
if "`:char `var'[<%= char_name("name") %>]'" == "SET-OF-<%= repeat %>" {
local setof `var'
continue, break
}
}
assert "`setof'" != ""
|
foreach var of varlist _all {
if "`:char `var'[<%= char_name("group") %>]'" != "" & "`:char `var'[<%= char_name("type") %>]'" != "begin repeat" {
local name = "`:char `var'[<%= char_name("name") %>]'" + ///
cond(`:char `var'[<%= char_name("is_other") %>]', "_other", "") + ///
"`:char... |
* Split select_multiple variables.
ds, has(char <%= char_name("type") %>)
foreach typevar in `r(varlist)' {
if strmatch("`:char `typevar'[<%= char_name("type") %>]'", "select_multiple *") & ///
!`:char `typevar'[<%= char_name("is_other") %>]' {
* Add an underscore to the variable name if it ends in a number.
loc... |
*! version 1.0.0 03apr2022 Ben Jann
program colorcheck
version 14.2
syntax [, NOGRaph ///
TItle(passthru) GRopts(passthru) HORizontal VERTical ///
span LABels(passthru) LColor(passthru) LWidth(passthru) ///
BARWidth(passthru) NONUMbers sort SORT2(passthru) * ]
if "`horizontal'"!="... |
*! version 1.2.3 13apr2022 Ben Jann
if c(stata_version)<14.2 {
di as err "{bf:colorpalette} requires version 14.2 of Stata" _c
if c(stata_version)>=9.2 {
di as err "; use command {helpb colorpalette9}" _c
}
di as err ""
error 9
}
capt findfile lcolrspace.mlib
if _rc {
di as error "-c... |
*! version 1.0.3 27dec2018 Ben Jann
program colorpalette9
version 9.2
capt _on_colon_parse `0'
if _rc==0 {
local 0 `"`s(before)'"'
local rhs `"`s(after)'"'
_parse comma lhs 0 : 0
if `"`lhs'"'!="" error 198
if `"`rhs'"'=="" local rhs s2
local palettes
... |
*! version 1.0.1 27dec2018 Ben Jann
program linepalette
version 9.2
capt _on_colon_parse `0'
if _rc==0 {
local 0 `"`s(before)'"'
local rhs `"`s(after)'"'
_parse comma lhs 0 : 0
if `"`lhs'"'!="" error 198
if `"`rhs'"'=="" local rhs default
local palettes
... |
*! version 1.0.2 27dec2018 Ben Jann
program symbolpalette
version 9.2
capt _on_colon_parse `0'
if _rc==0 {
local 0 `"`s(before)'"'
local rhs `"`s(after)'"'
_parse comma lhs 0 : 0
if `"`lhs'"'!="" error 198
if `"`rhs'"'=="" local rhs default
local palettes
... |
*! version 1.0.1 10May2020
*! author: Gabriele Rovigatti, Bank of Italy, Rome, Italy. mailto: gabriele.rovigatti@gmail.com | gabriele.rovigatti@bancaditalia.it
/***************************************************************************
** Stata program for Markup Estimation
** Programmed by: Gabriele Rovigatti
**... |
**! version 1.0.1 10May2020
*! author Gabriele Rovigatti, Bank of Italy, Rome, Italy. mailto: gabriele.rovigatti@gmail.com | gabriele.rovigatti@bancaditalia.it
/***************************************************************************
** Stata program for Markup Estimation - custom PRODEST version
** Programmed by... |
*! version 1.0.1 10May2020
*! author: Gabriele Rovigatti, Bank of Italy, Rome, Italy. mailto: gabriele.rovigatti@gmail.com | gabriele.rovigatti@bancaditalia.it
/***************************************************************************
** Stata program for Markup Estimation - prodest postestimation
** Programmed by:... |
use "${datadir}/f_DGP3_replica.dta", clear
/* run the markup estimation */
forv m = 1/4{
markupest mkupD3_m`m'_t_corr, method(dlw) output(lny) inputvar(lnl) free(lnl) state(lnk) proxy(lnm`m') prodestopt("poly(3) acf trans va") corrected verbose
}
/* Run the graph */
tw (kdensity mkupD3_m1_t_cor if mkupD3_m1_t_cor < 4... |
use "${datadir}/data_hall18", clear
egen nnaics = group(naics)
xtset nnaics year
g naics_2d = substr(naics, 1, 2)
// time-invariant Hall version
bys naics_2d: markupest mkup_h18, inputs( K L M S E ) deltavars( deltaK deltaL deltaM deltaS deltaE) method(hall) /*
*/ go(Y) deltago(deltaY) instruments( deltainstEq de... |
f/* Replica of Figure 1 - Markup estimation using Stata: Micro and Macro approaches with markupest by G Rovigatti */
use "${datadir}/mkup_example", clear
/* xtset the data - firms and years */
xtset f_id year
/* set the seed and run the estimation: value added with ACF translog - print results on-screen and correct for... |
/* Graphs on simulated data */
/* In-body + Appendix graphs */
forv DGP = 1(1)3{
use "${datadir}/f_DGP`DGP'", clear
tw (kdensity mkupD`DGP'_m1_t if mkupD`DGP'_m1_t < 4, lw(medthick) lc(ebblue)) (kdensity mkupD`DGP'_m2_t if mkupD`DGP'_m2_t < 4, lw(medthick) lp(_) lc(maroon)) /*
*/ (kdensity mkupD`DGP'_m3_t if mkupD`... |
// Hall method //
use "${datadir}/data_hall18", clear
egen nnaics = group(naics)
xtset nnaics year
// time-invariant version with graphical representation of correction
bys naics: markupest mkup_h18_ado, inputs( K L M S E ) deltavars( deltaK deltaL deltaM deltaS deltaE) method(hall) /*
*/ go(Y) deltago(deltaY) instr... |
// Hall and Roeger methods //
use "${datadir}/data_hall18", clear
egen nnaics = group(naics)
xtset nnaics year
g naics_2d = substr(naics, 1, 2)
// time-invariant Hall version
bys naics_2d: markupest mkup_h18, inputs( K L M S E ) deltavars( deltaK deltaL deltaM deltaS deltaE) method(hall) /*
*/ go(Y) deltago(delta... |
*! version 1.0.1 15Sep2016
*! version 1.0.2 22Sep2016
*! version 1.0.3 30Sep2016 Fixed a major bug, add first stage residuals options, seeds option, evaluator option and postestimation
*! version 1.0.4 10Feb2017 Fixed a major bugs in winitial() matrix in MrEst, fixed minor bug on Wrdg control and names,
*! add... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.