Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>John Muschelli pointed me to this Stata program:</p> <p><a href="https://github.com/amarder/stata-tutorial/blob/master/knitr.do" rel="nofollow">https://github.com/amarder/stata-tutorial/blob/master/knitr.do</a></p> <p>It parses a <code>.domd</code> file which contains markdown and Stata code and produces a <code>.md</code> file with executed Stata code. The name of the file to be parsed is at the end of the <code>knitr.do</code> file.</p> <p>More specifcally:</p> <ol> <li><p>Download the <code>knitr.do</code> file from <a href="https://github.com/amarder/stata-tutorial/blob/master/knitr.do" rel="nofollow">https://github.com/amarder/stata-tutorial/blob/master/knitr.do</a></p></li> <li><p>Download the <code>clustered-standard-errors.domd</code> file from <a href="https://github.com/amarder/stata-tutorial/blob/master/clustered-standard-errors.domd" rel="nofollow">https://github.com/amarder/stata-tutorial/blob/master/clustered-standard-errors.domd</a></p></li> <li><p>Save them both in some directory.</p></li> <li><p>Modify the last line of <code>knitr.do</code> to reflect the complete path of its directory (e.g. <strong>D:\Desktop\knit_example\clustered-standard-errors.domd</strong> </p></li> <li><p>Run <code>knitr.do</code> to get your markdown (<code>.md</code>) file (and an intermediate <code>.md1</code> file).</p></li> </ol> <p>Note that <code>knitr.do</code> contains the programs that do the work and a line (the last one):</p> <pre><code>knit "whatever-file.domd" </code></pre> <p>that calls the program.</p> <p>So you basically write a <code>.domd</code> file [that of step (2) is only an example] containing Markdown syntax and Stata commands, run <code>knitr.do</code> adjusting the file name, and get a Markdown file with executed Stata commands.</p> <p>There are several caveats:</p> <ul> <li>Only one-liner Stata commands are allowed. A loop, for example, won't work.</li> <li>".domd" can't be part of the file name.</li> <li>If there is an error with a Stata command, the user gets no return code.</li> <li>File handles need to be manually closed if user hits the <em>Break</em> button when the program is running or if there is a Stata command error.</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload