<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>R on Big Muddy</title><link>https://muddy.jprs.me/tags/r/</link><description>Recent content in R on Big Muddy</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Mon, 16 Mar 2026 20:48:00 -0400</lastBuildDate><atom:link href="https://muddy.jprs.me/tags/r/index.xml" rel="self" type="application/rss+xml"/><item><title>Some insight into writing a book using Quarto</title><link>https://muddy.jprs.me/links/2026-03-16-some-insight-into-writing-a-book-using-quarto/</link><pubDate>Mon, 16 Mar 2026 20:48:00 -0400</pubDate><guid>https://muddy.jprs.me/links/2026-03-16-some-insight-into-writing-a-book-using-quarto/</guid><description>&lt;p&gt;Prof. Kieran Healy (Sociology, Yale University) shares some nice insight into the process of writing a book in Quarto using R in this post. The output screenshots he shares look beautiful, and the idea of deploying the same content as a clean PDF &lt;em&gt;and&lt;/em&gt; a responsive website is awesome. A full draft of the book, &lt;em&gt;Data Visualization: A Practical Introduction (Second Edition)&lt;/em&gt;, is available as a website &lt;a href="https://socviz.co/"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I have grown increasingly tired of writing in any format other than a plain text file I can easily version control and move around, so the idea of writing a book in Quarto is appealing to me (as long as it has enough technical content to justify the format).&lt;/p&gt;</description></item><item><title>Using Claude Claude for cross-package statistical audits</title><link>https://muddy.jprs.me/links/2026-03-15-using-claude-claude-for-cross-package-statistical-audits/</link><pubDate>Sun, 15 Mar 2026 22:49:00 -0400</pubDate><guid>https://muddy.jprs.me/links/2026-03-15-using-claude-claude-for-cross-package-statistical-audits/</guid><description>&lt;p&gt;Economist Scott Cunningham shared an important example of why we should always report the statistical package and version used in our analyses, as he used Claude Code to produce six versions of the exact same analysis using six different packages in R, Python, and Stata. In a &lt;a href="https://en.wikipedia.org/wiki/Difference_in_differences"&gt;difference-in-differences&lt;/a&gt; analysis of the mental health hospital closures on homicide using the standard &lt;a href="https://bcallaway11.github.io/did/articles/multi-period-did.html"&gt;Callaway and Sant’Anna estimator&lt;/a&gt; (for DiD with multiple time periods), he got very different results for some model specifications.&lt;/p&gt;
&lt;p&gt;Since the specifications and the data were identical between packages, he discovered the divergences occurred due to how the packages handled problems with &lt;a href="https://www.tandfonline.com/doi/full/10.1080/00273171.2011.568786#d1e368"&gt;propensity score&lt;/a&gt; weights. Packages were not necessarily transparent about issues with these weights. If you were not running multiple analyses and comparing results across packages, or else carefully checking propensity score diagnostics, you might never have realized how precarious your results were.&lt;/p&gt;
&lt;p&gt;Prof. Cunningham closes with the following advice:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The fifth point, and the broader point, is that this kind of cross-package, cross-language audit is exactly what Claude Code should be used for. Why? Because this is a task that is time-intensive, high-value, and brutally easy to get wrong. But just one mismatched diagnostic across languages invalidates the entire comparison, even something as simple as sample size values differing across specifications, would flag it. This is both easy and not easy — but it is not the work humans should be doing by hand given how easy it would be to even get that much wrong.&lt;/p&gt;</description></item><item><title>geoBoundaries: An open database of political administrative boundaries</title><link>https://muddy.jprs.me/links/2026-03-13-geoboundaries-an-open-database-of-political-administrative-boundaries/</link><pubDate>Fri, 13 Mar 2026 17:05:00 -0400</pubDate><guid>https://muddy.jprs.me/links/2026-03-13-geoboundaries-an-open-database-of-political-administrative-boundaries/</guid><description>&lt;p&gt;Today I discovered geoBoundaries, a &lt;a href="https://creativecommons.org/licenses/by/4.0/"&gt;CC BY 4.0&lt;/a&gt;-licensed database of political administrative boundaries covering the entire world. It is notable for its high level of detail, going from ADM0 (country), ADM1 (states/provinces), ADM2 (counties/departments or municipalities), to ADM3 (municipalities or sub-municipalities) for many countries. My go-to source for world map files is &lt;a href="https://www.naturalearthdata.com/"&gt;Natural Earth&lt;/a&gt;, which is limited to ADM0 and ADM1 but is in the public domain. Natural Earth also includes some physical geography like water and bathymetry, while geoBoundaries is focused solely on political administrative boundaries. Both datasets deal with disputed boundaries, which is an endless source of tension in the &lt;a href="https://github.com/nvkelso/natural-earth-vector/issues"&gt;Natural Earth GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;An R package for retrieving data from geoBoundaries, &lt;a href="https://dieghernan.github.io/202602_geobounds/"&gt;&lt;code&gt;geobounds&lt;/code&gt;&lt;/a&gt;, was released in February. A similar package for Natural Earth, &lt;a href="https://github.com/ropensci/rnaturalearth"&gt;&lt;code&gt;rnaturalearth&lt;/code&gt;&lt;/a&gt;, has long been maintained by rOpenSci.&lt;/p&gt;</description></item><item><title>An end-to-end AI pipeline for policy evaluation papers</title><link>https://muddy.jprs.me/links/2026-02-12-an-end-to-end-ai-pipeline-for-policy-evaluation-papers/</link><pubDate>Thu, 12 Feb 2026 19:11:00 -0500</pubDate><guid>https://muddy.jprs.me/links/2026-02-12-an-end-to-end-ai-pipeline-for-policy-evaluation-papers/</guid><description>&lt;p&gt;Prof. David Yanagizawa-Drott from the Social Catalyst Lab at the University of Zurich has launched Project APE (Autonomous Policy Evaluation), an end-to-end AI pipeline to generate policy evaluation papers. The vast majority of policies around the world are never rigorously evaluated, so it would certainly be useful if we were able to do so in an automated fashion.&lt;/p&gt;
&lt;p&gt;Claude Code is the heart of the project, but other models are used to review the outputs and provide journal-style referee reports. All the coding is done in R (though Python is called in some scripts). Currently, judging is done by Gemini 3 Flash to compare against published research in top economics journals:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Blind comparison: An LLM judge compares two papers without knowing which is AI-generated
Position swapping: Each pair is judged twice with paper order swapped to control for bias
TrueSkill ratings: Papers accumulate skill ratings that update after each match&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;The project&amp;rsquo;s home page lists the AI&amp;rsquo;s current &amp;ldquo;win rate&amp;rdquo; at 3.5% in head-to-head matchups against human-written papers.&lt;/p&gt;
&lt;p&gt;Prof. Yanagizawa-Drott says &amp;ldquo;Currently it requires at a minimum some initial human input for each paper,&amp;rdquo; although he does not specify exactly what. If we look at &lt;a href="https://github.com/SocialCatalystLab/ape-papers/blob/main/apep_0264/v1/initialization.md"&gt;&lt;code&gt;initialization.json&lt;/code&gt;&lt;/a&gt; that can be found in each paper&amp;rsquo;s directory, we see the following questions with user-provided inputs:&lt;/p&gt;
&lt;blockquote&gt;
&lt;ol&gt;
&lt;li&gt;Policy domain: What policy area interests you?&lt;/li&gt;
&lt;li&gt;Method: Which identification method?&lt;/li&gt;
&lt;li&gt;Data era: Modern or historical data?&lt;/li&gt;
&lt;li&gt;API keys: Did you configure data API keys?&lt;/li&gt;
&lt;li&gt;External review: Include external model reviews?&lt;/li&gt;
&lt;li&gt;Risk appetite: Exploration vs exploitation?&lt;/li&gt;
&lt;li&gt;Other preferences: Any other preferences or constraints?&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;p&gt;The code, reviews, manuscript, and even the results of the initial idea generation process are all available on &lt;a href="https://github.com/SocialCatalystLab/ape-papers"&gt;GitHub&lt;/a&gt;. Their immediate goal is to generate a sample of 1,000 papers and run human evaluations on them (at time of posting, there are 264 papers in the GitHub repository).&lt;/p&gt;</description></item></channel></rss>