<p><div><div><div><div data-width="100" data-show-faces="false" data-send="true" data-layout="button_count" data-height="21" data-href="https://www.r-bloggers.com/bill-and-ted-make-the-best-out-of-a-shi-stata-situation-rstudio-rstata-stata/"></div></div><div><a data-url="https://www.r-bloggers.com/bill-and-ted-make-the-best-out-of-a-shi-stata-situation-rstudio-rstata-stata/" data-counturl="https://www.r-bloggers.com/bill-and-ted-make-the-best-out-of-a-shi-stata-situation-rstudio-rstata-stata/" data-count="horizontal" data-text="Bill and Ted Make the best out of a Shi… Stata situation: Rstudio + Rstata + Stata" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="https://mikejacktzen.wordpress.com/2016/11/28/bill-and-ted-make-the-best-out-of-a-shi-stata-situation-rstudio-rstata-stata/"> rstats – MikeJackTzen</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p>After rewatching the thanksgiving classic, Bill and Ted’s Excellent Adventure, it reminded me of the history of #Rstats and its current status as the defacto software for <strong>general</strong> data programming.</p>
<p>The most excellent thing about R, is the literate programming options you have. As a data analyst, you are Bill S. Preston Esquire (or Ted “Theodore” Logan, they are <a target="_blank" rel="nofollow" href="https://en.wikipedia.org/wiki/Exchangeable_random_variables">exchangeable</a>). Rstudio is the time traveling phone booth. Since its conception, Rstats had Sweave’s phone number on speed dial. Now, Rstudio has Rmarkdown. Compare this situation with…  Stata. Stata is Ghenkis Khan.</p>
<p>Seeing Mine Çetinkaya-Rundel <a target="_blank" rel="nofollow" href="http://citizen-statistician.org/2016/06/25/project-tier/">post </a>about the joys of Stata,</p>
<pre>During these discussions a package called RStata also came up. This package is [a] simple R -> Stata interface allowing the user to execute Stata commands (both inline and from a .do file) from R.” Looks promising as it should allow running Stata commands from an R Markdown chunk. But it’s really not realistic to think students learning Stata for the first time will learn well (and easily) using this R interface. I can’t imagine teaching Stata and saying to students “first download R”. Not that I teach Stata, but those who do confirmed that it would be an odd experience for students…</pre>
<p>I decided to see for myself how (un)approachable writing narratives for literate programming in Stata really is.</p>
<p><img alt="Related image" src="https://i0.wp.com/aaronswickard.files.wordpress.com/2016/06/img_4295-1.jpg?w=456&ssl=1" data-recalc-dims="1"></p>
<h2></h2>
<h2>If Plato pitched his ideal to So-crates, he would claim:</h2>
<p>Integrating Rstudio + Rmarkdown + R + RStata, should give you the best of 3 worlds</p>
<p>1) Write narratives that are human-readable</p>
<p>2) Manipulate data with human-readable R code</p>
<p>3) Have ‘paid-for-assurance’ of Stata analysis commands</p>
<p>But!  Bill and Ted would probably get bogged down during the setup. The key overhead step is to make sure Bill’s <a target="_blank" rel="nofollow" href="https://github.com/lbraglia/RStata">RStata</a> package <a target="_blank" rel="nofollow" href="https://github.com/lbraglia/RStata/issues/2">plays nicely</a> with his local copy of Stata.</p>
<p>This is like chaparoning Ghenkis Khan in a shopping mall by letting him run loose without an adult-sized child leash.  He might be enjoying a delicious Cinnabon all by his lonesome, or he might be playing home run derby with a mannequin’s head.</p>
<p>It depends on Ghengis’ mood aka the disgruntled software versions in his computing environment.</p>
<div>
<div><iframe height="374" width="880" allowfullscreen src="https://www.dailymotion.com/embed/video/x2p5n3j"></iframe></div>
</div>
<p>The setup overhead is definitely an obstacle against adoption. You need to also version control Rstudio (undergoing rapid development) for its notebook feature and you need to align the Stata version (with their yearly business as usual updates).</p>
<p>I can only see this being useful if Ted is a Stata user with a near ‘final’ Stata .do file that he wants to share in a reproducible manner. During his presentation to his high school history class, Ted would just narrate his analysis center stage via markdown and whenever a result needs to be piped in, he could just chunk-source the .do file in Rstudio (like pulling Ghengis Khan out of the phone booth). Most Excellent.</p>
<p><a target="_blank" rel="nofollow" href="https://i0.wp.com/mikejacktzen.files.wordpress.com/2016/11/download.jpg?ssl=1"><img sizes="(max-width: 573px) 100vw, 573px" alt="download" class="wp-image-578" src="https://i0.wp.com/mikejacktzen.files.wordpress.com/2016/11/download.jpg?resize=456%2C256&ssl=1" data-recalc-dims="1"></a></p>
<p>The gist below is my standalone <a target="_blank" rel="nofollow" href="https://blog.rstudio.org/2016/10/05/r-notebooks/">Rnotebook</a> demo that should work if you have Rstudio 1.0.44 and Stata 14. Your Mileage May Very, with or without a time traveling phone booth.</p>
<p><a target="_blank" rel="nofollow" href="https://gist.github.com/statsccpr/5f4bb658c15ff2a31b3ba0c0afae228d#file-rstata_boomerang_rnotebook-rmd">https://gist.github.com/statsccpr/5f4bb658c15ff2a31b3ba0c0afae228d#file-rstata_boomerang_rnotebook-rmd</a></p>
<p><a target="_blank" rel="nofollow" href="https://i0.wp.com/mikejacktzen.files.wordpress.com/2016/11/capture.png?ssl=1"><img sizes="(max-width: 880px) 100vw, 880px" alt="capture" class="wp-image-571" src="https://i0.wp.com/mikejacktzen.files.wordpress.com/2016/11/capture.png?resize=456%2C213&ssl=1" data-recalc-dims="1"></a></p>
<p> </p>
<p> <a target="_blank" rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mikejacktzen.wordpress.com/542/"><img alt="" src="http://feeds.wordpress.com/1.0/comments/mikejacktzen.wordpress.com/542/" border="0"></a> <img alt="" src="https://i1.wp.com/pixel.wp.com/b.gif?resize=1%2C1&ssl=1" border="0" data-recalc-dims="1"></p>
<p><div><div><div><div data-width="55" data-show-faces="false" data-send="true" data-layout="box_count" data-height="62" data-href="https://www.r-bloggers.com/bill-and-ted-make-the-best-out-of-a-shi-stata-situation-rstudio-rstata-stata/"></div></div><div><a data-url="https://www.r-bloggers.com/bill-and-ted-make-the-best-out-of-a-shi-stata-situation-rstudio-rstata-stata/" data-counturl="https://www.r-bloggers.com/bill-and-ted-make-the-best-out-of-a-shi-stata-situation-rstudio-rstata-stata/" data-count="vertical" data-text="Bill and Ted Make the best out of a Shi… Stata situation: Rstudio + Rstata + Stata" class="twitter-share-button" data-via="rbloggers" href="https://twitter.com/share"></a></div><div></div></div><div></div></div>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="https://mikejacktzen.wordpress.com/2016/11/28/bill-and-ted-make-the-best-out-of-a-shi-stata-situation-rstudio-rstata-stata/"> rstats – MikeJackTzen</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a title="The R Project for Statistical Computing" rel="nofollow" href="https://www.r-project.org/">R</a> news and <a title="R tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=tutorial">tutorials</a> on topics such as: <a title="Data science" rel="nofollow" href="https://www.r-bloggers.com/?s=data%20science">Data science</a>, <a title="Big Data" rel="nofollow" href="https://www.r-bloggers.com/?s=Big%20Data">Big Data, <a title="R jobs" rel="nofollow" href="https://www.r-users.com/">R jobs</a>, visualization (<a title="ggplot and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=ggplot2">ggplot2</a>, <a title="Boxplots using lattice and ggplot2 tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=boxplot">Boxplots</a>, <a title="Maps and gis" rel="nofollow" href="https://www.r-bloggers.com/?s=map">maps</a>, <a title="Animation in R" rel="nofollow" href="https://www.r-bloggers.com/?s=animation">animation</a>), programming (<a title="RStudio IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=RStudio">RStudio</a>, <a title="Sweave and literate programming" rel="nofollow" href="https://www.r-bloggers.com/?s=sweave">Sweave</a>, <a title="LaTeX in R" rel="nofollow" href="https://www.r-bloggers.com/?s=LaTeX">LaTeX</a>, <a title="SQL and databases" rel="nofollow" href="https://www.r-bloggers.com/?s=SQL">SQL</a>, <a title="Eclipse IDE for R" rel="nofollow" href="https://www.r-bloggers.com/?s=eclipse">Eclipse</a>, <a title="git and github, Version Control System" rel="nofollow" href="https://www.r-bloggers.com/?s=git">git</a>, <a title="Large data in R using Hadoop" rel="nofollow" href="https://www.r-bloggers.com/?s=hadoop">hadoop</a>, <a title="Web Scraping of google, facebook, yahoo, twitter and more using R" rel="nofollow" href="https://www.r-bloggers.com/?s=Web+Scraping">Web Scraping</a>) statistics (<a title="Regressions and ANOVA analysis tutorials" rel="nofollow" href="https://www.r-bloggers.com/?s=regression">regression</a>, <a title="principal component analysis tutorial" rel="nofollow" href="https://www.r-bloggers.com/?s=PCA">PCA</a>, <a title="Time series" rel="nofollow" href="https://www.r-bloggers.com/?s=time+series">time series</a>, <a title="finance trading" rel="nofollow" href="https://www.r-bloggers.com/?s=trading">trading</a>) and more...
<img height="1" alt="" width="1" src="http://feeds.feedburner.com/~r/RBloggers/~4/fWCvubVHH-4"></a></div>