<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Guest post on Stats and R</title>
    <link>https://statsandr.com/tags/guest-post/</link>
    <description>Recent content in Guest post on Stats and R</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Tue, 27 Jan 2026 00:00:00 +0000</lastBuildDate>
    
	<atom:link href="https://statsandr.com/tags/guest-post/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>nycOpenData: A unified R interface to NYC Open Data APIs</title>
      <link>https://statsandr.com/blog/nycopendata-a-unified-r-interface-to-nyc-open-data-apis/</link>
      <pubDate>Tue, 27 Jan 2026 00:00:00 +0000</pubDate>
      
      <guid>https://statsandr.com/blog/nycopendata-a-unified-r-interface-to-nyc-open-data-apis/</guid>
      <description>


&lt;p&gt;&lt;img src=&#34;images/nycopendata-a-unified-r-interface-to-nyc-open-data-apis.jpg&#34; style=&#34;width:100.0%&#34; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Guest post by Christian Martinez, developer of the nycOpenData package in R.&lt;/em&gt;&lt;/p&gt;
&lt;div id=&#34;nycopendata-a-unified-r-interface-to-nyc-open-data-apis&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;nycOpenData: A unified R interface to NYC Open Data APIs&lt;/h1&gt;
&lt;p&gt;I am pleased to announce the release of &lt;code&gt;nycOpenData&lt;/code&gt;, an R package providing convenient, tidy access to dozens of datasets from the &lt;a href=&#34;https://opendata.cityofnewyork.us/&#34;&gt;New York City Open Data platform&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The package is designed as part of an open-science and reproducible-research effort, with the goal of lowering the friction between public data and statistical analysis—especially for teaching, exploratory research, and applied civic work.&lt;/p&gt;
&lt;div id=&#34;why-nycopendata&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Why nycOpenData?&lt;/h2&gt;
&lt;p&gt;NYC Open Data hosts hundreds of datasets covering topics such as public safety, housing, transportation, education, health, and city services. While these datasets are publicly accessible through the Socrata API, working with them directly often requires:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;knowing dataset identifiers,&lt;/li&gt;
&lt;li&gt;manually constructing API queries,&lt;/li&gt;
&lt;li&gt;handling pagination, timeouts, and rate limits,&lt;/li&gt;
&lt;li&gt;and performing repetitive data-cleaning steps.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;These barriers can slow down exploratory analysis and make public data less accessible to students, researchers, and practitioners who primarily work in R.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;nycOpenData&lt;/code&gt; was built to remove these obstacles by providing a consistent, user-friendly interface that returns clean tibbles ready for analysis—without requiring users to interact directly with the API.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;what-does-the-package-do&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;What does the package do?&lt;/h2&gt;
&lt;p&gt;The package provides a growing collection of wrapper functions, each corresponding to a specific NYC Open Data dataset or dataset family. All functions follow a shared design pattern and support:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;row limits,&lt;/li&gt;
&lt;li&gt;optional filtering via named lists,&lt;/li&gt;
&lt;li&gt;sorting,&lt;/li&gt;
&lt;li&gt;and graceful handling of API errors and timeouts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Examples of currently supported domains include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;311 service requests&lt;/li&gt;
&lt;li&gt;Transportation and for-hire vehicles&lt;/li&gt;
&lt;li&gt;Motor vehicle collisions&lt;/li&gt;
&lt;li&gt;Department of Buildings permits and complaints&lt;/li&gt;
&lt;li&gt;Education and school reporting&lt;/li&gt;
&lt;li&gt;Juvenile justice and public safety&lt;/li&gt;
&lt;li&gt;Street trees and environmental data&lt;/li&gt;
&lt;li&gt;Permitted events (historical)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A typical call looks like this:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;library(nycOpenData)

nyc_311(
  limit = 1000,
  filters = list(borough = &amp;quot;BROOKLYN&amp;quot;)
)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## # A tibble: 1,000 × 40
##    unique_key created_date          agency agency_name complaint_type descriptor
##    &amp;lt;chr&amp;gt;      &amp;lt;chr&amp;gt;                 &amp;lt;chr&amp;gt;  &amp;lt;chr&amp;gt;       &amp;lt;chr&amp;gt;          &amp;lt;chr&amp;gt;     
##  1 67613985   2026-01-26T02:06:05.… NYPD   New York C… Noise - Resid… Banging/P…
##  2 67609553   2026-01-26T02:02:09.… NYPD   New York C… Noise - Resid… Banging/P…
##  3 67610990   2026-01-26T01:58:58.… NYPD   New York C… Illegal Parki… Blocked H…
##  4 67615428   2026-01-26T01:56:49.… NYPD   New York C… Noise - Resid… Banging/P…
##  5 67609568   2026-01-26T01:48:16.… NYPD   New York C… Noise - Resid… Loud Musi…
##  6 67612476   2026-01-26T01:47:10.… NYPD   New York C… Noise - Resid… Loud Musi…
##  7 67614152   2026-01-26T01:46:26.… DSNY   Department… Snow or Ice    Snow Trac…
##  8 67614054   2026-01-26T01:44:50.… DSNY   Department… Dirty Conditi… Trash     
##  9 67606570   2026-01-26T01:41:32.… NYPD   New York C… Noise - Resid… Banging/P…
## 10 67610091   2026-01-26T01:35:51.… NYPD   New York C… Noise - Vehic… Car/Truck…
## # ℹ 990 more rows
## # ℹ 34 more variables: location_type &amp;lt;chr&amp;gt;, incident_zip &amp;lt;chr&amp;gt;,
## #   incident_address &amp;lt;chr&amp;gt;, street_name &amp;lt;chr&amp;gt;, cross_street_1 &amp;lt;chr&amp;gt;,
## #   cross_street_2 &amp;lt;chr&amp;gt;, intersection_street_1 &amp;lt;chr&amp;gt;,
## #   intersection_street_2 &amp;lt;chr&amp;gt;, address_type &amp;lt;chr&amp;gt;, city &amp;lt;chr&amp;gt;,
## #   landmark &amp;lt;chr&amp;gt;, status &amp;lt;chr&amp;gt;, community_board &amp;lt;chr&amp;gt;,
## #   council_district &amp;lt;chr&amp;gt;, police_precinct &amp;lt;chr&amp;gt;, bbl &amp;lt;chr&amp;gt;, borough &amp;lt;chr&amp;gt;, …&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The result is returned as a tidy tibble of the 1,000 most recent NYC 311 requests, making it immediately compatible with the tidyverse ecosystem for visualization, modeling, and reporting.&lt;/p&gt;
&lt;div id=&#34;mini-analysis&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;Mini analysis&lt;/h3&gt;
&lt;p&gt;One of the strongest qualities this function has is its ability to filter based on multiple columns. Let’s put everything together and get a dataset of the last &lt;em&gt;1,000&lt;/em&gt; 311 requests from the New York Police Department in Brooklyn.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;# Creating the dataset
brooklyn_nypd &amp;lt;- nyc_311(limit = 1000, filters = list(agency = &amp;quot;NYPD&amp;quot;, borough = &amp;quot;BROOKLYN&amp;quot;))

# Calling head of our new dataset
head(brooklyn_nypd)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## # A tibble: 6 × 39
##   unique_key created_date           agency agency_name complaint_type descriptor
##   &amp;lt;chr&amp;gt;      &amp;lt;chr&amp;gt;                  &amp;lt;chr&amp;gt;  &amp;lt;chr&amp;gt;       &amp;lt;chr&amp;gt;          &amp;lt;chr&amp;gt;     
## 1 67613985   2026-01-26T02:06:05.0… NYPD   New York C… Noise - Resid… Banging/P…
## 2 67609553   2026-01-26T02:02:09.0… NYPD   New York C… Noise - Resid… Banging/P…
## 3 67610990   2026-01-26T01:58:58.0… NYPD   New York C… Illegal Parki… Blocked H…
## 4 67615428   2026-01-26T01:56:49.0… NYPD   New York C… Noise - Resid… Banging/P…
## 5 67609568   2026-01-26T01:48:16.0… NYPD   New York C… Noise - Resid… Loud Musi…
## 6 67612476   2026-01-26T01:47:10.0… NYPD   New York C… Noise - Resid… Loud Musi…
## # ℹ 33 more variables: location_type &amp;lt;chr&amp;gt;, incident_zip &amp;lt;chr&amp;gt;,
## #   incident_address &amp;lt;chr&amp;gt;, street_name &amp;lt;chr&amp;gt;, cross_street_1 &amp;lt;chr&amp;gt;,
## #   cross_street_2 &amp;lt;chr&amp;gt;, intersection_street_1 &amp;lt;chr&amp;gt;,
## #   intersection_street_2 &amp;lt;chr&amp;gt;, address_type &amp;lt;chr&amp;gt;, city &amp;lt;chr&amp;gt;,
## #   landmark &amp;lt;chr&amp;gt;, status &amp;lt;chr&amp;gt;, community_board &amp;lt;chr&amp;gt;,
## #   council_district &amp;lt;chr&amp;gt;, police_precinct &amp;lt;chr&amp;gt;, bbl &amp;lt;chr&amp;gt;, borough &amp;lt;chr&amp;gt;,
## #   x_coordinate_state_plane &amp;lt;chr&amp;gt;, y_coordinate_state_plane &amp;lt;chr&amp;gt;, …&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;# Quick check to make sure our filtering worked
nrow(brooklyn_nypd)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## [1] 1000&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;unique(brooklyn_nypd$agency)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## [1] &amp;quot;NYPD&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;unique(brooklyn_nypd$borough)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## [1] &amp;quot;BROOKLYN&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We successfully created our dataset that contains the 1,000 most recent requests regarding the NYPD in the borough Brooklyn.&lt;/p&gt;
&lt;p&gt;Now that we have successfully pulled the data and have it in R, let’s figure out what NYC residents in Brooklyn are complaining about to the NYPD.&lt;/p&gt;
&lt;p&gt;To do this, we will create a &lt;a href=&#34;https://statsandr.com/blog/graphics-in-r-with-ggplot2/#barplot&#34;&gt;bar graph&lt;/a&gt; of the complaint types.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;# Visualizing the distribution, ordered by frequency
library(ggplot2)

ggplot(brooklyn_nypd, aes(y = reorder(complaint_type, complaint_type, length))) +
  geom_bar(fill = &amp;quot;steelblue&amp;quot;) +
  theme_minimal() +
  labs(
    title = &amp;quot;Most Recent NYPD 311 Complaints (Brooklyn)&amp;quot;,
    subtitle = &amp;quot;Top 1,000 service requests&amp;quot;,
    x = &amp;quot;Number of Complaints&amp;quot;,
    y = &amp;quot;Type of Complaint&amp;quot;
  )&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;figure&#34; style=&#34;text-align: center&#34;&gt;&lt;span style=&#34;display:block;&#34; id=&#34;fig:complaint-type-graph&#34;&gt;&lt;/span&gt;
&lt;img src=&#34;https://statsandr.com/blog/nycopendata-a-unified-r-interface-to-nyc-open-data-apis/index_files/figure-html/complaint-type-graph-1.png&#34; alt=&#34;Bar chart showing the frequency of NYPD-related 311 complaint types in Brooklyn from the 1,000 most recent service requests.&#34; width=&#34;100%&#34; /&gt;
&lt;p class=&#34;caption&#34;&gt;
Figure 1: Bar chart showing the frequency of NYPD-related 311 complaint types in Brooklyn from the 1,000 most recent service requests.
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;This graph shows us not only &lt;em&gt;which&lt;/em&gt; complaints were made, but &lt;em&gt;how many&lt;/em&gt; of each complaint were made.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&#34;designed-for-reproducible-workflows&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Designed for reproducible workflows&lt;/h2&gt;
&lt;p&gt;A core design principle of &lt;code&gt;nycOpenData&lt;/code&gt; is reproducibility. Rather than downloading static CSV files that can change over time or be accidentally modified, analyses can explicitly document:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;which dataset was used,&lt;/li&gt;
&lt;li&gt;how many rows were requested,&lt;/li&gt;
&lt;li&gt;which filters were applied,&lt;/li&gt;
&lt;li&gt;and when the data were accessed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This makes the package particularly useful for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;reproducible research projects,&lt;/li&gt;
&lt;li&gt;classroom assignments,&lt;/li&gt;
&lt;li&gt;data journalism,&lt;/li&gt;
&lt;li&gt;and exploratory civic analysis.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The package is also designed to be API-polite, with configurable timeouts and safeguards that help prevent common failure modes when querying large public datasets.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;who-is-it-for&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Who is it for?&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;nycOpenData&lt;/code&gt; is intended for a broad audience, including:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;students learning statistics or data science using real-world data,&lt;/li&gt;
&lt;li&gt;instructors teaching reproducible research or applied data analysis,&lt;/li&gt;
&lt;li&gt;researchers conducting exploratory or descriptive analyses,&lt;/li&gt;
&lt;li&gt;data journalists and civic technologists,&lt;/li&gt;
&lt;li&gt;and anyone interested in working with NYC public data in R.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The goal is not to abstract away the data itself, but to make access predictable, transparent, and easy to integrate into standard R workflows.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;availability&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Availability&lt;/h2&gt;
&lt;p&gt;The package is available on CRAN and can be installed using:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;install.packages(&amp;quot;nycOpenData&amp;quot;)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Development continues on GitHub, where new datasets and improvements are added regularly.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;acknowledgements&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Acknowledgements&lt;/h2&gt;
&lt;p&gt;This package was developed alongside teaching and applied research projects in reproducible data science, with inspiration from open-source contributors across the R community and the NYC Open Data program.&lt;/p&gt;
&lt;p&gt;Useful links&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;CRAN package: &lt;a href=&#34;https://CRAN.R-project.org/package=nycOpenData&#34; class=&#34;uri&#34;&gt;https://CRAN.R-project.org/package=nycOpenData&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;pkgdown site: &lt;a href=&#34;https://martinezc1.github.io/nycOpenData/&#34; class=&#34;uri&#34;&gt;https://martinezc1.github.io/nycOpenData/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;GitHub repository: &lt;a href=&#34;https://github.com/martinezc1/nycOpenData&#34; class=&#34;uri&#34;&gt;https://github.com/martinezc1/nycOpenData&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;NYC Open Data portal: &lt;a href=&#34;https://opendata.cityofnewyork.us/&#34; class=&#34;uri&#34;&gt;https://opendata.cityofnewyork.us/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As always, feedback, bug reports, and dataset requests are very welcome.&lt;/p&gt;
&lt;p&gt;Thanks for reading!&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
    </item>
    
    <item>
      <title>Nonparametric serial interval estimation</title>
      <link>https://statsandr.com/blog/nonparametric-serial-interval-estimation/</link>
      <pubDate>Mon, 18 Aug 2025 00:00:00 +0000</pubDate>
      
      <guid>https://statsandr.com/blog/nonparametric-serial-interval-estimation/</guid>
      <description>


&lt;div id=&#34;motivation&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Motivation&lt;/h2&gt;
&lt;p&gt;Epidemiological delays inform about the time between two well-defined events related to a disease. The serial interval (SI) of an infectious disease is defined as the time between symptom onset in a primary case (infector) and symptom onset in a secondary case (infectee). It is a widely used epidemiological delay quantity and plays a central role in mathematical/statistical models of disease transmission. There exists a tight link between the reproduction number (average number of secondary infections generated by an infected individual) and the serial interval. Therefore, getting accurate knowledge about the SI distribution is key to gain a clear understanding of transmission dynamics during outbreaks. Timings of symptom onset for infector-infectee pairs can be obtained from line list data and observations usually consist of calendar dates. From a mathematical perspective, it is more convenient to work with numbers than with calendar dates and the latter are typically transformed to integers for the sake of statistical analysis.&lt;/p&gt;
&lt;p&gt;The main challenge when working with SI data is censoring in the sense that exact symptom onset times are usually unobserved and only known to have occurred between two time points. If the time resolution of a reported timing of illness onset is a calendar day, for instance July 15, there is not enough information to determine the exact time of illness onset within that day. As such, symptom onset is assumed to have occurred between July 15 and July 16 and we say that serial interval data are interval-censored. The figure below illustrates the coarse structure of SI data that adds a layer of complexity to the estimation problem.&lt;/p&gt;
&lt;div class=&#34;float&#34;&gt;
&lt;img src=&#34;images/SIcoarse.PNG&#34; style=&#34;width:100.0%&#34; alt=&#34;Source: Gressani O, Hens N. (2025). Nonparametric serial interval estimation with uniform mixtures. PLoS Comput Biol 21(8): e1013338.&#34; /&gt;
&lt;div class=&#34;figcaption&#34;&gt;Source: Gressani O, Hens N. (2025). Nonparametric serial interval estimation with uniform mixtures. PLoS Comput Biol 21(8): e1013338.&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;A recent article by &lt;a href=&#34;https://doi.org/10.1371/journal.pcbi.1013338&#34;&gt;Gressani and Hens (2025)&lt;/a&gt; published in PLOS Computational Biology proposes a new estimator of the cumulative distribution function of the serial interval without making parametric assumptions regarding the underlying SI distribution. The estimator is based on mixtures of uniform distributions and only requires left and right bounds of serial interval windows of infector-infectee pairs as a main input (&lt;span class=&#34;math inline&#34;&gt;\(s_{iL}\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(s_{iR}\)&lt;/span&gt; in the above figure). Point estimates of different serial interval features are available in closed-form and the bootstrap is used to compute confidence intervals. The nonparametric methodology is relatively simple and computationally fast and stable. Moreover, a user-friendly routine is available in the &lt;a href=&#34;https://github.com/oswaldogressani/EpiDelays&#34;&gt;EpiDelays package&lt;/a&gt; written in R. This post aims at giving users a simple first experience with this new nonparametric methodology for serial interval estimation. The package can be installed from GitHub (using devtools) as follows:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;install.packages(&amp;quot;devtools&amp;quot;)
devtools::install_github(&amp;quot;oswaldogressani/EpiDelays&amp;quot;)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;simulated-data&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Simulated data&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;estimSI()&lt;/code&gt; routine of the EpiDelays package can be used to compute nonparametric estimates (point estimates with standard errors and confidence intervals) of different serial interval features (e.g. the mean, median, standard deviation). The routine is simple to use and requires only two inputs:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;x&lt;/code&gt;: A data frame with &lt;span class=&#34;math inline&#34;&gt;\(n\)&lt;/span&gt; rows (corresponding to the number of transmission pairs for which illness onset data is available) and two columns containing the lower bound of the SI window &lt;span class=&#34;math inline&#34;&gt;\(s_{iL}\)&lt;/span&gt; (first column) and the upper bound of the SI window &lt;span class=&#34;math inline&#34;&gt;\(s_{iR}\)&lt;/span&gt; (second column).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;nboot&lt;/code&gt;: An integer for the bootstrap sample size (default is 2000) used to construct (&lt;span class=&#34;math inline&#34;&gt;\(90\%\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(95\%\)&lt;/span&gt;) confidence intervals (CIs).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We start by illustrating the use of &lt;code&gt;estimSI()&lt;/code&gt; on simulated data. The &lt;code&gt;simSI()&lt;/code&gt; routine can be used to simulate artificial serial interval data with SI windows having a width (coarseness) of at least two days. The underlying target SI distribution is assumed to have a Gaussian distribution with mean &lt;code&gt;muS&lt;/code&gt; and standard deviation &lt;code&gt;sdS&lt;/code&gt; that have to be specified by the user. The code below can be used to generate &lt;span class=&#34;math inline&#34;&gt;\(n=15\)&lt;/span&gt; SI windows from a Gaussian distribution with a mean of &lt;span class=&#34;math inline&#34;&gt;\(3\)&lt;/span&gt; days and standard deviation of &lt;span class=&#34;math inline&#34;&gt;\(2\)&lt;/span&gt; days. More details regarding the data generating mechanism can be found in the &lt;a href=&#34;https://doi.org/10.1371/journal.pcbi.1013338&#34;&gt;article&lt;/a&gt;.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;set.seed(2025)
simdata &amp;lt;- simSI(muS = 3, sdS = 2, n = 15)
gt::gt(round(simdata, 2))&lt;/code&gt;&lt;/pre&gt;
&lt;div id=&#34;kwsipvprqq&#34; style=&#34;padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;&#34;&gt;
&lt;style&gt;#kwsipvprqq table {
  font-family: system-ui, &#39;Segoe UI&#39;, Roboto, Helvetica, Arial, sans-serif, &#39;Apple Color Emoji&#39;, &#39;Segoe UI Emoji&#39;, &#39;Segoe UI Symbol&#39;, &#39;Noto Color Emoji&#39;;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#kwsipvprqq thead, #kwsipvprqq tbody, #kwsipvprqq tfoot, #kwsipvprqq tr, #kwsipvprqq td, #kwsipvprqq th {
  border-style: none;
}

#kwsipvprqq p {
  margin: 0;
  padding: 0;
}

#kwsipvprqq .gt_table {
  display: table;
  border-collapse: collapse;
  line-height: normal;
  margin-left: auto;
  margin-right: auto;
  color: #333333;
  font-size: 16px;
  font-weight: normal;
  font-style: normal;
  background-color: #FFFFFF;
  width: auto;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #A8A8A8;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #A8A8A8;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
}

#kwsipvprqq .gt_caption {
  padding-top: 4px;
  padding-bottom: 4px;
}

#kwsipvprqq .gt_title {
  color: #333333;
  font-size: 125%;
  font-weight: initial;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-color: #FFFFFF;
  border-bottom-width: 0;
}

#kwsipvprqq .gt_subtitle {
  color: #333333;
  font-size: 85%;
  font-weight: initial;
  padding-top: 3px;
  padding-bottom: 5px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-color: #FFFFFF;
  border-top-width: 0;
}

#kwsipvprqq .gt_heading {
  background-color: #FFFFFF;
  text-align: center;
  border-bottom-color: #FFFFFF;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#kwsipvprqq .gt_bottom_border {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#kwsipvprqq .gt_col_headings {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#kwsipvprqq .gt_col_heading {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: normal;
  text-transform: inherit;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 6px;
  padding-left: 5px;
  padding-right: 5px;
  overflow-x: hidden;
}

#kwsipvprqq .gt_column_spanner_outer {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: normal;
  text-transform: inherit;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 4px;
  padding-right: 4px;
}

#kwsipvprqq .gt_column_spanner_outer:first-child {
  padding-left: 0;
}

#kwsipvprqq .gt_column_spanner_outer:last-child {
  padding-right: 0;
}

#kwsipvprqq .gt_column_spanner {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 5px;
  overflow-x: hidden;
  display: inline-block;
  width: 100%;
}

#kwsipvprqq .gt_spanner_row {
  border-bottom-style: hidden;
}

#kwsipvprqq .gt_group_heading {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  text-align: left;
}

#kwsipvprqq .gt_empty_group_heading {
  padding: 0.5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: middle;
}

#kwsipvprqq .gt_from_md &gt; :first-child {
  margin-top: 0;
}

#kwsipvprqq .gt_from_md &gt; :last-child {
  margin-bottom: 0;
}

#kwsipvprqq .gt_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  margin: 10px;
  border-top-style: solid;
  border-top-width: 1px;
  border-top-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  overflow-x: hidden;
}

#kwsipvprqq .gt_stub {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
}

#kwsipvprqq .gt_stub_row_group {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
  vertical-align: top;
}

#kwsipvprqq .gt_row_group_first td {
  border-top-width: 2px;
}

#kwsipvprqq .gt_row_group_first th {
  border-top-width: 2px;
}

#kwsipvprqq .gt_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#kwsipvprqq .gt_first_summary_row {
  border-top-style: solid;
  border-top-color: #D3D3D3;
}

#kwsipvprqq .gt_first_summary_row.thick {
  border-top-width: 2px;
}

#kwsipvprqq .gt_last_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#kwsipvprqq .gt_grand_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#kwsipvprqq .gt_first_grand_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-style: double;
  border-top-width: 6px;
  border-top-color: #D3D3D3;
}

#kwsipvprqq .gt_last_grand_summary_row_top {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: double;
  border-bottom-width: 6px;
  border-bottom-color: #D3D3D3;
}

#kwsipvprqq .gt_striped {
  background-color: rgba(128, 128, 128, 0.05);
}

#kwsipvprqq .gt_table_body {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#kwsipvprqq .gt_footnotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#kwsipvprqq .gt_footnote {
  margin: 0px;
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#kwsipvprqq .gt_sourcenotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#kwsipvprqq .gt_sourcenote {
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#kwsipvprqq .gt_left {
  text-align: left;
}

#kwsipvprqq .gt_center {
  text-align: center;
}

#kwsipvprqq .gt_right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#kwsipvprqq .gt_font_normal {
  font-weight: normal;
}

#kwsipvprqq .gt_font_bold {
  font-weight: bold;
}

#kwsipvprqq .gt_font_italic {
  font-style: italic;
}

#kwsipvprqq .gt_super {
  font-size: 65%;
}

#kwsipvprqq .gt_footnote_marks {
  font-size: 75%;
  vertical-align: 0.4em;
  position: initial;
}

#kwsipvprqq .gt_asterisk {
  font-size: 100%;
  vertical-align: 0;
}

#kwsipvprqq .gt_indent_1 {
  text-indent: 5px;
}

#kwsipvprqq .gt_indent_2 {
  text-indent: 10px;
}

#kwsipvprqq .gt_indent_3 {
  text-indent: 15px;
}

#kwsipvprqq .gt_indent_4 {
  text-indent: 20px;
}

#kwsipvprqq .gt_indent_5 {
  text-indent: 25px;
}

#kwsipvprqq .katex-display {
  display: inline-flex !important;
  margin-bottom: 0.75em !important;
}

#kwsipvprqq div.Reactable &gt; div.rt-table &gt; div.rt-thead &gt; div.rt-tr.rt-tr-group-header &gt; div.rt-th-group:after {
  height: 0px !important;
}
&lt;/style&gt;
&lt;table class=&#34;gt_table&#34; data-quarto-disable-processing=&#34;false&#34; data-quarto-bootstrap=&#34;false&#34;&gt;
  &lt;thead&gt;
    &lt;tr class=&#34;gt_col_headings&#34;&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;s&#34;&gt;s&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;sl&#34;&gt;sl&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;sr&#34;&gt;sr&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;sw&#34;&gt;sw&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody class=&#34;gt_table_body&#34;&gt;
    &lt;tr&gt;&lt;td headers=&#34;s&#34; class=&#34;gt_row gt_right&#34;&gt;4.24&lt;/td&gt;
&lt;td headers=&#34;sl&#34; class=&#34;gt_row gt_right&#34;&gt;3&lt;/td&gt;
&lt;td headers=&#34;sr&#34; class=&#34;gt_row gt_right&#34;&gt;5&lt;/td&gt;
&lt;td headers=&#34;sw&#34; class=&#34;gt_row gt_right&#34;&gt;2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;s&#34; class=&#34;gt_row gt_right&#34;&gt;3.07&lt;/td&gt;
&lt;td headers=&#34;sl&#34; class=&#34;gt_row gt_right&#34;&gt;2&lt;/td&gt;
&lt;td headers=&#34;sr&#34; class=&#34;gt_row gt_right&#34;&gt;4&lt;/td&gt;
&lt;td headers=&#34;sw&#34; class=&#34;gt_row gt_right&#34;&gt;2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;s&#34; class=&#34;gt_row gt_right&#34;&gt;4.55&lt;/td&gt;
&lt;td headers=&#34;sl&#34; class=&#34;gt_row gt_right&#34;&gt;4&lt;/td&gt;
&lt;td headers=&#34;sr&#34; class=&#34;gt_row gt_right&#34;&gt;6&lt;/td&gt;
&lt;td headers=&#34;sw&#34; class=&#34;gt_row gt_right&#34;&gt;2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;s&#34; class=&#34;gt_row gt_right&#34;&gt;5.54&lt;/td&gt;
&lt;td headers=&#34;sl&#34; class=&#34;gt_row gt_right&#34;&gt;5&lt;/td&gt;
&lt;td headers=&#34;sr&#34; class=&#34;gt_row gt_right&#34;&gt;7&lt;/td&gt;
&lt;td headers=&#34;sw&#34; class=&#34;gt_row gt_right&#34;&gt;2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;s&#34; class=&#34;gt_row gt_right&#34;&gt;3.74&lt;/td&gt;
&lt;td headers=&#34;sl&#34; class=&#34;gt_row gt_right&#34;&gt;3&lt;/td&gt;
&lt;td headers=&#34;sr&#34; class=&#34;gt_row gt_right&#34;&gt;5&lt;/td&gt;
&lt;td headers=&#34;sw&#34; class=&#34;gt_row gt_right&#34;&gt;2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;s&#34; class=&#34;gt_row gt_right&#34;&gt;2.67&lt;/td&gt;
&lt;td headers=&#34;sl&#34; class=&#34;gt_row gt_right&#34;&gt;2&lt;/td&gt;
&lt;td headers=&#34;sr&#34; class=&#34;gt_row gt_right&#34;&gt;4&lt;/td&gt;
&lt;td headers=&#34;sw&#34; class=&#34;gt_row gt_right&#34;&gt;2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;s&#34; class=&#34;gt_row gt_right&#34;&gt;3.79&lt;/td&gt;
&lt;td headers=&#34;sl&#34; class=&#34;gt_row gt_right&#34;&gt;3&lt;/td&gt;
&lt;td headers=&#34;sr&#34; class=&#34;gt_row gt_right&#34;&gt;5&lt;/td&gt;
&lt;td headers=&#34;sw&#34; class=&#34;gt_row gt_right&#34;&gt;2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;s&#34; class=&#34;gt_row gt_right&#34;&gt;2.84&lt;/td&gt;
&lt;td headers=&#34;sl&#34; class=&#34;gt_row gt_right&#34;&gt;2&lt;/td&gt;
&lt;td headers=&#34;sr&#34; class=&#34;gt_row gt_right&#34;&gt;4&lt;/td&gt;
&lt;td headers=&#34;sw&#34; class=&#34;gt_row gt_right&#34;&gt;2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;s&#34; class=&#34;gt_row gt_right&#34;&gt;2.31&lt;/td&gt;
&lt;td headers=&#34;sl&#34; class=&#34;gt_row gt_right&#34;&gt;1&lt;/td&gt;
&lt;td headers=&#34;sr&#34; class=&#34;gt_row gt_right&#34;&gt;5&lt;/td&gt;
&lt;td headers=&#34;sw&#34; class=&#34;gt_row gt_right&#34;&gt;4&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;s&#34; class=&#34;gt_row gt_right&#34;&gt;4.40&lt;/td&gt;
&lt;td headers=&#34;sl&#34; class=&#34;gt_row gt_right&#34;&gt;3&lt;/td&gt;
&lt;td headers=&#34;sr&#34; class=&#34;gt_row gt_right&#34;&gt;6&lt;/td&gt;
&lt;td headers=&#34;sw&#34; class=&#34;gt_row gt_right&#34;&gt;3&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;s&#34; class=&#34;gt_row gt_right&#34;&gt;2.21&lt;/td&gt;
&lt;td headers=&#34;sl&#34; class=&#34;gt_row gt_right&#34;&gt;1&lt;/td&gt;
&lt;td headers=&#34;sr&#34; class=&#34;gt_row gt_right&#34;&gt;3&lt;/td&gt;
&lt;td headers=&#34;sw&#34; class=&#34;gt_row gt_right&#34;&gt;2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;s&#34; class=&#34;gt_row gt_right&#34;&gt;-0.51&lt;/td&gt;
&lt;td headers=&#34;sl&#34; class=&#34;gt_row gt_right&#34;&gt;-2&lt;/td&gt;
&lt;td headers=&#34;sr&#34; class=&#34;gt_row gt_right&#34;&gt;1&lt;/td&gt;
&lt;td headers=&#34;sw&#34; class=&#34;gt_row gt_right&#34;&gt;3&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;s&#34; class=&#34;gt_row gt_right&#34;&gt;2.16&lt;/td&gt;
&lt;td headers=&#34;sl&#34; class=&#34;gt_row gt_right&#34;&gt;1&lt;/td&gt;
&lt;td headers=&#34;sr&#34; class=&#34;gt_row gt_right&#34;&gt;3&lt;/td&gt;
&lt;td headers=&#34;sw&#34; class=&#34;gt_row gt_right&#34;&gt;2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;s&#34; class=&#34;gt_row gt_right&#34;&gt;4.53&lt;/td&gt;
&lt;td headers=&#34;sl&#34; class=&#34;gt_row gt_right&#34;&gt;2&lt;/td&gt;
&lt;td headers=&#34;sr&#34; class=&#34;gt_row gt_right&#34;&gt;5&lt;/td&gt;
&lt;td headers=&#34;sw&#34; class=&#34;gt_row gt_right&#34;&gt;3&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;s&#34; class=&#34;gt_row gt_right&#34;&gt;5.13&lt;/td&gt;
&lt;td headers=&#34;sl&#34; class=&#34;gt_row gt_right&#34;&gt;3&lt;/td&gt;
&lt;td headers=&#34;sr&#34; class=&#34;gt_row gt_right&#34;&gt;7&lt;/td&gt;
&lt;td headers=&#34;sw&#34; class=&#34;gt_row gt_right&#34;&gt;4&lt;/td&gt;&lt;/tr&gt;
  &lt;/tbody&gt;
  
  
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;The first column of the simulated dataset contains the true (unobserved) serial interval value generated from the chosen Gaussian distribution. The second and third columns contain the left and right bound of the SI window (&lt;code&gt;sl&lt;/code&gt; and &lt;code&gt;sr&lt;/code&gt;). Finally, the last column contains the width of the observed SI window, i.e. &lt;code&gt;sw=sr-sl&lt;/code&gt;. The underlying target SI distribution is specified to be Gaussian with a mean of &lt;span class=&#34;math inline&#34;&gt;\(3\)&lt;/span&gt; days and standard deviation of &lt;span class=&#34;math inline&#34;&gt;\(2\)&lt;/span&gt; days. The 5th, 25th, 75th and 95th quantiles of the latter distribution are:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;round(qnorm(p = c(0.05, 0.25, 0.75, 0.95), mean = 3, sd = 2), 1)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## [1] -0.3  1.7  4.3  6.3&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We now create a data frame containing &lt;code&gt;sl&lt;/code&gt; and &lt;code&gt;sr&lt;/code&gt; and use the latter as an input in the &lt;code&gt;estimSI()&lt;/code&gt; routine. Nonparametric estimates of different SI features can be accessed with &lt;code&gt;$npestim$&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;xdf &amp;lt;- data.frame(sl = simdata$sl, sr = simdata$sr)
SIfit &amp;lt;- estimSI(x = xdf, nboot = 2000)
gt::gt(round(SIfit$npestim, 1),
  rownames_to_stub = TRUE
)&lt;/code&gt;&lt;/pre&gt;
&lt;div id=&#34;aomvniacfb&#34; style=&#34;padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;&#34;&gt;
&lt;style&gt;#aomvniacfb table {
  font-family: system-ui, &#39;Segoe UI&#39;, Roboto, Helvetica, Arial, sans-serif, &#39;Apple Color Emoji&#39;, &#39;Segoe UI Emoji&#39;, &#39;Segoe UI Symbol&#39;, &#39;Noto Color Emoji&#39;;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#aomvniacfb thead, #aomvniacfb tbody, #aomvniacfb tfoot, #aomvniacfb tr, #aomvniacfb td, #aomvniacfb th {
  border-style: none;
}

#aomvniacfb p {
  margin: 0;
  padding: 0;
}

#aomvniacfb .gt_table {
  display: table;
  border-collapse: collapse;
  line-height: normal;
  margin-left: auto;
  margin-right: auto;
  color: #333333;
  font-size: 16px;
  font-weight: normal;
  font-style: normal;
  background-color: #FFFFFF;
  width: auto;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #A8A8A8;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #A8A8A8;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
}

#aomvniacfb .gt_caption {
  padding-top: 4px;
  padding-bottom: 4px;
}

#aomvniacfb .gt_title {
  color: #333333;
  font-size: 125%;
  font-weight: initial;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-color: #FFFFFF;
  border-bottom-width: 0;
}

#aomvniacfb .gt_subtitle {
  color: #333333;
  font-size: 85%;
  font-weight: initial;
  padding-top: 3px;
  padding-bottom: 5px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-color: #FFFFFF;
  border-top-width: 0;
}

#aomvniacfb .gt_heading {
  background-color: #FFFFFF;
  text-align: center;
  border-bottom-color: #FFFFFF;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#aomvniacfb .gt_bottom_border {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#aomvniacfb .gt_col_headings {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#aomvniacfb .gt_col_heading {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: normal;
  text-transform: inherit;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 6px;
  padding-left: 5px;
  padding-right: 5px;
  overflow-x: hidden;
}

#aomvniacfb .gt_column_spanner_outer {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: normal;
  text-transform: inherit;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 4px;
  padding-right: 4px;
}

#aomvniacfb .gt_column_spanner_outer:first-child {
  padding-left: 0;
}

#aomvniacfb .gt_column_spanner_outer:last-child {
  padding-right: 0;
}

#aomvniacfb .gt_column_spanner {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 5px;
  overflow-x: hidden;
  display: inline-block;
  width: 100%;
}

#aomvniacfb .gt_spanner_row {
  border-bottom-style: hidden;
}

#aomvniacfb .gt_group_heading {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  text-align: left;
}

#aomvniacfb .gt_empty_group_heading {
  padding: 0.5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: middle;
}

#aomvniacfb .gt_from_md &gt; :first-child {
  margin-top: 0;
}

#aomvniacfb .gt_from_md &gt; :last-child {
  margin-bottom: 0;
}

#aomvniacfb .gt_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  margin: 10px;
  border-top-style: solid;
  border-top-width: 1px;
  border-top-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  overflow-x: hidden;
}

#aomvniacfb .gt_stub {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
}

#aomvniacfb .gt_stub_row_group {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
  vertical-align: top;
}

#aomvniacfb .gt_row_group_first td {
  border-top-width: 2px;
}

#aomvniacfb .gt_row_group_first th {
  border-top-width: 2px;
}

#aomvniacfb .gt_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#aomvniacfb .gt_first_summary_row {
  border-top-style: solid;
  border-top-color: #D3D3D3;
}

#aomvniacfb .gt_first_summary_row.thick {
  border-top-width: 2px;
}

#aomvniacfb .gt_last_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#aomvniacfb .gt_grand_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#aomvniacfb .gt_first_grand_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-style: double;
  border-top-width: 6px;
  border-top-color: #D3D3D3;
}

#aomvniacfb .gt_last_grand_summary_row_top {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: double;
  border-bottom-width: 6px;
  border-bottom-color: #D3D3D3;
}

#aomvniacfb .gt_striped {
  background-color: rgba(128, 128, 128, 0.05);
}

#aomvniacfb .gt_table_body {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#aomvniacfb .gt_footnotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#aomvniacfb .gt_footnote {
  margin: 0px;
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#aomvniacfb .gt_sourcenotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#aomvniacfb .gt_sourcenote {
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#aomvniacfb .gt_left {
  text-align: left;
}

#aomvniacfb .gt_center {
  text-align: center;
}

#aomvniacfb .gt_right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#aomvniacfb .gt_font_normal {
  font-weight: normal;
}

#aomvniacfb .gt_font_bold {
  font-weight: bold;
}

#aomvniacfb .gt_font_italic {
  font-style: italic;
}

#aomvniacfb .gt_super {
  font-size: 65%;
}

#aomvniacfb .gt_footnote_marks {
  font-size: 75%;
  vertical-align: 0.4em;
  position: initial;
}

#aomvniacfb .gt_asterisk {
  font-size: 100%;
  vertical-align: 0;
}

#aomvniacfb .gt_indent_1 {
  text-indent: 5px;
}

#aomvniacfb .gt_indent_2 {
  text-indent: 10px;
}

#aomvniacfb .gt_indent_3 {
  text-indent: 15px;
}

#aomvniacfb .gt_indent_4 {
  text-indent: 20px;
}

#aomvniacfb .gt_indent_5 {
  text-indent: 25px;
}

#aomvniacfb .katex-display {
  display: inline-flex !important;
  margin-bottom: 0.75em !important;
}

#aomvniacfb div.Reactable &gt; div.rt-table &gt; div.rt-thead &gt; div.rt-tr.rt-tr-group-header &gt; div.rt-th-group:after {
  height: 0px !important;
}
&lt;/style&gt;
&lt;table class=&#34;gt_table&#34; data-quarto-disable-processing=&#34;false&#34; data-quarto-bootstrap=&#34;false&#34;&gt;
  &lt;thead&gt;
    &lt;tr class=&#34;gt_col_headings&#34;&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_left&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;a::stub&#34;&gt;&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;mean&#34;&gt;mean&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;sd&#34;&gt;sd&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;q0.05&#34;&gt;q0.05&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;q0.25&#34;&gt;q0.25&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;q0.5&#34;&gt;q0.5&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;q0.75&#34;&gt;q0.75&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;q0.95&#34;&gt;q0.95&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody class=&#34;gt_table_body&#34;&gt;
    &lt;tr&gt;&lt;th id=&#34;stub_1_1&#34; scope=&#34;row&#34; class=&#34;gt_row gt_left gt_stub&#34;&gt;point&lt;/th&gt;
&lt;td headers=&#34;stub_1_1 mean&#34; class=&#34;gt_row gt_right&#34;&gt;3.4&lt;/td&gt;
&lt;td headers=&#34;stub_1_1 sd&#34; class=&#34;gt_row gt_right&#34;&gt;1.7&lt;/td&gt;
&lt;td headers=&#34;stub_1_1 q0.05&#34; class=&#34;gt_row gt_right&#34;&gt;0.3&lt;/td&gt;
&lt;td headers=&#34;stub_1_1 q0.25&#34; class=&#34;gt_row gt_right&#34;&gt;2.5&lt;/td&gt;
&lt;td headers=&#34;stub_1_1 q0.5&#34; class=&#34;gt_row gt_right&#34;&gt;3.5&lt;/td&gt;
&lt;td headers=&#34;stub_1_1 q0.75&#34; class=&#34;gt_row gt_right&#34;&gt;4.6&lt;/td&gt;
&lt;td headers=&#34;stub_1_1 q0.95&#34; class=&#34;gt_row gt_right&#34;&gt;6.0&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;th id=&#34;stub_1_2&#34; scope=&#34;row&#34; class=&#34;gt_row gt_left gt_stub&#34;&gt;se&lt;/th&gt;
&lt;td headers=&#34;stub_1_2 mean&#34; class=&#34;gt_row gt_right&#34;&gt;0.4&lt;/td&gt;
&lt;td headers=&#34;stub_1_2 sd&#34; class=&#34;gt_row gt_right&#34;&gt;0.3&lt;/td&gt;
&lt;td headers=&#34;stub_1_2 q0.05&#34; class=&#34;gt_row gt_right&#34;&gt;1.1&lt;/td&gt;
&lt;td headers=&#34;stub_1_2 q0.25&#34; class=&#34;gt_row gt_right&#34;&gt;0.4&lt;/td&gt;
&lt;td headers=&#34;stub_1_2 q0.5&#34; class=&#34;gt_row gt_right&#34;&gt;0.3&lt;/td&gt;
&lt;td headers=&#34;stub_1_2 q0.75&#34; class=&#34;gt_row gt_right&#34;&gt;0.4&lt;/td&gt;
&lt;td headers=&#34;stub_1_2 q0.95&#34; class=&#34;gt_row gt_right&#34;&gt;0.5&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;th id=&#34;stub_1_3&#34; scope=&#34;row&#34; class=&#34;gt_row gt_left gt_stub&#34;&gt;ci90l&lt;/th&gt;
&lt;td headers=&#34;stub_1_3 mean&#34; class=&#34;gt_row gt_right&#34;&gt;2.8&lt;/td&gt;
&lt;td headers=&#34;stub_1_3 sd&#34; class=&#34;gt_row gt_right&#34;&gt;1.1&lt;/td&gt;
&lt;td headers=&#34;stub_1_3 q0.05&#34; class=&#34;gt_row gt_right&#34;&gt;-1.3&lt;/td&gt;
&lt;td headers=&#34;stub_1_3 q0.25&#34; class=&#34;gt_row gt_right&#34;&gt;1.8&lt;/td&gt;
&lt;td headers=&#34;stub_1_3 q0.5&#34; class=&#34;gt_row gt_right&#34;&gt;2.9&lt;/td&gt;
&lt;td headers=&#34;stub_1_3 q0.75&#34; class=&#34;gt_row gt_right&#34;&gt;3.9&lt;/td&gt;
&lt;td headers=&#34;stub_1_3 q0.95&#34; class=&#34;gt_row gt_right&#34;&gt;5.0&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;th id=&#34;stub_1_4&#34; scope=&#34;row&#34; class=&#34;gt_row gt_left gt_stub&#34;&gt;ci90r&lt;/th&gt;
&lt;td headers=&#34;stub_1_4 mean&#34; class=&#34;gt_row gt_right&#34;&gt;4.0&lt;/td&gt;
&lt;td headers=&#34;stub_1_4 sd&#34; class=&#34;gt_row gt_right&#34;&gt;2.1&lt;/td&gt;
&lt;td headers=&#34;stub_1_4 q0.05&#34; class=&#34;gt_row gt_right&#34;&gt;2.1&lt;/td&gt;
&lt;td headers=&#34;stub_1_4 q0.25&#34; class=&#34;gt_row gt_right&#34;&gt;3.2&lt;/td&gt;
&lt;td headers=&#34;stub_1_4 q0.5&#34; class=&#34;gt_row gt_right&#34;&gt;4.1&lt;/td&gt;
&lt;td headers=&#34;stub_1_4 q0.75&#34; class=&#34;gt_row gt_right&#34;&gt;5.2&lt;/td&gt;
&lt;td headers=&#34;stub_1_4 q0.95&#34; class=&#34;gt_row gt_right&#34;&gt;6.6&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;th id=&#34;stub_1_5&#34; scope=&#34;row&#34; class=&#34;gt_row gt_left gt_stub&#34;&gt;ci95l&lt;/th&gt;
&lt;td headers=&#34;stub_1_5 mean&#34; class=&#34;gt_row gt_right&#34;&gt;2.7&lt;/td&gt;
&lt;td headers=&#34;stub_1_5 sd&#34; class=&#34;gt_row gt_right&#34;&gt;1.1&lt;/td&gt;
&lt;td headers=&#34;stub_1_5 q0.05&#34; class=&#34;gt_row gt_right&#34;&gt;-1.3&lt;/td&gt;
&lt;td headers=&#34;stub_1_5 q0.25&#34; class=&#34;gt_row gt_right&#34;&gt;1.5&lt;/td&gt;
&lt;td headers=&#34;stub_1_5 q0.5&#34; class=&#34;gt_row gt_right&#34;&gt;2.8&lt;/td&gt;
&lt;td headers=&#34;stub_1_5 q0.75&#34; class=&#34;gt_row gt_right&#34;&gt;3.8&lt;/td&gt;
&lt;td headers=&#34;stub_1_5 q0.95&#34; class=&#34;gt_row gt_right&#34;&gt;4.9&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;th id=&#34;stub_1_6&#34; scope=&#34;row&#34; class=&#34;gt_row gt_left gt_stub&#34;&gt;ci95r&lt;/th&gt;
&lt;td headers=&#34;stub_1_6 mean&#34; class=&#34;gt_row gt_right&#34;&gt;4.2&lt;/td&gt;
&lt;td headers=&#34;stub_1_6 sd&#34; class=&#34;gt_row gt_right&#34;&gt;2.2&lt;/td&gt;
&lt;td headers=&#34;stub_1_6 q0.05&#34; class=&#34;gt_row gt_right&#34;&gt;2.1&lt;/td&gt;
&lt;td headers=&#34;stub_1_6 q0.25&#34; class=&#34;gt_row gt_right&#34;&gt;3.3&lt;/td&gt;
&lt;td headers=&#34;stub_1_6 q0.5&#34; class=&#34;gt_row gt_right&#34;&gt;4.2&lt;/td&gt;
&lt;td headers=&#34;stub_1_6 q0.75&#34; class=&#34;gt_row gt_right&#34;&gt;5.4&lt;/td&gt;
&lt;td headers=&#34;stub_1_6 q0.95&#34; class=&#34;gt_row gt_right&#34;&gt;6.6&lt;/td&gt;&lt;/tr&gt;
  &lt;/tbody&gt;
  
  
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;The output shows point estimates (point), standard errors (se) and confidence intervals bounds (ci) for the serial interval mean, standard deviation (sd) and 5th, 25th, 50th, 75th and 95th quantiles denoted by q0.05, q0.25, etc. We can also plot the estimated cumulative distribution function (cdf) obtained with the nonparametric approach and compare it with the target Gaussian cdf. The quality of the fit will typically depend on the sample size &lt;span class=&#34;math inline&#34;&gt;\(n\)&lt;/span&gt; and on the degree of coarseness present in the data. Note that the nonparametric methodology naturally deals with negative SI values.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;sl &amp;lt;- simdata$sl
sr &amp;lt;- simdata$sr
Fhat &amp;lt;- function(s) (1 / SIfit$n) * sum((s - sl) / (sr - sl) * (s &amp;gt;= sl &amp;amp; s &amp;lt;= sr) + (s &amp;gt; sr))
sf &amp;lt;- seq(-3, 8, length = 100)
plot(sf, sapply(sf, Fhat), type = &amp;quot;l&amp;quot;, lwd = 2, xlab = &amp;quot;Serial interval&amp;quot;, ylab = &amp;quot;cdf&amp;quot;)
grid()
lines(sf, pnorm(sf, mean = 3, sd = 2), col = &amp;quot;blue&amp;quot;, lwd = 2)
legend(&amp;quot;topleft&amp;quot;, c(&amp;quot;Estimated cdf of SI&amp;quot;, &amp;quot;Target cdf of SI&amp;quot;), col = c(&amp;quot;black&amp;quot;, &amp;quot;blue&amp;quot;), lwd = c(2, 2), bty = &amp;quot;n&amp;quot;)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;https://statsandr.com/blog/nonparametric-serial-interval-estimation/index_files/figure-html/comparecdfs-1.png&#34; width=&#34;100%&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;real-data&#34; class=&#34;section level2&#34;&gt;
&lt;h2&gt;Real data&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://www.nejm.org/doi/full/10.1056/NEJMoa0906089&#34;&gt;Lessler et al. (2009)&lt;/a&gt; share a dataset containing serial interval windows obtained from &lt;span class=&#34;math inline&#34;&gt;\(n=16\)&lt;/span&gt; infector-infectee pairs for Influenza A (2009 H1N1 influenza) at a New York City school. The SI windows are directly available from the supplementary appendix of the latter reference and are encoded in a data frame &lt;code&gt;xNY&lt;/code&gt;. Nonparametric estimates of serial interval features are then obtained with &lt;code&gt;estimSI()&lt;/code&gt;.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;xNY &amp;lt;- data.frame(sl = c(1, 1, 1, 0, 0, 4, 2, 3, 0, 3, 0, 3, 4, 1, 3, 3), sr = c(3, 3, 3, 2, 2, 6, 4, 5, 2, 5, 2, 5, 6, 3, 5, 5))
set.seed(123)
SIfitNY &amp;lt;- estimSI(xNY, nboot = 2000)
gt::gt(round(SIfitNY$npestim, 1),
  rownames_to_stub = TRUE
)&lt;/code&gt;&lt;/pre&gt;
&lt;div id=&#34;lkmlioxfax&#34; style=&#34;padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;&#34;&gt;
&lt;style&gt;#lkmlioxfax table {
  font-family: system-ui, &#39;Segoe UI&#39;, Roboto, Helvetica, Arial, sans-serif, &#39;Apple Color Emoji&#39;, &#39;Segoe UI Emoji&#39;, &#39;Segoe UI Symbol&#39;, &#39;Noto Color Emoji&#39;;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#lkmlioxfax thead, #lkmlioxfax tbody, #lkmlioxfax tfoot, #lkmlioxfax tr, #lkmlioxfax td, #lkmlioxfax th {
  border-style: none;
}

#lkmlioxfax p {
  margin: 0;
  padding: 0;
}

#lkmlioxfax .gt_table {
  display: table;
  border-collapse: collapse;
  line-height: normal;
  margin-left: auto;
  margin-right: auto;
  color: #333333;
  font-size: 16px;
  font-weight: normal;
  font-style: normal;
  background-color: #FFFFFF;
  width: auto;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #A8A8A8;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #A8A8A8;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
}

#lkmlioxfax .gt_caption {
  padding-top: 4px;
  padding-bottom: 4px;
}

#lkmlioxfax .gt_title {
  color: #333333;
  font-size: 125%;
  font-weight: initial;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-color: #FFFFFF;
  border-bottom-width: 0;
}

#lkmlioxfax .gt_subtitle {
  color: #333333;
  font-size: 85%;
  font-weight: initial;
  padding-top: 3px;
  padding-bottom: 5px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-color: #FFFFFF;
  border-top-width: 0;
}

#lkmlioxfax .gt_heading {
  background-color: #FFFFFF;
  text-align: center;
  border-bottom-color: #FFFFFF;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#lkmlioxfax .gt_bottom_border {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#lkmlioxfax .gt_col_headings {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#lkmlioxfax .gt_col_heading {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: normal;
  text-transform: inherit;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 6px;
  padding-left: 5px;
  padding-right: 5px;
  overflow-x: hidden;
}

#lkmlioxfax .gt_column_spanner_outer {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: normal;
  text-transform: inherit;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 4px;
  padding-right: 4px;
}

#lkmlioxfax .gt_column_spanner_outer:first-child {
  padding-left: 0;
}

#lkmlioxfax .gt_column_spanner_outer:last-child {
  padding-right: 0;
}

#lkmlioxfax .gt_column_spanner {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 5px;
  overflow-x: hidden;
  display: inline-block;
  width: 100%;
}

#lkmlioxfax .gt_spanner_row {
  border-bottom-style: hidden;
}

#lkmlioxfax .gt_group_heading {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  text-align: left;
}

#lkmlioxfax .gt_empty_group_heading {
  padding: 0.5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: middle;
}

#lkmlioxfax .gt_from_md &gt; :first-child {
  margin-top: 0;
}

#lkmlioxfax .gt_from_md &gt; :last-child {
  margin-bottom: 0;
}

#lkmlioxfax .gt_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  margin: 10px;
  border-top-style: solid;
  border-top-width: 1px;
  border-top-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  overflow-x: hidden;
}

#lkmlioxfax .gt_stub {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
}

#lkmlioxfax .gt_stub_row_group {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
  vertical-align: top;
}

#lkmlioxfax .gt_row_group_first td {
  border-top-width: 2px;
}

#lkmlioxfax .gt_row_group_first th {
  border-top-width: 2px;
}

#lkmlioxfax .gt_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#lkmlioxfax .gt_first_summary_row {
  border-top-style: solid;
  border-top-color: #D3D3D3;
}

#lkmlioxfax .gt_first_summary_row.thick {
  border-top-width: 2px;
}

#lkmlioxfax .gt_last_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#lkmlioxfax .gt_grand_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#lkmlioxfax .gt_first_grand_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-style: double;
  border-top-width: 6px;
  border-top-color: #D3D3D3;
}

#lkmlioxfax .gt_last_grand_summary_row_top {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: double;
  border-bottom-width: 6px;
  border-bottom-color: #D3D3D3;
}

#lkmlioxfax .gt_striped {
  background-color: rgba(128, 128, 128, 0.05);
}

#lkmlioxfax .gt_table_body {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#lkmlioxfax .gt_footnotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#lkmlioxfax .gt_footnote {
  margin: 0px;
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#lkmlioxfax .gt_sourcenotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#lkmlioxfax .gt_sourcenote {
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#lkmlioxfax .gt_left {
  text-align: left;
}

#lkmlioxfax .gt_center {
  text-align: center;
}

#lkmlioxfax .gt_right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#lkmlioxfax .gt_font_normal {
  font-weight: normal;
}

#lkmlioxfax .gt_font_bold {
  font-weight: bold;
}

#lkmlioxfax .gt_font_italic {
  font-style: italic;
}

#lkmlioxfax .gt_super {
  font-size: 65%;
}

#lkmlioxfax .gt_footnote_marks {
  font-size: 75%;
  vertical-align: 0.4em;
  position: initial;
}

#lkmlioxfax .gt_asterisk {
  font-size: 100%;
  vertical-align: 0;
}

#lkmlioxfax .gt_indent_1 {
  text-indent: 5px;
}

#lkmlioxfax .gt_indent_2 {
  text-indent: 10px;
}

#lkmlioxfax .gt_indent_3 {
  text-indent: 15px;
}

#lkmlioxfax .gt_indent_4 {
  text-indent: 20px;
}

#lkmlioxfax .gt_indent_5 {
  text-indent: 25px;
}

#lkmlioxfax .katex-display {
  display: inline-flex !important;
  margin-bottom: 0.75em !important;
}

#lkmlioxfax div.Reactable &gt; div.rt-table &gt; div.rt-thead &gt; div.rt-tr.rt-tr-group-header &gt; div.rt-th-group:after {
  height: 0px !important;
}
&lt;/style&gt;
&lt;table class=&#34;gt_table&#34; data-quarto-disable-processing=&#34;false&#34; data-quarto-bootstrap=&#34;false&#34;&gt;
  &lt;thead&gt;
    &lt;tr class=&#34;gt_col_headings&#34;&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_left&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;a::stub&#34;&gt;&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;mean&#34;&gt;mean&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;sd&#34;&gt;sd&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;q0.05&#34;&gt;q0.05&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;q0.25&#34;&gt;q0.25&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;q0.5&#34;&gt;q0.5&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;q0.75&#34;&gt;q0.75&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;q0.95&#34;&gt;q0.95&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody class=&#34;gt_table_body&#34;&gt;
    &lt;tr&gt;&lt;th id=&#34;stub_1_1&#34; scope=&#34;row&#34; class=&#34;gt_row gt_left gt_stub&#34;&gt;point&lt;/th&gt;
&lt;td headers=&#34;stub_1_1 mean&#34; class=&#34;gt_row gt_right&#34;&gt;2.8&lt;/td&gt;
&lt;td headers=&#34;stub_1_1 sd&#34; class=&#34;gt_row gt_right&#34;&gt;1.5&lt;/td&gt;
&lt;td headers=&#34;stub_1_1 q0.05&#34; class=&#34;gt_row gt_right&#34;&gt;0.4&lt;/td&gt;
&lt;td headers=&#34;stub_1_1 q0.25&#34; class=&#34;gt_row gt_right&#34;&gt;1.5&lt;/td&gt;
&lt;td headers=&#34;stub_1_1 q0.5&#34; class=&#34;gt_row gt_right&#34;&gt;2.8&lt;/td&gt;
&lt;td headers=&#34;stub_1_1 q0.75&#34; class=&#34;gt_row gt_right&#34;&gt;4.1&lt;/td&gt;
&lt;td headers=&#34;stub_1_1 q0.95&#34; class=&#34;gt_row gt_right&#34;&gt;5.2&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;th id=&#34;stub_1_2&#34; scope=&#34;row&#34; class=&#34;gt_row gt_left gt_stub&#34;&gt;se&lt;/th&gt;
&lt;td headers=&#34;stub_1_2 mean&#34; class=&#34;gt_row gt_right&#34;&gt;0.3&lt;/td&gt;
&lt;td headers=&#34;stub_1_2 sd&#34; class=&#34;gt_row gt_right&#34;&gt;0.1&lt;/td&gt;
&lt;td headers=&#34;stub_1_2 q0.05&#34; class=&#34;gt_row gt_right&#34;&gt;0.2&lt;/td&gt;
&lt;td headers=&#34;stub_1_2 q0.25&#34; class=&#34;gt_row gt_right&#34;&gt;0.4&lt;/td&gt;
&lt;td headers=&#34;stub_1_2 q0.5&#34; class=&#34;gt_row gt_right&#34;&gt;0.6&lt;/td&gt;
&lt;td headers=&#34;stub_1_2 q0.75&#34; class=&#34;gt_row gt_right&#34;&gt;0.4&lt;/td&gt;
&lt;td headers=&#34;stub_1_2 q0.95&#34; class=&#34;gt_row gt_right&#34;&gt;0.3&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;th id=&#34;stub_1_3&#34; scope=&#34;row&#34; class=&#34;gt_row gt_left gt_stub&#34;&gt;ci90l&lt;/th&gt;
&lt;td headers=&#34;stub_1_3 mean&#34; class=&#34;gt_row gt_right&#34;&gt;2.2&lt;/td&gt;
&lt;td headers=&#34;stub_1_3 sd&#34; class=&#34;gt_row gt_right&#34;&gt;1.3&lt;/td&gt;
&lt;td headers=&#34;stub_1_3 q0.05&#34; class=&#34;gt_row gt_right&#34;&gt;0.2&lt;/td&gt;
&lt;td headers=&#34;stub_1_3 q0.25&#34; class=&#34;gt_row gt_right&#34;&gt;1.1&lt;/td&gt;
&lt;td headers=&#34;stub_1_3 q0.5&#34; class=&#34;gt_row gt_right&#34;&gt;1.8&lt;/td&gt;
&lt;td headers=&#34;stub_1_3 q0.75&#34; class=&#34;gt_row gt_right&#34;&gt;3.2&lt;/td&gt;
&lt;td headers=&#34;stub_1_3 q0.95&#34; class=&#34;gt_row gt_right&#34;&gt;4.7&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;th id=&#34;stub_1_4&#34; scope=&#34;row&#34; class=&#34;gt_row gt_left gt_stub&#34;&gt;ci90r&lt;/th&gt;
&lt;td headers=&#34;stub_1_4 mean&#34; class=&#34;gt_row gt_right&#34;&gt;3.4&lt;/td&gt;
&lt;td headers=&#34;stub_1_4 sd&#34; class=&#34;gt_row gt_right&#34;&gt;1.7&lt;/td&gt;
&lt;td headers=&#34;stub_1_4 q0.05&#34; class=&#34;gt_row gt_right&#34;&gt;1.1&lt;/td&gt;
&lt;td headers=&#34;stub_1_4 q0.25&#34; class=&#34;gt_row gt_right&#34;&gt;2.2&lt;/td&gt;
&lt;td headers=&#34;stub_1_4 q0.5&#34; class=&#34;gt_row gt_right&#34;&gt;3.7&lt;/td&gt;
&lt;td headers=&#34;stub_1_4 q0.75&#34; class=&#34;gt_row gt_right&#34;&gt;4.6&lt;/td&gt;
&lt;td headers=&#34;stub_1_4 q0.95&#34; class=&#34;gt_row gt_right&#34;&gt;5.6&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;th id=&#34;stub_1_5&#34; scope=&#34;row&#34; class=&#34;gt_row gt_left gt_stub&#34;&gt;ci95l&lt;/th&gt;
&lt;td headers=&#34;stub_1_5 mean&#34; class=&#34;gt_row gt_right&#34;&gt;2.1&lt;/td&gt;
&lt;td headers=&#34;stub_1_5 sd&#34; class=&#34;gt_row gt_right&#34;&gt;1.2&lt;/td&gt;
&lt;td headers=&#34;stub_1_5 q0.05&#34; class=&#34;gt_row gt_right&#34;&gt;0.2&lt;/td&gt;
&lt;td headers=&#34;stub_1_5 q0.25&#34; class=&#34;gt_row gt_right&#34;&gt;1.0&lt;/td&gt;
&lt;td headers=&#34;stub_1_5 q0.5&#34; class=&#34;gt_row gt_right&#34;&gt;1.8&lt;/td&gt;
&lt;td headers=&#34;stub_1_5 q0.75&#34; class=&#34;gt_row gt_right&#34;&gt;3.0&lt;/td&gt;
&lt;td headers=&#34;stub_1_5 q0.95&#34; class=&#34;gt_row gt_right&#34;&gt;4.6&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;th id=&#34;stub_1_6&#34; scope=&#34;row&#34; class=&#34;gt_row gt_left gt_stub&#34;&gt;ci95r&lt;/th&gt;
&lt;td headers=&#34;stub_1_6 mean&#34; class=&#34;gt_row gt_right&#34;&gt;3.5&lt;/td&gt;
&lt;td headers=&#34;stub_1_6 sd&#34; class=&#34;gt_row gt_right&#34;&gt;1.7&lt;/td&gt;
&lt;td headers=&#34;stub_1_6 q0.05&#34; class=&#34;gt_row gt_right&#34;&gt;1.1&lt;/td&gt;
&lt;td headers=&#34;stub_1_6 q0.25&#34; class=&#34;gt_row gt_right&#34;&gt;2.5&lt;/td&gt;
&lt;td headers=&#34;stub_1_6 q0.5&#34; class=&#34;gt_row gt_right&#34;&gt;3.8&lt;/td&gt;
&lt;td headers=&#34;stub_1_6 q0.75&#34; class=&#34;gt_row gt_right&#34;&gt;4.7&lt;/td&gt;
&lt;td headers=&#34;stub_1_6 q0.95&#34; class=&#34;gt_row gt_right&#34;&gt;5.7&lt;/td&gt;&lt;/tr&gt;
  &lt;/tbody&gt;
  
  
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;Interested readers can find more real data examples in &lt;a href=&#34;https://doi.org/10.1371/journal.pcbi.1013338&#34;&gt;Gressani and Hens (2025)&lt;/a&gt; and learn about the strengths and limitations of this new nonparametric methodology for serial interval estimation.&lt;/p&gt;
&lt;div id=&#34;references&#34; class=&#34;section level3&#34;&gt;
&lt;h3&gt;References&lt;/h3&gt;
&lt;p&gt;Gressani, O. and Hens, N. (2025). Nonparametric serial interval estimation with uniform mixtures.
&lt;em&gt;PLoS Computational Biology&lt;/em&gt; &lt;strong&gt;21&lt;/strong&gt;(8):e101338. &lt;a href=&#34;https://doi.org/10.1371/journal.pcbi.1013338&#34; class=&#34;uri&#34;&gt;https://doi.org/10.1371/journal.pcbi.1013338&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Gressani; O. (2025). EpiDelays: A Software for Estimation of Epidemiological Delays (version 0.0.1). &lt;a href=&#34;https://github.com/oswaldogressani/EpiDelays&#34; class=&#34;uri&#34;&gt;https://github.com/oswaldogressani/EpiDelays&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Lessler, J., Reich, N. G., Cummings, D. A., and the New York City Department of Health and Mental Hygiene Swine Influenza Investigation Team. (2009). Outbreak of 2009 pandemic influenza A (H1N1) at a New York City school. &lt;em&gt;New England Journal of Medicine&lt;/em&gt; &lt;strong&gt;361&lt;/strong&gt;(27), 2628-2636. &lt;a href=&#34;https://www.nejm.org/doi/full/10.1056/NEJMoa0906089&#34; class=&#34;uri&#34;&gt;https://www.nejm.org/doi/full/10.1056/NEJMoa0906089&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
</description>
    </item>
    
    <item>
      <title>EpiLPS for estimation of incubation times</title>
      <link>https://statsandr.com/blog/epilps-for-estimation-of-incubation-times/</link>
      <pubDate>Thu, 01 Aug 2024 00:00:00 +0000</pubDate>
      
      <guid>https://statsandr.com/blog/epilps-for-estimation-of-incubation-times/</guid>
      <description>

&lt;div id=&#34;TOC&#34;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#motivation&#34; id=&#34;toc-motivation&#34;&gt;Motivation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#coarse-data&#34; id=&#34;toc-coarse-data&#34;&gt;Coarse data&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#simulated-example&#34; id=&#34;toc-simulated-example&#34;&gt;Simulated example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#real-data-example&#34; id=&#34;toc-real-data-example&#34;&gt;Real data example&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#references&#34; id=&#34;toc-references&#34;&gt;References&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

&lt;div id=&#34;motivation&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Motivation&lt;/h1&gt;
&lt;p&gt;A group of researchers from the Data Science Institute (DSI) at Hasselt University developed a new statistical model to estimate the incubation period of a pathogenic organism based on coarse data. The incubation period of an infectious disease (defined as the time elapsed between infection and the manifestation of first symptoms) is of great importance as it permits to shed light on the epidemic potential of a disease and to optimize the length of quarantine periods to freeze transmission. The article &lt;a href=&#34;https://doi.org/10.1093/aje/kwae192&#34;&gt;(Gressani et al. 2024)&lt;/a&gt; was recently published in the &lt;em&gt;American Journal of Epidemiology&lt;/em&gt; with practical implementation of the methodology accessible through the &lt;a href=&#34;https://statsandr.com/blog/paper-epilps-a-fast-and-flexible-bayesian-tool-for-estimation-of-the-time-varying-reproduction-number/&#34;&gt;EpiLPS package&lt;/a&gt; &lt;a href=&#34;https://doi.org/10.1371/journal.pcbi.1010618&#34;&gt;(Gressani et al. 2022)&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;coarse-data&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Coarse data&lt;/h1&gt;
&lt;p&gt;What makes estimation of incubation times so challenging in the first place? The devil lies in the data. True infection times are stealthy and rarely observed. In information-theoretic jargon this phenomenon is called “imperfect information’’ but statisticians prefer to call it censoring. To be more precise, infection times are interval censored, i.e. one part of the collected data contains exposure intervals &lt;span class=&#34;math inline&#34;&gt;\(\mathcal{E}=[t^{E_L},t^{E_R}]\)&lt;/span&gt; reported by individuals that are part of the study, where &lt;span class=&#34;math inline&#34;&gt;\(t^{E_L}\)&lt;/span&gt; and &lt;span class=&#34;math inline&#34;&gt;\(t^{E_R}\)&lt;/span&gt; stand for the left and right bound, respectively, of the exposure window. The other part of the data contains symptom onset times &lt;span class=&#34;math inline&#34;&gt;\(t^{\mathcal{S}}\)&lt;/span&gt;. This is a more easily accessible piece of information -people tend to remember the day when first symptoms appeared- and so the timing of symptom onset is assumed to be exactly observed. Subtracting the exposure bounds from the symptom onset time, one obtains the incubation interval &lt;span class=&#34;math inline&#34;&gt;\(\mathcal{I}=[t^{\mathcal{I}_L}, t^{\mathcal{I}_R}]\)&lt;/span&gt; with lower bound &lt;span class=&#34;math inline&#34;&gt;\(t^{\mathcal{I}_L}=t^{\mathcal{S}}-t^{E_R}\)&lt;/span&gt; and upper bound &lt;span class=&#34;math inline&#34;&gt;\(t^{\mathcal{I}_R}=t^{\mathcal{S}}-t^{E_L}\)&lt;/span&gt;, characterizing the coarse data structure which will be the main model input.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;simulated-example&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Simulated example&lt;/h1&gt;
&lt;p&gt;In EpiLPS, the &lt;code&gt;estimIncub()&lt;/code&gt; routine is designed to compute an estimate of the incubation density based on the methodology of &lt;a href=&#34;https://doi.org/10.1093/aje/kwae192&#34;&gt;Gressani et al. (2024)&lt;/a&gt;. Giving a detailed account of the methodology would be out of scope for this blog and the reader is redirected to the article for technicalities. In a nutshell, it is a Bayesian approach making use of (penalized) B-splines, Laplace approximations and Markov chain Monte Carlo (MCMC) methods to derive a semi-parametric estimate of the incubation density. An attractive feature of the &lt;code&gt;estimIncub()&lt;/code&gt; routine for the end-user is the minimalistic input it requires to work, namely:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;x&lt;/code&gt;: A data frame containing the lower and upper bound of the incubation interval.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;K&lt;/code&gt;: An integer specifying the number of B-splines to smooth the incubation density.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;niter&lt;/code&gt;: The number of MCMC samples required.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In practice, only the data frame &lt;code&gt;x&lt;/code&gt; is required as the remaining inputs are assigned default values. Computationally, the routine requires a small amount of resources as costly subroutines are coded in C++ and integrated in R via the Rcpp package. The structure of &lt;code&gt;x&lt;/code&gt; is quite simple. It should be a data frame with two columns containing the left bound &lt;span class=&#34;math inline&#34;&gt;\(t^{\mathcal{I}_L}\)&lt;/span&gt; of the incubation interval (in the first column) and the right bound &lt;span class=&#34;math inline&#34;&gt;\(t^{\mathcal{I}_R}\)&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Let’s start with a simple example where &lt;code&gt;x&lt;/code&gt; is simulated based on a data generating mechanism assuming a known incubation distribution. This can be achieved with the &lt;code&gt;incubsim()&lt;/code&gt; routine in EpiLPS. We choose &lt;code&gt;x&lt;/code&gt; to be generated according to a Lognormal incubation distribution with a mean of 5.5 days and a standard deviation of 2.1 days following &lt;a href=&#34;https://doi.org/10.1126/science.abb6936&#34;&gt;Ferretti et al. (2020)&lt;/a&gt;. Simulation of &lt;span class=&#34;math inline&#34;&gt;\(n=40\)&lt;/span&gt; observations with an average exposure window of 2 days is implemented as follows:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;set.seed(2024)
simdat &amp;lt;- incubsim(incubdist = &amp;quot;LogNormal&amp;quot;, n = 40, coarseness = 2)
gt(head(simdat$Dobsincub, 5))&lt;/code&gt;&lt;/pre&gt;
&lt;div id=&#34;kocanygkly&#34; style=&#34;padding-left:0px;padding-right:0px;padding-top:10px;padding-bottom:10px;overflow-x:auto;overflow-y:auto;width:auto;height:auto;&#34;&gt;
&lt;style&gt;#kocanygkly table {
  font-family: system-ui, &#39;Segoe UI&#39;, Roboto, Helvetica, Arial, sans-serif, &#39;Apple Color Emoji&#39;, &#39;Segoe UI Emoji&#39;, &#39;Segoe UI Symbol&#39;, &#39;Noto Color Emoji&#39;;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#kocanygkly thead, #kocanygkly tbody, #kocanygkly tfoot, #kocanygkly tr, #kocanygkly td, #kocanygkly th {
  border-style: none;
}

#kocanygkly p {
  margin: 0;
  padding: 0;
}

#kocanygkly .gt_table {
  display: table;
  border-collapse: collapse;
  line-height: normal;
  margin-left: auto;
  margin-right: auto;
  color: #333333;
  font-size: 16px;
  font-weight: normal;
  font-style: normal;
  background-color: #FFFFFF;
  width: auto;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #A8A8A8;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #A8A8A8;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
}

#kocanygkly .gt_caption {
  padding-top: 4px;
  padding-bottom: 4px;
}

#kocanygkly .gt_title {
  color: #333333;
  font-size: 125%;
  font-weight: initial;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-color: #FFFFFF;
  border-bottom-width: 0;
}

#kocanygkly .gt_subtitle {
  color: #333333;
  font-size: 85%;
  font-weight: initial;
  padding-top: 3px;
  padding-bottom: 5px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-color: #FFFFFF;
  border-top-width: 0;
}

#kocanygkly .gt_heading {
  background-color: #FFFFFF;
  text-align: center;
  border-bottom-color: #FFFFFF;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#kocanygkly .gt_bottom_border {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#kocanygkly .gt_col_headings {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
}

#kocanygkly .gt_col_heading {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: normal;
  text-transform: inherit;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 6px;
  padding-left: 5px;
  padding-right: 5px;
  overflow-x: hidden;
}

#kocanygkly .gt_column_spanner_outer {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: normal;
  text-transform: inherit;
  padding-top: 0;
  padding-bottom: 0;
  padding-left: 4px;
  padding-right: 4px;
}

#kocanygkly .gt_column_spanner_outer:first-child {
  padding-left: 0;
}

#kocanygkly .gt_column_spanner_outer:last-child {
  padding-right: 0;
}

#kocanygkly .gt_column_spanner {
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: bottom;
  padding-top: 5px;
  padding-bottom: 5px;
  overflow-x: hidden;
  display: inline-block;
  width: 100%;
}

#kocanygkly .gt_spanner_row {
  border-bottom-style: hidden;
}

#kocanygkly .gt_group_heading {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  text-align: left;
}

#kocanygkly .gt_empty_group_heading {
  padding: 0.5px;
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  vertical-align: middle;
}

#kocanygkly .gt_from_md &gt; :first-child {
  margin-top: 0;
}

#kocanygkly .gt_from_md &gt; :last-child {
  margin-bottom: 0;
}

#kocanygkly .gt_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  margin: 10px;
  border-top-style: solid;
  border-top-width: 1px;
  border-top-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 1px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 1px;
  border-right-color: #D3D3D3;
  vertical-align: middle;
  overflow-x: hidden;
}

#kocanygkly .gt_stub {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
}

#kocanygkly .gt_stub_row_group {
  color: #333333;
  background-color: #FFFFFF;
  font-size: 100%;
  font-weight: initial;
  text-transform: inherit;
  border-right-style: solid;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
  padding-left: 5px;
  padding-right: 5px;
  vertical-align: top;
}

#kocanygkly .gt_row_group_first td {
  border-top-width: 2px;
}

#kocanygkly .gt_row_group_first th {
  border-top-width: 2px;
}

#kocanygkly .gt_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#kocanygkly .gt_first_summary_row {
  border-top-style: solid;
  border-top-color: #D3D3D3;
}

#kocanygkly .gt_first_summary_row.thick {
  border-top-width: 2px;
}

#kocanygkly .gt_last_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#kocanygkly .gt_grand_summary_row {
  color: #333333;
  background-color: #FFFFFF;
  text-transform: inherit;
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
}

#kocanygkly .gt_first_grand_summary_row {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-top-style: double;
  border-top-width: 6px;
  border-top-color: #D3D3D3;
}

#kocanygkly .gt_last_grand_summary_row_top {
  padding-top: 8px;
  padding-bottom: 8px;
  padding-left: 5px;
  padding-right: 5px;
  border-bottom-style: double;
  border-bottom-width: 6px;
  border-bottom-color: #D3D3D3;
}

#kocanygkly .gt_striped {
  background-color: rgba(128, 128, 128, 0.05);
}

#kocanygkly .gt_table_body {
  border-top-style: solid;
  border-top-width: 2px;
  border-top-color: #D3D3D3;
  border-bottom-style: solid;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
}

#kocanygkly .gt_footnotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#kocanygkly .gt_footnote {
  margin: 0px;
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#kocanygkly .gt_sourcenotes {
  color: #333333;
  background-color: #FFFFFF;
  border-bottom-style: none;
  border-bottom-width: 2px;
  border-bottom-color: #D3D3D3;
  border-left-style: none;
  border-left-width: 2px;
  border-left-color: #D3D3D3;
  border-right-style: none;
  border-right-width: 2px;
  border-right-color: #D3D3D3;
}

#kocanygkly .gt_sourcenote {
  font-size: 90%;
  padding-top: 4px;
  padding-bottom: 4px;
  padding-left: 5px;
  padding-right: 5px;
}

#kocanygkly .gt_left {
  text-align: left;
}

#kocanygkly .gt_center {
  text-align: center;
}

#kocanygkly .gt_right {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#kocanygkly .gt_font_normal {
  font-weight: normal;
}

#kocanygkly .gt_font_bold {
  font-weight: bold;
}

#kocanygkly .gt_font_italic {
  font-style: italic;
}

#kocanygkly .gt_super {
  font-size: 65%;
}

#kocanygkly .gt_footnote_marks {
  font-size: 75%;
  vertical-align: 0.4em;
  position: initial;
}

#kocanygkly .gt_asterisk {
  font-size: 100%;
  vertical-align: 0;
}

#kocanygkly .gt_indent_1 {
  text-indent: 5px;
}

#kocanygkly .gt_indent_2 {
  text-indent: 10px;
}

#kocanygkly .gt_indent_3 {
  text-indent: 15px;
}

#kocanygkly .gt_indent_4 {
  text-indent: 20px;
}

#kocanygkly .gt_indent_5 {
  text-indent: 25px;
}
&lt;/style&gt;
&lt;table class=&#34;gt_table&#34; data-quarto-disable-processing=&#34;false&#34; data-quarto-bootstrap=&#34;false&#34;&gt;
  &lt;thead&gt;
    &lt;tr class=&#34;gt_col_headings&#34;&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;tL&#34;&gt;tL&lt;/th&gt;
      &lt;th class=&#34;gt_col_heading gt_columns_bottom_border gt_right&#34; rowspan=&#34;1&#34; colspan=&#34;1&#34; scope=&#34;col&#34; id=&#34;tR&#34;&gt;tR&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody class=&#34;gt_table_body&#34;&gt;
    &lt;tr&gt;&lt;td headers=&#34;tL&#34; class=&#34;gt_row gt_right&#34;&gt;3.724500&lt;/td&gt;
&lt;td headers=&#34;tR&#34; class=&#34;gt_row gt_right&#34;&gt;5.510304&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;tL&#34; class=&#34;gt_row gt_right&#34;&gt;4.381377&lt;/td&gt;
&lt;td headers=&#34;tR&#34; class=&#34;gt_row gt_right&#34;&gt;6.654224&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;tL&#34; class=&#34;gt_row gt_right&#34;&gt;4.588020&lt;/td&gt;
&lt;td headers=&#34;tR&#34; class=&#34;gt_row gt_right&#34;&gt;5.483614&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;tL&#34; class=&#34;gt_row gt_right&#34;&gt;3.847835&lt;/td&gt;
&lt;td headers=&#34;tR&#34; class=&#34;gt_row gt_right&#34;&gt;6.003948&lt;/td&gt;&lt;/tr&gt;
    &lt;tr&gt;&lt;td headers=&#34;tL&#34; class=&#34;gt_row gt_right&#34;&gt;3.522282&lt;/td&gt;
&lt;td headers=&#34;tR&#34; class=&#34;gt_row gt_right&#34;&gt;5.033487&lt;/td&gt;&lt;/tr&gt;
  &lt;/tbody&gt;
  
  
&lt;/table&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;By typing &lt;code&gt;simdat$Dobsincub&lt;/code&gt;, the user has access to the generated incubation intervals (expressed in days), corresponding here to a data frame with two columns and &lt;span class=&#34;math inline&#34;&gt;\(n=40\)&lt;/span&gt; rows. This is the data frame that is injected in the &lt;code&gt;estimIncub()&lt;/code&gt; routine:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;fit &amp;lt;- estimIncub(x = simdat$Dobsincub, verbose = TRUE)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## ----------------------------------------------------------------
## Time elapsed: 1.339 seconds.
## Fitted density is Log-Normal with meanlog=1.617 and sdlog=0.317.
## Mean incubation period (days): 5.298 with 95% CI: 5.086-5.615.
## 95th percentile (days): 8.484 with 95% CI: 8.121-9.089.
## ----------------------------------------------------------------&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The output in the R console can easily be interpreted. It tells us that the model chooses a Lognormal density fit for the incubation period with a mean of 5.3 days (95% CI: 5.0-5.6 days). More detailed summary statistics are accessible by typing &lt;code&gt;fit$stats&lt;/code&gt;, such as the posterior standard deviation and additional percentiles. What happens under the hood? Basically, the model computes a semi-parametric fit to the data and compares it with classic parametric fits (Lognormal, Weibull and Gamma) used for incubation modeling. The candidate with the lowest Bayesian information criterion (BIC) wins the game and is finally selected (here the Lognormal distribution). The incubation windows and the fitted incubation density can be obtained by typing:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;grid.arrange(plot(fit, typ = &amp;quot;incubwin&amp;quot;), plot(fit, type = &amp;quot;pdf&amp;quot;), nrow = 1)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;https://statsandr.com/blog/epilps-for-estimation-of-incubation-times/index_files/figure-html/estimincubation-2-1.png&#34; width=&#34;100%&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;real-data-example&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Real data example&lt;/h1&gt;
&lt;p&gt;The flexible Bayesian methodology is illustrated on SARS-CoV-2 symptom onset and exposure window data extracted from cases in Vietnam. The dataset was analyzed in &lt;a href=&#34;https://doi.org/10.1371/journal.pone.0243889&#34;&gt;Bui et al. (2020)&lt;/a&gt; and is publicly available on the GitHub repository provided in the article (&lt;a href=&#34;https://github.com/longbui/Covid19IncubVN&#34; class=&#34;uri&#34;&gt;https://github.com/longbui/Covid19IncubVN&lt;/a&gt;; last accessed July 17, 2024). The dataset contains information about &lt;span class=&#34;math inline&#34;&gt;\(n=19\)&lt;/span&gt; cases identified from January 23, 2020 to April 13, 2020. After continuity corrections (required to change calendar dates into continuous time points), the left and right incubation bounds are given by:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;# Left incubation bound
tL &amp;lt;- c(0.504, 2.983, 5.343, 6.969, 6.990, 2.570, 6.870, 1.263, 0.693, 1.869, 1.151, 2.748, 1.209, 1.161, 4.982, 4.017, 2.170, 9.805, 1.659)

# Right incubation bound
tR &amp;lt;- c(1.491, 7.762, 11.777, 12.821, 11.359, 8.551, 24.954, 4.144, 6.408, 7.083, 4.191, 10.326, 9.942, 7.254, 12.690, 10.825, 14.478, 16.592, 18.649)

# Data set
dataVietnam &amp;lt;- data.frame(tL = tL, tR = tR)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;estimIncub()&lt;/code&gt; routine provides a Weibull fit with a mean incubation period of 6.7 days (95% CI: 5.8-7.4 days) and the standard deviation (extracted by typing &lt;code&gt;incubfit$stats&lt;/code&gt;) is 3.3 days (95% CI: 3.0-3.8 days). A figure of the incubation windows and the fitted Weibull density (with 95% credible interval) is also provided.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;set.seed(2024)
incubfit &amp;lt;- EpiLPS::estimIncub(x = dataVietnam, verbose = TRUE, tmax = 25)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## ----------------------------------------------------------------
## Time elapsed: 1.13 seconds.
## Fitted density is Weibull with shape=2.142 and scale=7.521.
## Mean incubation period (days): 6.661 with 95% CI: 5.753-7.375.
## 95th percentile (days): 12.552 with 95% CI: 11.931-14.087.
## ----------------------------------------------------------------&lt;/code&gt;&lt;/pre&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;grid.arrange(plot(incubfit, typ = &amp;quot;incubwin&amp;quot;), plot(incubfit, type = &amp;quot;pdf&amp;quot;), nrow = 1)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;img src=&#34;https://statsandr.com/blog/epilps-for-estimation-of-incubation-times/index_files/figure-html/RealData-3-1.png&#34; width=&#34;100%&#34; style=&#34;display: block; margin: auto;&#34; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;references&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;References&lt;/h1&gt;
&lt;p&gt;Gressani, O., Torneri, A., Hens, N. and Faes, C. (2024). Flexible Bayesian estimation of incubation times. &lt;em&gt;American Journal of Epidemiology&lt;/em&gt; (Accepted manuscript). &lt;a href=&#34;https://doi.org/10.1093/aje/kwae192&#34; class=&#34;uri&#34;&gt;https://doi.org/10.1093/aje/kwae192&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Gressani, O., Wallinga, J., Althaus, C. L., Hens, N. and Faes, C.
(2022). EpiLPS: A fast and flexible Bayesian tool for estimation of the
time-varying reproduction number. &lt;em&gt;PLoS Comput Biol&lt;/em&gt; &lt;strong&gt;18&lt;/strong&gt;(10):
e1010618. &lt;a href=&#34;https://doi.org/10.1371/journal.pcbi.1010618&#34; class=&#34;uri&#34;&gt;https://doi.org/10.1371/journal.pcbi.1010618&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Eddelbuettel, D. and Francois, R. (2011). Rcpp: Seamless R and C++ Integration. &lt;em&gt;Journal of Statistical Software&lt;/em&gt;, &lt;strong&gt;40&lt;/strong&gt;(8), 1–18. &lt;a href=&#34;https://doi.org/10.18637/jss.v040.i08&#34; class=&#34;uri&#34;&gt;https://doi.org/10.18637/jss.v040.i08&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Ferretti, L. et al. (2020). Quantifying SARS-CoV-2 transmission suggests epidemic control with
digital contact tracing. &lt;em&gt;Science&lt;/em&gt; &lt;strong&gt;368&lt;/strong&gt;, eabb6936. &lt;a href=&#34;https://doi.org/10.1126/science.abb6936&#34; class=&#34;uri&#34;&gt;https://doi.org/10.1126/science.abb6936&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Bui LV, Nguyen HT, Levine H, Nguyen HN, Nguyen T-A, Nguyen TP, et al. (2020) Estimation of the incubation period of COVID-19 in Vietnam. &lt;em&gt;PLoS ONE&lt;/em&gt; &lt;strong&gt;15&lt;/strong&gt;(12): e0243889. &lt;a href=&#34;https://doi.org/10.1371/journal.pone.0243889&#34; class=&#34;uri&#34;&gt;https://doi.org/10.1371/journal.pone.0243889&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
</description>
    </item>
    
    <item>
      <title>Scrape Yahoo search engine results with R</title>
      <link>https://statsandr.com/blog/scrape-yahoo-search-engine-results-with-r/</link>
      <pubDate>Thu, 24 Aug 2023 00:00:00 +0000</pubDate>
      
      <guid>https://statsandr.com/blog/scrape-yahoo-search-engine-results-with-r/</guid>
      <description>

&lt;div id=&#34;TOC&#34;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;#introduction&#34; id=&#34;toc-introduction&#34;&gt;Introduction&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#scraping-yahoo-search-engine-results-with-r&#34; id=&#34;toc-scraping-yahoo-search-engine-results-with-r&#34;&gt;Scraping Yahoo search engine results with R&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;#conclusion&#34; id=&#34;toc-conclusion&#34;&gt;Conclusion&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

&lt;p&gt;&lt;img src=&#34;images/Scrape-Yahoo-search-engine-results-with-R-statsandr.jpeg&#34; style=&#34;width:100.0%&#34; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note: This is a guest post by Manthan Koolwal, founder of Scrapingdog.&lt;/em&gt;&lt;/p&gt;
&lt;div id=&#34;introduction&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Introduction&lt;/h1&gt;
&lt;p&gt;Web scraping is the process of extracting data from websites. It is usually done in an automated manner to obtain large amounts of data through various websites, without the need to gather data by hand.&lt;/p&gt;
&lt;p&gt;In a &lt;a href=&#34;https://statsandr.com/blog/web-scraping-in-r/&#34;&gt;previous post&lt;/a&gt;, we introduced this method and illustrated it with a Wikipedia page. Although there are a lot of &lt;a href=&#34;https://www.scrapingdog.com/blog/web-scraping-use-cases/&#34; target=&#34;_blank&#34;&gt;use cases of web scraping&lt;/a&gt;, in this blog post, we are restricting ourselves to scraping search results from Yahoo using R. Scraping search engine results can help you with SEO analysis, competitor analysis, keyword research, trend analysis, etc.&lt;/p&gt;
&lt;/div&gt;
&lt;div id=&#34;scraping-yahoo-search-engine-results-with-r&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Scraping Yahoo search engine results with R&lt;/h1&gt;
&lt;p&gt;After &lt;a href=&#34;https://statsandr.com/blog/how-to-install-r-and-rstudio/&#34;&gt;installing R and RStudio&lt;/a&gt;, we first need to load the necessary packages by running the following commands:&lt;a href=&#34;#fn1&#34; class=&#34;footnote-ref&#34; id=&#34;fnref1&#34;&gt;&lt;sup&gt;1&lt;/sup&gt;&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;# install.packages(&amp;quot;rvest&amp;quot;)
# install.packages(&amp;quot;jsonlite&amp;quot;)
# install.packages(&amp;quot;purrr&amp;quot;)

library(rvest)
library(jsonlite)
library(purrr)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;code&gt;{rvest}&lt;/code&gt; package is for web scraping, the &lt;code&gt;{jsonlite}&lt;/code&gt; package is for working with JSON data and the &lt;code&gt;{purrr}&lt;/code&gt; package is for working with functions and vectors.&lt;/p&gt;
&lt;p&gt;It is always better to decide in advance what exactly we are going to scrape. For this tutorial, we are going to scrape search results from this &lt;a href=&#34;https://search.yahoo.com/search?p=pizza&#34; target=&#34;_blank&#34;&gt;URL&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;img src=&#34;images/Scrape-Yahoo-search-engine-results-with-R-statsandr_2.png&#34; style=&#34;width:100.0%&#34; /&gt;&lt;/p&gt;
&lt;p&gt;We are going to scrape the following data points from this page:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Link&lt;/li&gt;
&lt;li&gt;Title&lt;/li&gt;
&lt;li&gt;Description&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For this, we define the URL of the Yahoo search results page that we want to scrape. In this case, we are searching for the word “pizza”.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;# URL of the Yahoo search results page
url &amp;lt;- &amp;quot;https://search.yahoo.com/search?p=pizza&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We then use the &lt;code&gt;read_html()&lt;/code&gt; function from the &lt;code&gt;{rvest}&lt;/code&gt; package to read the HTML content of the provided URL:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;# Read the HTML content of the page
page &amp;lt;- read_html(url)&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This creates an HTML document object that we can work with:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;str(page)&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## List of 2
##  $ node:&amp;lt;externalptr&amp;gt; 
##  $ doc :&amp;lt;externalptr&amp;gt; 
##  - attr(*, &amp;quot;class&amp;quot;)= chr [1:2] &amp;quot;xml_document&amp;quot; &amp;quot;xml_node&amp;quot;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Here’s where we start the process of extracting the search results:&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;# Extract search results
results &amp;lt;- page %&amp;gt;%
  html_nodes(&amp;quot;.algo-sr&amp;quot;) %&amp;gt;% # Selector for search result elements
  html_nodes(&amp;quot;a&amp;quot;) %&amp;gt;% # Select the &amp;lt;a&amp;gt; elements within the search results
  # Extract link, title, and description attributes
  map_df(~ data.frame(
    link = .x %&amp;gt;% html_attr(&amp;quot;href&amp;quot;),
    title = .x %&amp;gt;% html_text(),
    description = .x %&amp;gt;% html_attr(&amp;quot;title&amp;quot;),
    stringsAsFactors = FALSE
  ))&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the code above:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We use &lt;code&gt;%&amp;gt;%&lt;/code&gt; (pipe operator) to chain multiple operations together for clarity.&lt;/li&gt;
&lt;li&gt;First, we use &lt;code&gt;html_nodes(&#34;.algo-sr&#34;)&lt;/code&gt; to select the search result elements with the class &lt;code&gt;.algo-sr&lt;/code&gt;. These elements contain the links to the search results.&lt;/li&gt;
&lt;li&gt;Within each search result element, we further select the &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; elements using &lt;code&gt;html_nodes(&#34;a&#34;)&lt;/code&gt;. These &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; elements contain the link, title, and description information.&lt;/li&gt;
&lt;li&gt;Using &lt;code&gt;map_df()&lt;/code&gt;, we iterate through each &lt;code&gt;&amp;lt;a&amp;gt;&lt;/code&gt; element and extract the link, title, and description attributes.&lt;/li&gt;
&lt;li&gt;We create a data frame with these attributes for each search result.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Finally, we convert the results data frame into JSON format using the &lt;code&gt;toJSON()&lt;/code&gt; function from the &lt;code&gt;{jsonlite}&lt;/code&gt; package. The &lt;code&gt;pretty = TRUE&lt;/code&gt; argument adds indentation for better readability. We use &lt;code&gt;cat()&lt;/code&gt; to print the JSON-formatted results to the console.&lt;/p&gt;
&lt;pre class=&#34;r&#34;&gt;&lt;code&gt;# Print the results in JSON format
cat(toJSON(results, pretty = TRUE))&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;## [
##   {
##     &amp;quot;link&amp;quot;: &amp;quot;https://r.search.yahoo.com/_ylt=AwrEteLKS0ZqawIASPJXNyoA;_ylu=Y29sbwNiZjEEcG9zAzEEdnRpZAMEc2VjA3Ny/RV=2/RE=1784201418/RO=10/RU=https%3a%2f%2fwww.yelp.com%2fsearch%3ffind_desc%3dpizza%26find_loc%3dBrussels%252C%2bR%25C3%25A9gion%2bde%2bBruxelles-Capitale/RK=2/RS=xW.v1O1REkKKLsO7DRIWoIGq4bA-&amp;quot;,
##     &amp;quot;title&amp;quot;: &amp;quot;yelp.comhttps://www.yelp.com › searchTop 10 Best pizza Near Brussels, Région de Bruxelles-Capitale&amp;quot;
##   },
##   {
##     &amp;quot;link&amp;quot;: &amp;quot;https://r.search.yahoo.com/_ylt=AwrEteLKS0ZqawIASfJXNyoA;_ylu=Y29sbwNiZjEEcG9zAzIEdnRpZAMEc2VjA3Ny/RV=2/RE=1784201418/RO=10/RU=https%3a%2f%2fwww.yelp.com%2fsearch%3fcflt%3dpizza%26find_loc%3dBrussels%252C%2bR%25C3%25A9gion%2bde%2bBruxelles-Capitale/RK=2/RS=zynV6ypY6PoaPj4cg5yD9a1x.LU-&amp;quot;,
##     &amp;quot;title&amp;quot;: &amp;quot;yelp.comhttps://www.yelp.com › searchTHE BEST 10 PIZZA PLACES IN BRUSSELS, RÉGION DE ... - Yelp&amp;quot;
##   },
##   {
##     &amp;quot;link&amp;quot;: &amp;quot;https://r.search.yahoo.com/_ylt=AwrEteLKS0ZqawIASvJXNyoA;_ylu=Y29sbwNiZjEEcG9zAzMEdnRpZAMEc2VjA3Ny/RV=2/RE=1784201418/RO=10/RU=https%3a%2f%2fwww.dominos.com%2fen/RK=2/RS=darBKTs8REd78kRRFhZb8jRT4jY-&amp;quot;,
##     &amp;quot;title&amp;quot;: &amp;quot;Domino&amp;#39;shttps://www.dominos.com › enPizza Delivery &amp;amp; Carryout, Pasta, Chicken &amp;amp; More | Domino&amp;#39;s&amp;quot;
##   },
##   {
##     &amp;quot;link&amp;quot;: &amp;quot;https://r.search.yahoo.com/_ylt=AwrEteLKS0ZqawIAS_JXNyoA;_ylu=Y29sbwNiZjEEcG9zAzMEdnRpZAMEc2VjA3Ny/RV=2/RE=1784201418/RO=10/RU=https%3a%2f%2fwww.bing.com%2fimages%2fsearch%3fview%3ddetailV2%26ccid%3ds2TCGJY8%26id%3d7236CCFBE7C0B5849BA9DE100BE4F1F32FCD231D%26thid%3dOIP.s2TCGJY8bjV7G5kps1FEwQHaHa%26mediaurl%3dhttps%3a%2f%2fwww.dominos.com%2fstatic%2f1.98.1%2fimages%2ftiles%2fmixAndMatchDeal%2fhero.webp%26exph%3d530%26expw%3d530%26q%3dpizza%26ck%3d8B813BA6312D3F558421CB691D0C6657%26idpp%3drc%26idpview%3dsingleimage%26form%3drc2idp/RK=2/RS=xsbqmguwIFBhAOzGrm.qrjLykcA-&amp;quot;,
##     &amp;quot;title&amp;quot;: &amp;quot;&amp;quot;
##   },
##   {
##     &amp;quot;link&amp;quot;: &amp;quot;https://r.search.yahoo.com/_ylt=AwrEteLKS0ZqawIATPJXNyoA;_ylu=Y29sbwNiZjEEcG9zAzMEdnRpZAMEc2VjA3Ny/RV=2/RE=1784201418/RO=10/RU=https%3a%2f%2fwww.bing.com%2fimages%2fsearch%3fview%3ddetailV2%26ccid%3d%2f6Qs28Cq%26id%3d7236CCFBE7C0B5849BA9E9CE4472C5692CE3F420%26thid%3dOIP._6Qs28CqWWCt4S-yapYAXwHaHa%26mediaurl%3dhttps%3a%2f%2fwww.dominos.com%2fstatic%2f1.116.0%2fimages%2ftiles%2fmixAndMatchDealPSC%2fhero.webp%26exph%3d530%26expw%3d530%26q%3dpizza%26ck%3d758519383F5F3AF0EA83707449E54C87%26idpp%3drc%26idpview%3dsingleimage%26form%3drc2idp/RK=2/RS=UHqcKBQXuq8AtTptzc.7rkut3rY-&amp;quot;,
##     &amp;quot;title&amp;quot;: &amp;quot;&amp;quot;
##   },
##   {
##     &amp;quot;link&amp;quot;: &amp;quot;https://r.search.yahoo.com/_ylt=AwrEteLKS0ZqawIATfJXNyoA;_ylu=Y29sbwNiZjEEcG9zAzMEdnRpZAMEc2VjA3Ny/RV=2/RE=1784201418/RO=10/RU=https%3a%2f%2fwww.bing.com%2fimages%2fsearch%3fview%3ddetailV2%26ccid%3dZ33s1urJ%26id%3d7236CCFBE7C0B5849BA9D44071E0F214A85C5EAF%26thid%3dOIP.Z33s1urJ3ZHwJtgKZtWHJAHaDS%26mediaurl%3dhttps%3a%2f%2fwww.dominos.com%2fcms%2fassets%2f58a8e864-d1aa-457a-9d37-fcc1912b10ad%3fim%3dCrop%2crect%3d%28774%2c1015%2c4331%2c1920%29%3bResize%3d%281700%29%2callowExpansion%26exph%3d754%26expw%3d1700%26q%3dpizza%26ck%3d1274A2028C287B1E2E3A8B0EB2F9DE7D%26idpp%3drc%26idpview%3dsingleimage%26form%3drc2idp/RK=2/RS=d9hH9.gzp8cqI8s0XYrAtGSVGXg-&amp;quot;,
##     &amp;quot;title&amp;quot;: &amp;quot;&amp;quot;
##   },
##   {
##     &amp;quot;link&amp;quot;: &amp;quot;https://r.search.yahoo.com/_ylt=AwrEteLKS0ZqawIATvJXNyoA;_ylu=Y29sbwNiZjEEcG9zAzMEdnRpZAMEc2VjA3Ny/RV=2/RE=1784201418/RO=10/RU=https%3a%2f%2fwww.bing.com%2fimages%2fsearch%3fview%3ddetailV2%26ccid%3deK8nC663%26id%3d7236CCFBE7C0B5849BA99FA63EED83A3990E2BF8%26thid%3dOIP.eK8nC6636jB9TYTyjaHNGgHaFj%26mediaurl%3dhttps%3a%2f%2fwww.dominos.com%2fstatic%2f1.83.3%2fimages%2ftiles%2fperfectComboDeal%2fside.webp%26exph%3d458%26expw%3d610%26q%3dpizza%26ck%3dCD805B6ADACFFC2697D3BE3D36098B7E%26idpp%3drc%26idpview%3dsingleimage%26form%3drc2idp/RK=2/RS=KY2oqWHmG3Y6yqMzcVPRlshaVsg-&amp;quot;,
##     &amp;quot;title&amp;quot;: &amp;quot;&amp;quot;
##   },
##   {
##     &amp;quot;link&amp;quot;: &amp;quot;https://r.search.yahoo.com/_ylt=AwrEteLKS0ZqawIAT_JXNyoA;_ylu=Y29sbwNiZjEEcG9zAzMEdnRpZAMEc2VjA3Ny/RV=2/RE=1784201418/RO=10/RU=https%3a%2f%2fwww.bing.com%2fimages%2fsearch%3fview%3ddetailV2%26ccid%3d%2bf29F0Yv%26id%3d7236CCFBE7C0B5849BA985F6EAF3041631C46CA1%26thid%3dOIP.-f29F0YvYvZaKklmamQDSwHaDS%26mediaurl%3dhttps%3a%2f%2fwww.dominos.com%2fcms%2fassets%2f43778453-e8b1-4db6-83fa-00f2dc43d6e3%3fim%3dCrop%2crect%3d%28374%2c325%2c3250%2c1441%29%3bResize%3d%281700%29%2callowExpansion%26exph%3d754%26expw%3d1700%26q%3dpizza%26ck%3d66B92DE33E5F605B85BE7C83BE11836C%26idpp%3drc%26idpview%3dsingleimage%26form%3drc2idp/RK=2/RS=15I_QuI3QQbRtWZj5auaBfXOKWQ-&amp;quot;,
##     &amp;quot;title&amp;quot;: &amp;quot;&amp;quot;
##   },
##   {
##     &amp;quot;link&amp;quot;: &amp;quot;https://r.search.yahoo.com/_ylt=AwrEteLKS0ZqawIAYfJXNyoA;_ylu=Y29sbwNiZjEEcG9zAzQEdnRpZAMEc2VjA3Ny/RV=2/RE=1784201418/RO=10/RU=https%3a%2f%2fwww.albacioixelles.com%2f/RK=2/RS=GTpw.m6z.2eGOKxyo3K8xVrqSPE-&amp;quot;,
##     &amp;quot;title&amp;quot;: &amp;quot;Albacioixelleshttps://www.albacioixelles.comAuthentic | Albacioixelles | Elsene&amp;quot;
##   },
##   {
##     &amp;quot;link&amp;quot;: &amp;quot;https://r.search.yahoo.com/_ylt=AwrEteLKS0ZqawIAYvJXNyoA;_ylu=Y29sbwNiZjEEcG9zAzUEdnRpZAMEc2VjA3Ny/RV=2/RE=1784201418/RO=10/RU=https%3a%2f%2fwww.nonalife.com%2f/RK=2/RS=d8sI_7Fy4oweSN3IQQ32zJSfgRY-&amp;quot;,
##     &amp;quot;title&amp;quot;: &amp;quot;Nonahttps://www.nonalife.comNona&amp;quot;
##   },
##   {
##     &amp;quot;link&amp;quot;: &amp;quot;https://r.search.yahoo.com/_ylt=AwrEteLKS0ZqawIAY_JXNyoA;_ylu=Y29sbwNiZjEEcG9zAzYEdnRpZAMEc2VjA3Ny/RV=2/RE=1784201418/RO=10/RU=https%3a%2f%2fwww.tripadvisor.com%2fRestaurant_Review-g188644-d2480305-Reviews-Pizza_Saco-Brussels.html/RK=2/RS=52RUI7KZf9vt_R13PVY7sv04RMQ-&amp;quot;,
##     &amp;quot;title&amp;quot;: &amp;quot;Tripadvisorhttps://www.tripadvisor.com › Restaurant_Review-g188644-dPIZZA SACO, Brussels - Avenue Milcamps 154 - Restaurant ...&amp;quot;
##   },
##   {
##     &amp;quot;link&amp;quot;: &amp;quot;https://r.search.yahoo.com/_ylt=AwrEteLKS0ZqawIAZPJXNyoA;_ylu=Y29sbwNiZjEEcG9zAzcEdnRpZAMEc2VjA3Ny/RV=2/RE=1784201418/RO=10/RU=http%3a%2f%2fwww.pizzasaco.com%2f/RK=2/RS=Zi2tEoNCQKejdFUdm0zsZwuqoig-&amp;quot;,
##     &amp;quot;title&amp;quot;: &amp;quot;pizzasaco.comhttp://www.pizzasaco.comSaco Pizza Bar&amp;quot;
##   }
## ]&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div id=&#34;conclusion&#34; class=&#34;section level1&#34;&gt;
&lt;h1&gt;Conclusion&lt;/h1&gt;
&lt;p&gt;Thanks for reading.&lt;/p&gt;
&lt;p&gt;This was a simple tutorial in which we scraped Yahoo search results with R. Following the same process, you can create your own web crawler which can scrape search results from Yahoo for any web query.&lt;/p&gt;
&lt;p&gt;Of course, you can scrape other search engines with almost the same technique. Also, you can check out this tutorial on &lt;a href=&#34;https://www.scrapingdog.com/blog/scrape-google-search-results/&#34; target=&#34;_blank&#34;&gt;web scraping Google search results using Python&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As always, if you have a question or a suggestion related to the topic covered in this article, please add it as a comment so other readers can benefit from the discussion.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;footnotes footnotes-end-of-document&#34;&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id=&#34;fn1&#34;&gt;&lt;p&gt;Note that, as for any R package, it must first be installed (with the &lt;code&gt;install.packages()&lt;/code&gt; function) before being loaded (with the &lt;code&gt;library()&lt;/code&gt; function).&lt;a href=&#34;#fnref1&#34; class=&#34;footnote-back&#34;&gt;↩︎&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
</description>
    </item>
    
  </channel>
</rss>