<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>Stéphane Tuffier</title>
<link>https://www.tuffier.eu/posts.html</link>
<atom:link href="https://www.tuffier.eu/posts.xml" rel="self" type="application/rss+xml"/>
<description>M.D., PhD Fellow In Environmental epidemiology</description>
<generator>quarto-1.9.38</generator>
<lastBuildDate>Sun, 21 Jun 2026 22:00:00 GMT</lastBuildDate>
<item>
  <title>Can green cycling paths reduce commuter exposure to ultrafine particles?</title>
  <dc:creator>Stéphane Tuffier</dc:creator>
  <link>https://www.tuffier.eu/posts/2026/06-cph-green-cycling-path-ufp/</link>
  <description><![CDATA[ 





<p><a href="https://creativecommons.org/licenses/by/4.0/"><img src="https://img.shields.io/badge/Open_access-CC_BY_4.0-1D9E75?style=flat-square" class="img-fluid" alt="Open access"></a> <a href="https://codeberg.org/KU-EEG/cph-green-cycling-path-ufp.git"><img src="https://img.shields.io/badge/Code-Codeberg-2185D0?style=flat-square&amp;logo=codeberg.png" class="img-fluid" alt="Code"></a> <a href="https://www.erda.dk/archives/2c6c303901fb18a7c7ee62e74b7fd3e2/published-archive.html"><img src="https://img.shields.io/badge/Data-ERDA-1D9E75?style=flat-square.png" class="img-fluid" alt="Data"></a> <a href="https://doi.org/10.1016/j.scs.2026.107649"><img src="https://img.shields.io/badge/DOI-10.1016%2Fj.scs.2026.107649-7F77DD?style=flat-square" class="img-fluid" alt="DOI"></a></p>
<p><em>“Can green cycling paths reduce commuter exposure to ultrafine particles?”</em>. The short answer is <strong>yes</strong>.</p>
<section id="the-question" class="level2">
<h2 class="anchored" data-anchor-id="the-question">The question</h2>
<p>In cities, road traffic is the main source of ultrafine particles (UFP, particles smaller than 0.1 µm), that penetrate deep into the lungs and the circulatory system. Cycling is good for health and climate change, but it also increase our breathing rate right next to traffic emissions. Most cyclists underestimate how much pollution they breathe along the way.</p>
<p>So we asked a simple question: How much cycling on a the Nørrebro green cygling path, a path physically separated from traffic and running through green spaces, can actually lower UFP?</p>
</section>
<section id="how-we-did-it" class="level2">
<h2 class="anchored" data-anchor-id="how-we-did-it">How we did it</h2>
<p>Over six weeks in February and March 2024, we performed <strong>40 cycling trips</strong> on a fixed <strong>8.3 km route</strong> through central Copenhagen, during both rush hour (07:45) and non-rush hour (09:45). A portable DiSCmini measured particle number concentration (PNC) every second, paired with GPS, and we split the route into five segments by traffic volume and built environment: green path, low, moderate A, moderate B, and high traffic.</p>
<p>The statistics used generalized additive mixed models (negative binomial, random intercept per trip, AR(1) autocorrelation between consecutive disks, and cubic splines for meteorology).</p>
</section>
<section id="what-we-found" class="level2">
<h2 class="anchored" data-anchor-id="what-we-found">What we found</h2>
<div class="grid">
<section id="section" class="level3 g-col-12 g-col-md-4">
<h3 class="anchored" data-anchor-id="section">−50%</h3>
<p>Lower PNC on the green path versus high-traffic streets</p>
</section>
<section id="section-1" class="level3 g-col-12 g-col-md-4">
<h3 class="anchored" data-anchor-id="section-1">−32%</h3>
<p>Lower PNC on the green path versus moderate-traffic streets</p>
</section>
<section id="ptcm³" class="level3 g-col-12 g-col-md-4">
<h3 class="anchored" data-anchor-id="ptcm³">5,849 pt/cm³</h3>
<p>Mean PNC on the green path — the lowest of every segment</p>
</section>
</div>
<ul>
<li>After adjusting for confounders, cycling on the green path reduced UFP exposure by <strong>32% to 50%</strong> compared with higher-traffic segments.</li>
<li>Exposure was <strong>similar between rush and non-rush hours</strong>. The immediate built environment mattered more than the timing of the trip.</li>
</ul>
<p>Where you ride matters more than when you ride.</p>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.tuffier.eu/posts/2026/06-cph-green-cycling-path-ufp/cycling-route.png" class="img-fluid figure-img"></p>
<figcaption>UFP levels along the cycling route</figcaption>
</figure>
</div>
</section>
<section id="what-this-means-for-commuters" class="level2">
<h2 class="anchored" data-anchor-id="what-this-means-for-commuters">What this means for commuters</h2>
<p>If you cycle to work, choosing a greener route with a designated cycling path, surrounded by green areas, and away from heavy motorized traffic, can lower your exposure to unhealthy environments. This take little extra travel time. Greener routes are usually also the safer and more pleasant ones.</p>
<p>This study didn’t investigates health effect, and long-term consequence of commuting exposure on health are still unclear.</p>
</section>
<section id="what-this-means-for-cities" class="level2">
<h2 class="anchored" data-anchor-id="what-this-means-for-cities">What this means for cities</h2>
<p>Green cycling infrastructure isn’t only good for mobility, it’s a public health intervention. By combining separation from traffic, and green space, green cycling paths protect active commuters every day. Our findings suggest that focusing on traffic reduction alone has limited benefit if cycling infrastructures stays close to traffic and UFP sources. Where cycling networks are still developing, the priority should be building <strong>new, green, separates and well-connected paths</strong>.</p>
</section>
<section id="data-and-code" class="level2">
<h2 class="anchored" data-anchor-id="data-and-code">Data and code</h2>
<p>This study is fully open, including code and data.</p>
<div class="callout callout-style-default callout-note no-icon callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon no-icon"></i>
</div>
<div class="callout-title-container flex-fill">
<span class="screen-reader-only">Note</span><i class="bi bi-unlock"></i> Open science
</div>
</div>
<div class="callout-body-container callout-body">
<ul>
<li><strong>Code</strong>: the full analysis in R is on <a href="https://codeberg.org/KU-EEG/cph-green-cycling-path-ufp.git">Codeberg</a>. There is some interesting functions that we used to correct GPS recording errors.</li>
<li><strong>Data</strong>: raw UFP measurements and GPS trajectories are on the University of Copenhagen’s <a href="https://www.erda.dk/archives/2c6c303901fb18a7c7ee62e74b7fd3e2/published-archive.html">ERDA repository</a></li>
</ul>
</div>
</div>
</section>
<section id="citation" class="level2">
<h2 class="anchored" data-anchor-id="citation">Citation</h2>
<blockquote class="blockquote">
<p>Hevia-Ramos GB, Napolitano G, Bergmann ML, Zhang J, Loft S, Andersen ZJ, Lim Y-H, Cole-Hunter T, Tuffier S. Can green cycling paths reduce commuter exposure to ultrafine particles? A repeated measures study in Copenhagen, Denmark. <em>Sustainable Cities and Society</em>. 2026;148:107649. doi:<a href="https://doi.org/10.1016/j.scs.2026.107649">10.1016/j.scs.2026.107649</a></p>
</blockquote>


</section>

 ]]></description>
  <category>publication</category>
  <category>air pollution</category>
  <category>cycling</category>
  <category>open science</category>
  <category>epidemiology</category>
  <guid>https://www.tuffier.eu/posts/2026/06-cph-green-cycling-path-ufp/</guid>
  <pubDate>Sun, 21 Jun 2026 22:00:00 GMT</pubDate>
  <media:content url="https://www.tuffier.eu/posts/2026/06-cph-green-cycling-path-ufp/cycling-route.png" medium="image" type="image/png" height="144" width="144"/>
</item>
<item>
  <title>EEPE Course</title>
  <dc:creator>Stéphane Tuffier</dc:creator>
  <link>https://www.tuffier.eu/posts/2025/07-epee-course-florence/</link>
  <description><![CDATA[ 





<p>This July, I had the privilege of attending the 37th European Educational Programme in Epidemiology (EEPE course). The course is located near Florence, on Fiesole hills. I attended the last two of the four week of the course. More than 150 students coming from all over Europe and beyond attended the lectures on various topics ranging from data science in epidemiology to humanitarian epidemiology.</p>
<p>It’s quite far from Denmark, but I was committed to traveling there by train. This was a pleasant two day journey with a spectacular crossing of the Alps through the Brenner Pass.</p>
<p>Beside connecting and networking with many fellow PhD students, Postdocs and researchers, I also learn many interesting things. Here are some hightlights of these learnings:</p>
<ul>
<li><p>The importance of triangulation in epidemiology: diverse designs and methods can help the scientific community address causal questions and investigate the relevance of exposure effects on our health. Among the many methods that we went through during the course we havev learned that sibling studies help reduce the impact of family confounders such as parental education and income. Mendelian randomization sutdies uses genetics as instrumental variables to estimate the causality of a specific exposures on health outcomes. Finally, negative controls can be very powerful in disentangling confounding by estimating association between unrelated events to an exposure to reveal confounding issues.</p></li>
<li><p>Rediscovering missing data and the differences between various types of missing data (MCAR, MAR, and MNAR). Although these concepts may seem straightforward, they are complex and a bit difficult to fully grasp. Using some very simple example, I relearned the differences and specificity of each of this type of missing data.</p></li>
<li><p>In the GIS cours, I learn how to handle geographic data to measure exposure and relate them to health outcomes. This is essential in environmental epidemiology. This led me to create this map, depicting the countries of residence and research of the students. The bright colors indicate a higher number of students per country.</p></li>
</ul>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.tuffier.eu/posts/2025/07-epee-course-florence/map.png" class="img-fluid figure-img"></p>
<figcaption>Where are the EEPE students comming from? The bright colors indicate a higher number of students per country</figcaption>
</figure>
</div>
<p>For those who want to read more, here are some papers of interest:</p>
<div id="refs" class="references csl-bib-body hanging-indent">
<div id="ref-lawlor_triangulation_2016" class="csl-entry">
Lawlor, Debbie A, Kate Tilling, and George Davey Smith. 2016. <span>“Triangulation in Aetiological Epidemiology.”</span> <em>International Journal of Epidemiology</em> 45 (6): 1866–86. <a href="https://doi.org/10.1093/ije/dyw314">https://doi.org/10.1093/ije/dyw314</a>.
</div>
<div id="ref-pedersen_missing_2017" class="csl-entry">
Pedersen, Alma B., Ellen M. Mikkelsen, Deirdre Cronin-Fenton, et al. 2017. <span>“Missing Data and Multiple Imputation in Clinical Epidemiological Research.”</span> <em>Clinical Epidemiology</em> 9 (March): 157–66. <a href="https://doi.org/10.2147/CLEP.S129785">https://doi.org/10.2147/CLEP.S129785</a>.
</div>
</div>



 ]]></description>
  <category>PhD</category>
  <category>course</category>
  <category>epidemiology</category>
  <guid>https://www.tuffier.eu/posts/2025/07-epee-course-florence/</guid>
  <pubDate>Mon, 21 Jul 2025 22:00:00 GMT</pubDate>
  <media:content url="https://www.tuffier.eu/posts/2025/07-epee-course-florence/map.png" medium="image" type="image/png" height="75" width="144"/>
</item>
<item>
  <title>Liberty and independence as a researcher</title>
  <dc:creator>Stéphane Tuffier</dc:creator>
  <link>https://www.tuffier.eu/posts/2025/06-28-gafa-alternative-europe/</link>
  <description><![CDATA[ 





<p>The Internet and digital tools are evolving rapidly and can affect our work as researchers. More than ever, we need to reflect on the tools we use to avoid being locked in by large corporations and to maintain our independence.</p>
<p>Here are some trends we should be worried about:</p>
<ul>
<li>AI is being promoted and pushed by almost every company, on every website and app, and in every domain, despite the hallucinations and lack of trustworthiness of the results they can provide.</li>
<li>The premature ending of Windows 10 and the forced update to Windows 11, which is bloated with spyware and starts collecting your data as soon as you install it or open a Word document.</li>
<li>More and more IT products include mandatory telemetry tools that collect and sell users’ data.</li>
</ul>
<section id="concentration-of-power-in-the-hand-of-the-few" class="level2">
<h2 class="anchored" data-anchor-id="concentration-of-power-in-the-hand-of-the-few">Concentration of power in the hand of the few</h2>
<p>A very small number of company control the majority of software that we use everyday. We have collectively allowed them to have such a dominant position, often for no real reason.</p>
<p>The GAFAM (Microsoft, Google, Meta, and others) have changed their policies to massively collect and use any data to train their AI. Their power comes from controlling this data, all gathered in one place, which they can use as they wish. Once our data is in their data centers, we basically have no rights over it anymore. Despite the GDPR and recent court cases, many audits have shown that there is no guarantee that data produced in the EU will not be transferred outside, even when there are written agreements.</p>
<p>Recent attacks by Trump on U.S. institutions, such as the NIH, CDC, EPA, and other research institutions, are threatening datasets of public interest, like remote sensing data from NASA, public NHS studies data, or the PubMed database.</p>
</section>
<section id="alternatives-clouds-service-and-social-networks" class="level2">
<h2 class="anchored" data-anchor-id="alternatives-clouds-service-and-social-networks">Alternatives clouds service and social networks</h2>
<p>Alternatives to the GAFAM services are plenty. The European Union makes it easy and has listed many of them, categorized by type. They are all hosted in the EU and their compliance with GDPR is clearly stated. The list is accessible on <a href="https://european-alternatives.eu//">european-alternatives.eu</a>.</p>
<p>Among the listed alternatives here are some that I use frequently:</p>
<ul>
<li><p>Nextcloud, a very robust alternative to all the drive services. Very simple and nice to use. It can be self-hosted on any server as the code of the application is open-source. I used for many years a instance hosted in France and managed by Zaclys, a non profit association, for 12 euros per year (a small price for a privacy friendly storage).</p></li>
<li><p>For web search, it’s possible to avoid google with alternative like DuckDuckGo or Qwant. There are even fully configurable search engine like Kagi, which offer a wide options to tailor you search results to your expectations.</p></li>
<li><p>For news, Google news feed mostly promotes content and keeps you in the bubble identified by its algorithm. However, it’s easy to take back control with RSS service, where you can manually subscribe to news and website of interests.</p></li>
<li><p>For social networks, with the takeover of Twitter by Elon Musk, people have realized the dangers of centralized platforms. Any network relying on centralized data centers, like Bluesky, will always be at risk of manipulation simply because users do not control the algorithms used to create post feeds. On the other hand, Mastodon and all Fediverse platforms require more investment to get started, which can be discouraging. However, users have full control over their feeds.</p></li>
</ul>
</section>
<section id="alternative-desktop-applications" class="level2">
<h2 class="anchored" data-anchor-id="alternative-desktop-applications">Alternative desktop applications</h2>
<p>On your desktop, there is also many alternative to the GAFAM software.</p>
<ul>
<li><p>Libre Office is a very viable alternative to Microsoft Office. For graphics, Gimp and Inkscape can easily replace Adobe Photoshop or Illustrator. I recommend testing them for a few days and you will probably adopt them.</p></li>
<li><p>For web browser, their is no real alternative to Google Chrome, which is embed in almost all browsers, including Safari or Edge. Firefox, and Mozilla, is the only one to maintain their own web rendering engine. Historically they have been very strict in protection user privacy. However recent strategic and developments choices have undermined the foundation aims to fully respect user privacy.</p></li>
<li><p>For data analysis, R and python are much more power-full and versatile than older software like SAS or Stata.</p></li>
</ul>
</section>
<section id="shifting-to-linux" class="level2">
<h2 class="anchored" data-anchor-id="shifting-to-linux">Shifting to Linux</h2>
<p>The ultimate step one can take is to switch from Windows or macOS to Linux. Linux offers a high degree of customization and robust security features. Considering the large number of distributions, or different flavors of Linux, such as Ubuntu, Fedora, or Pop!_OS, anyone can have a system that suits their needs.</p>
<p>Ultimately, every individual and institution should self-host as many open-source cloud services as possible. In the end, we always need to balance privacy, price, and ease of use.</p>
<p>After using Fedora for many years on my personal computers, I found myself very annoyed by the forced migration to Windows 11 on my professional laptop. The computer feels very slow, with issues like constant high RAM usage, slow program startup, and endless bugs in Teams, Word, and Excel.</p>
<p>After some negotiation with the IT department, I decided to install Linux on it. I will post details of all the steps in a series of posts.</p>


</section>

 ]]></description>
  <category>research</category>
  <category>tools</category>
  <category>open science</category>
  <category>digital</category>
  <guid>https://www.tuffier.eu/posts/2025/06-28-gafa-alternative-europe/</guid>
  <pubDate>Fri, 27 Jun 2025 22:00:00 GMT</pubDate>
  <media:content url="https://www.tuffier.eu/posts/2025/06-28-gafa-alternative-europe/video_surveillance.jpg" medium="image" type="image/jpeg"/>
</item>
<item>
  <title>ISEE Young 2024 Workshop</title>
  <dc:creator>Stéphane Tuffier</dc:creator>
  <link>https://www.tuffier.eu/posts/2024/isee-workshop/</link>
  <description><![CDATA[ 





<p>In early June, I had the opportunity to present an R workshop on Reproducible Research in Epidemiology at the ISEE Young 2024 in Rennes. The workshop was intended for young epidemiologists, mostly PhD students, to help them kickstart their research projects with essential skills to enhance their R code.</p>
<p>The workshop lasted for 2 hours and 30 minutes, and together with the 30 participants, we went through some theory on reproducible analysis workflows, practical solutions to improve the organization of epidemiological projects, and a quick introduction to Git. With two hands-on exercises, it was really a packed workshop.</p>
<p>To my great pleasure, most of the participants managed to go through most of the material, and many of them seemed quite satisfied. The material of the workshop is now available online and on GitHub:</p>
<div class="callout callout-style-default callout-note callout-titled">
<div class="callout-header d-flex align-content-center">
<div class="callout-icon-container">
<i class="callout-icon"></i>
</div>
<div class="callout-title-container flex-fill">
Note
</div>
</div>
<div class="callout-body-container callout-body">
<p><a href="https://ste-tuf.github.io/isee-young-ws-reproducibility/" class="uri">https://ste-tuf.github.io/isee-young-ws-reproducibility/</a></p>
</div>
</div>
<div class="quarto-figure quarto-figure-center">
<figure class="figure">
<p><img src="https://www.tuffier.eu/posts/2024/isee-workshop/img.png" class="img-fluid figure-img"></p>
<figcaption>Workshop flyer</figcaption>
</figure>
</div>



 ]]></description>
  <category>epidemiology</category>
  <category>research</category>
  <category>tools</category>
  <category>conference</category>
  <guid>https://www.tuffier.eu/posts/2024/isee-workshop/</guid>
  <pubDate>Tue, 11 Jun 2024 22:00:00 GMT</pubDate>
  <media:content url="https://www.tuffier.eu/posts/2024/isee-workshop/img.png" medium="image" type="image/png" height="81" width="144"/>
</item>
<item>
  <title>Tidy Tuesday 2023-12-05</title>
  <dc:creator>Stéphane Tuffier</dc:creator>
  <link>https://www.tuffier.eu/posts/2023/2023-12-07_tidy-tuesday.html</link>
  <description><![CDATA[ 





<p>This Tidy Tuesday was about life expectancy from Our World in Data and I decided to participate for the first time. The data and instructions can be found here: <a href="https://github.com/rfordatascience/tidytuesday/blob/master/data/2023/2023-12-05/readme.md">TidyTuesday 2023-12-05</a>.</p>
<p>After looking at the summary, I quickly decided upon looking at the differences in life expectancy between women and men and whether they changed over time. Time was restricted to 1950 to 2020 to only look at current erra and benefit from classification of countries based on income.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb1-1">df <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> tuesdata<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>life_expectancy_female_male <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb1-2">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Entity <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%in%</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"High-income countries"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Upper-middle-income countries"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lower-middle-income countries"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Least developed countries"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Low-income countries"</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb1-3">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mutate</span>(</span>
<span id="cb1-4">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">le_fm =</span> LifeExpectancyDiffFM,</span>
<span id="cb1-5">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">Entity =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">factor</span>(Entity, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">levels =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"High-income countries"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Upper-middle-income countries"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lower-middle-income countries"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Least developed countries"</span>, <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Low-income countries"</span>))</span>
<span id="cb1-6">  )</span>
<span id="cb1-7"></span>
<span id="cb1-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># General life expectancy</span></span>
<span id="cb1-9">p1 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(tuesdata<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>life_expectancy, Year <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1950</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb1-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> Year, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> LifeExpectancy)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-11">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> Entity), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey80"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-12">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_smooth</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">se =</span> F, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#527853"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_minimal</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ylab</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Life expectancy"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-15">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">xlab</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>)</span>
<span id="cb1-16"></span>
<span id="cb1-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Life expectancy difference between Female and Male</span></span>
<span id="cb1-18">p2 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(tuesdata<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>life_expectancy_female_male, Year <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1950</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb1-19">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> Year, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> LifeExpectancyDiffFM)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-20">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> Entity), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey80"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-21">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_smooth</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">se =</span> F, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#527853"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ylab</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Females vs Males"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-23">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">xlab</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-24">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">labs</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">title =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Life expectancy difference"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-25">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_y_continuous</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">limits =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">c</span>(<span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span>, <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">10</span>)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_minimal</span>()</span>
<span id="cb1-27"></span>
<span id="cb1-28"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># By country type</span></span>
<span id="cb1-29"></span>
<span id="cb1-30">p3 <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(df, Year <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1950</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb1-31">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ggplot</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">x =</span> Year, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">y =</span> le_fm, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> Entity)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-32">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_line</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">aes</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">group =</span> Entity), <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">col =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grey80"</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">alpha =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7</span>, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-33">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">geom_smooth</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">se =</span> F, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">linewidth =</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-34">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">facet_grid</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">cols =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">vars</span>(Entity)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-35">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme_classic</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-36">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">theme</span>(</span>
<span id="cb1-37">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">strip.background =</span> <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">element_blank</span>(),</span>
<span id="cb1-38">    <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">legend.position =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"none"</span></span>
<span id="cb1-39">  ) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-40">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">ylab</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Females vs Males"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span></span>
<span id="cb1-41">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">scale_colour_brewer</span>(<span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">palette =</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Oranges"</span>)</span>
<span id="cb1-42"></span>
<span id="cb1-43"></span>
<span id="cb1-44">p1 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> p2 <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">/</span> p3</span></code></pre></div></div>
</details>
<div class="cell-output-display">
<div>
<figure class="figure">
<p><img src="https://www.tuffier.eu/posts/2023/2023-12-07_tidy-tuesday_files/figure-html/graph-1.png" class="img-fluid figure-img" width="960"></p>
</figure>
</div>
</div>
</div>
<p>At the same time that life expectancy is increasing, the gap between women and men is also becoming larger. This is especially true for middle and low income countries. In high income countries, the gap is now reducing. Still, women life expectancy is 4 years higher compared to men.</p>
<div class="cell">
<details class="code-fold">
<summary>Code</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb2" style="background: #f1f3f5;"><pre class="sourceCode r code-with-copy"><code class="sourceCode r"><span id="cb2-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;"># Some code used to explore the data.</span></span>
<span id="cb2-2"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map</span>(tuesdata, summary)</span>
<span id="cb2-3"></span>
<span id="cb2-4"><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">map</span>(tuesdata, naniar<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span>vis_miss)</span>
<span id="cb2-5"></span>
<span id="cb2-6">tuesdata<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>life_expectancy_female_male <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb2-7">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">group_by</span>(Entity) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb2-8">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Year <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1950</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb2-9">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">summarise</span>(<span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">mean_se</span>(LifeExpectancyDiffFM)) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb2-10">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(ymin)</span>
<span id="cb2-11"></span>
<span id="cb2-12">tuesdata<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>life_expectancy_female_male <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb2-13">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Entity <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"United Kingdom"</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb2-14">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">View</span>()</span>
<span id="cb2-15"></span>
<span id="cb2-16">tuesdata<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>life_expectancy_female_male<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>Entity <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb2-17">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">unique</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb2-18">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">str_subset</span>(<span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"countr"</span>)</span>
<span id="cb2-19"></span>
<span id="cb2-20">model <span class="ot" style="color: #003B4F;
background-color: null;
font-style: inherit;">&lt;-</span> tuesdata<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">$</span>life_expectancy_female_male <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb2-21">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">filter</span>(Year <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1870</span>) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb2-22">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">lm</span>(le_fm <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">~</span> Year <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> Entity, <span class="at" style="color: #657422;
background-color: null;
font-style: inherit;">data =</span> .)</span>
<span id="cb2-23"></span>
<span id="cb2-24">model <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb2-25">  broom<span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">::</span><span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">tidy</span>() <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb2-26">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">arrange</span>(estimate) <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">%&gt;%</span></span>
<span id="cb2-27">  <span class="fu" style="color: #4758AB;
background-color: null;
font-style: inherit;">View</span>()</span></code></pre></div></div>
</details>
</div>



 ]]></description>
  <category>epidemiology</category>
  <category>R</category>
  <guid>https://www.tuffier.eu/posts/2023/2023-12-07_tidy-tuesday.html</guid>
  <pubDate>Wed, 06 Dec 2023 23:00:00 GMT</pubDate>
</item>
<item>
  <title>DAGitty’s shortcuts</title>
  <dc:creator>Stéphane Tuffier</dc:creator>
  <link>https://www.tuffier.eu/posts/2023/dagitty-cheat-sheet.html</link>
  <description><![CDATA[ 





<p>DAGitty is a free and open source tool to build directed acyclic graphs (DAG) or causal inference diagrams. The online version of DAGitty and can be found here <a href="http://dagitty.net/">http://dagitty.net/</a>.</p>
<p>The application came with plenty of shortcuts to make you life easier, however these are kind of hidden. Here is a little cheat-sheet to remind them :</p>
<table class="caption-top table">
<thead>
<tr class="header">
<th style="text-align: center;">Shortcut</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: center;"><code>n</code></td>
<td>add a new variable</td>
</tr>
<tr class="even">
<td style="text-align: center;"><code>r</code></td>
<td>rename a variable</td>
</tr>
<tr class="odd">
<td style="text-align: center;"><code>e</code></td>
<td>turn a node in exposure</td>
</tr>
<tr class="even">
<td style="text-align: center;"><code>o</code></td>
<td>turn a variable in outcome</td>
</tr>
<tr class="odd">
<td style="text-align: center;"><code>u</code></td>
<td>make a variable unobserved</td>
</tr>
<tr class="even">
<td style="text-align: center;"><code>a</code></td>
<td>adjust for a variable</td>
</tr>
<tr class="odd">
<td style="text-align: center;"><code>del</code> or <code>d</code></td>
<td>delete a variable</td>
</tr>
</tbody>
</table>
<section id="create-a-dag" class="level2">
<h2 class="anchored" data-anchor-id="create-a-dag">Create a DAG</h2>
<ol type="1">
<li>List potential variable that can influence with exposure and outcome</li>
<li>Add them to the DAG</li>
<li>Turn variable for which data is available as adjusted variable</li>
<li>Check whether the model is correctly adjusted on the right panel</li>
</ol>
</section>
<section id="export-dag" class="level2">
<h2 class="anchored" data-anchor-id="export-dag">Export DAG</h2>
<ul>
<li>Save it online using email (keep node position)</li>
<li>Save DAG as text (keep node position, can be tracked to git repo)</li>
</ul>
</section>
<section id="variable-types" class="level2">
<h2 class="anchored" data-anchor-id="variable-types">Variable types</h2>
<ul>
<li>adjusted variable: variable that can be included in the model</li>
<li>unobserved variable: varaible that is not available in the dataset</li>
</ul>


</section>

 ]]></description>
  <category>epidemiology</category>
  <category>research</category>
  <category>tools</category>
  <guid>https://www.tuffier.eu/posts/2023/dagitty-cheat-sheet.html</guid>
  <pubDate>Tue, 07 Nov 2023 23:00:00 GMT</pubDate>
  <media:content url="https://www.tuffier.eu/posts/2023/dag.png" medium="image" type="image/png" height="105" width="144"/>
</item>
</channel>
</rss>
