Skip to contents

Convenience function to make a modelsummary table. Input needs to be a list of donut_analysis models, i.e. a donut_list.

Usage

donut_summary(
  donut_list,
  filter_80 = TRUE,
  title = NULL,
  hist = TRUE,
  r_inner = NULL,
  sort_variables = TRUE,
  output,
  format_numbers = TRUE,
  ...
)

Arguments

donut_list

The donut_list

filter_80

Should only regressions where treated are <=80% be shown? Defaults to true.

title

Optional: a title for the summary table. Defaults to "Regression results (r_inner km radius)".

hist

If donut_list has clustered standard errors: Should a histogram of the clusters be shown?

r_inner

The inner radius; optional. A (vector of) integers which are the inner radius of a donut_model. Must be in the donut_list.

sort_variables

Should the variables be sorted so that "dist" is at the top? Logical. Currently, this is supported for all se options but "basic".

output

The output of modelsummary, e.g. kableExtra and modelsummary_list. Note that modelsummary_list gets additional list elements so the input information does not get lost.

format_numbers

Logical. Should numbers be formatted so that the thousands are separated by a comma?

...

Optional arguments for histogram and modelsummary

Value

A modelsummary object, usually a kableExtra table.

Examples

data(donut_data)
models <-
donut_models(inner = 2:4, outer = c(10, 20), ds = donut_data,
dep_var = "wealth_index", indep_vars = "age", fe = "id")
table <-
donut_summary(donut_list = models, r_inner = 3, height = 200)
#> Warning: The `x` argument of `as_tibble.matrix()` must have unique column names if
#> `.name_repair` is omitted as of tibble 2.0.0.
#>  Using compatibility `.name_repair`.
#>  The deprecated feature was likely used in the donutsR package.
#>   Please report the issue to the authors.
library(modelsummary)
model_not_donut <- feols(age ~ male | id, data = donut_data, vcov = "cluster")
modelsummary(model_not_donut)
#> <table class="table" style="width: auto !important; margin-left: auto; margin-right: auto;">
#>  <thead>
#>   <tr>
#>    <th style="text-align:left;">   </th>
#>    <th style="text-align:center;">  (1) </th>
#>   </tr>
#>  </thead>
#> <tbody>
#>   <tr>
#>    <td style="text-align:left;"> male </td>
#>    <td style="text-align:center;"> 0.005 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;box-shadow: 0px 1.5px">  </td>
#>    <td style="text-align:center;box-shadow: 0px 1.5px"> (0.162) </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Num.Obs. </td>
#>    <td style="text-align:center;"> 100000 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> R2 </td>
#>    <td style="text-align:center;"> 0.000 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> R2 Adj. </td>
#>    <td style="text-align:center;"> 0.000 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> R2 Within </td>
#>    <td style="text-align:center;"> 0.000 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> R2 Within Adj. </td>
#>    <td style="text-align:center;"> 0.000 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> AIC </td>
#>    <td style="text-align:center;"> 923664.0 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> BIC </td>
#>    <td style="text-align:center;"> 923863.7 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> RMSE </td>
#>    <td style="text-align:center;"> 24.51 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Std.Errors </td>
#>    <td style="text-align:center;"> by: id </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> FE: id </td>
#>    <td style="text-align:center;"> X </td>
#>   </tr>
#> </tbody>
#> </table>
model_w_bootstrap <- donut_models(inner = 2:4, outer = c(10, 20), ds = donut_data,
dep_var = "wealth_index", indep_vars = "age", fe = "id", bootstrap = TRUE)
#> Warning: Please note that the seeding behavior for random number generation for
#> `boottest()` has changed with `fwildclusterboot` version 0.13.
#> 
#> It will no longer be possible to exactly reproduce results produced by versions
#> lower than 0.13.
#> 
#> If your prior results were produced under sufficiently many bootstrap
#> iterations, none of your conclusions will change.  For more details about this
#> change, please read the notes in
#> [news.md](https://cran.r-project.org/web/packages/fwildclusterboot/news/news.html).
#> This warning is displayed once per session.
#> Too guarantee reproducibility, don't forget to set a global random seed
#> **both** via `set.seed()` and `dqrng::dqset.seed()`.
#> This message is displayed once every 8 hours.
donut_summary(model_w_bootstrap, r_inner = 4)
#> <table style="NAborder-bottom: 0; width: auto !important; margin-left: auto; margin-right: auto;border-bottom: 0;" class="table">
#> <caption>Regression results (4km inner radius)</caption>
#>  <thead>
#>   <tr>
#>    <th style="text-align:left;">   </th>
#>    <th style="text-align:center;">  (1) </th>
#>    <th style="text-align:center;">   (2) </th>
#>   </tr>
#>  </thead>
#> <tbody>
#>   <tr>
#>    <td style="text-align:left;"> Lives close to landfill </td>
#>    <td style="text-align:center;"> −0.023 </td>
#>    <td style="text-align:center;"> −0.024 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Age </td>
#>    <td style="text-align:center;"> −0.001 </td>
#>    <td style="text-align:center;"> 0.000 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;box-shadow: 0px 1.5px">  </td>
#>    <td style="text-align:center;box-shadow: 0px 1.5px"> (0.001) </td>
#>    <td style="text-align:center;box-shadow: 0px 1.5px"> (0.000) </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Num. Observations </td>
#>    <td style="text-align:center;"> 6,703 </td>
#>    <td style="text-align:center;"> 30,762 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> $R^2$ </td>
#>    <td style="text-align:center;"> 0.003 </td>
#>    <td style="text-align:center;"> 0.001 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Outer radius in km </td>
#>    <td style="text-align:center;"> 10 </td>
#>    <td style="text-align:center;"> 20 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Treated<sup>1</sup> </td>
#>    <td style="text-align:center;"> 1,804 </td>
#>    <td style="text-align:center;"> 1,804 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;">  </td>
#>    <td style="text-align:center;"> [26.91] </td>
#>    <td style="text-align:center;"> [5.86] </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Clusters<sup>2</sup> </td>
#>    <td style="text-align:center;"> 20 </td>
#>    <td style="text-align:center;"> 20 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;">  </td>
#>    <td style="text-align:center;"> [20] </td>
#>    <td style="text-align:center;"> [20] </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Cluster histogram </td>
#>    <td style="text-align:center;"> <?xml version="1.0" encoding="UTF-8"?>
#> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="svglite" width="48.00pt" height="12.00pt" viewbox="0 0 48.00 12.00">
#>   <defs>
#>     <style type="text/css"><![CDATA[
#>     .svglite line, .svglite polyline, .svglite polygon, .svglite path, .svglite rect, .svglite circle {
#>       fill: none;
#>       stroke: #000000;
#>       stroke-linecap: round;
#>       stroke-linejoin: round;
#>       stroke-miterlimit: 10.00;
#>     }
#>     .svglite text {
#>       white-space: pre;
#>     }
#>   ]]></style>
#>   </defs>
#>   <rect width="100%" height="100%" style="stroke: none; fill: none;"></rect>
#>   <defs>
#>     <clippath id="cpMC4wMHw0OC4wMHwwLjAwfDEyLjAw">
#>       <rect x="0.00" y="0.00" width="48.00" height="12.00"></rect>
#>     </clippath>
#>   </defs>
#>   <g clip-path="url(#cpMC4wMHw0OC4wMHwwLjAwfDEyLjAw)">
#> </g>
#>   <defs>
#>     <clippath id="cpMC4wMHw0OC4wMHwyLjg4fDEyLjAw">
#>       <rect x="0.00" y="2.88" width="48.00" height="9.12"></rect>
#>     </clippath>
#>   </defs>
#>   <g clip-path="url(#cpMC4wMHw0OC4wMHwyLjg4fDEyLjAw)">
#>     <rect x="1.68" y="8.28" width="0.33" height="3.38" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="2.01" y="9.97" width="0.33" height="1.69" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="2.34" y="11.66" width="0.33" height="0.00" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="2.68" y="4.91" width="0.33" height="6.76" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="3.01" y="6.60" width="0.33" height="5.07" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="3.34" y="4.91" width="0.33" height="6.76" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="3.68" y="3.22" width="0.33" height="8.44" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="4.01" y="9.97" width="0.33" height="1.69" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>   </g>
#> </svg> </td>
#>    <td style="text-align:center;"> <?xml version="1.0" encoding="UTF-8"?>
#> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="svglite" width="48.00pt" height="12.00pt" viewbox="0 0 48.00 12.00">
#>   <defs>
#>     <style type="text/css"><![CDATA[
#>     .svglite line, .svglite polyline, .svglite polygon, .svglite path, .svglite rect, .svglite circle {
#>       fill: none;
#>       stroke: #000000;
#>       stroke-linecap: round;
#>       stroke-linejoin: round;
#>       stroke-miterlimit: 10.00;
#>     }
#>     .svglite text {
#>       white-space: pre;
#>     }
#>   ]]></style>
#>   </defs>
#>   <rect width="100%" height="100%" style="stroke: none; fill: none;"></rect>
#>   <defs>
#>     <clippath id="cpMC4wMHw0OC4wMHwwLjAwfDEyLjAw">
#>       <rect x="0.00" y="0.00" width="48.00" height="12.00"></rect>
#>     </clippath>
#>   </defs>
#>   <g clip-path="url(#cpMC4wMHw0OC4wMHwwLjAwfDEyLjAw)">
#> </g>
#>   <defs>
#>     <clippath id="cpMC4wMHw0OC4wMHwyLjg4fDEyLjAw">
#>       <rect x="0.00" y="2.88" width="48.00" height="9.12"></rect>
#>     </clippath>
#>   </defs>
#>   <g clip-path="url(#cpMC4wMHw0OC4wMHwyLjg4fDEyLjAw)">
#>     <rect x="40.30" y="3.22" width="1.66" height="8.44" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="41.96" y="3.22" width="1.66" height="8.44" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="43.63" y="3.22" width="1.66" height="8.44" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="45.29" y="8.85" width="1.66" height="2.81" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>   </g>
#> </svg> </td>
#>   </tr>
#> </tbody>
#> <tfoot><tr><td style="padding: 0; " colspan="100%">
#> <sup></sup> + p &lt; 0.1, * p &lt; 0.05, ** p &lt; 0.01, *** p &lt; 0.001</td></tr></tfoot>
#> <tfoot>
#> <tr><td style="padding: 0; " colspan="100%"><span style="font-style: italic;">Note: </span></td></tr>
#> <tr><td style="padding: 0; " colspan="100%">
#> <sup></sup> Numbers in parentheses refer to standard errors. P-values for the treatment status are bootstrapped, so standard errors are not applicable.</td></tr>
#> <tr><td style="padding: 0; " colspan="100%">
#> <sup>1</sup> Numbers in brackets refer to the treated percentage</td></tr>
#> <tr><td style="padding: 0; " colspan="100%">
#> <sup>2</sup> Numbers in brackets refer to the number of treated clusters</td></tr>
#> </tfoot>
#> </table>
models_list <- list(model_w_bootstrap, models) |> unlist(recursive = FALSE)
donut_summary(models_list, r_inner = 3)
#> <table style="NAborder-bottom: 0; width: auto !important; margin-left: auto; margin-right: auto;border-bottom: 0;" class="table">
#> <caption>Regression results (3km inner radius)</caption>
#>  <thead>
#>   <tr>
#>    <th style="text-align:left;">   </th>
#>    <th style="text-align:center;">  (1) </th>
#>    <th style="text-align:center;">   (2) </th>
#>    <th style="text-align:center;">   (3) </th>
#>    <th style="text-align:center;">   (4) </th>
#>   </tr>
#>  </thead>
#> <tbody>
#>   <tr>
#>    <td style="text-align:left;"> Lives close to landfill </td>
#>    <td style="text-align:center;"> −0.036 </td>
#>    <td style="text-align:center;"> −0.038 </td>
#>    <td style="text-align:center;"> −0.036 </td>
#>    <td style="text-align:center;"> −0.038 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;">  </td>
#>    <td style="text-align:center;">  </td>
#>    <td style="text-align:center;">  </td>
#>    <td style="text-align:center;"> (0.053) </td>
#>    <td style="text-align:center;"> (0.046) </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Age </td>
#>    <td style="text-align:center;"> −0.001 </td>
#>    <td style="text-align:center;"> 0.000 </td>
#>    <td style="text-align:center;"> −0.001 </td>
#>    <td style="text-align:center;"> 0.000 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;box-shadow: 0px 1.5px">  </td>
#>    <td style="text-align:center;box-shadow: 0px 1.5px"> (0.001) </td>
#>    <td style="text-align:center;box-shadow: 0px 1.5px"> (0.000) </td>
#>    <td style="text-align:center;box-shadow: 0px 1.5px"> (0.001) </td>
#>    <td style="text-align:center;box-shadow: 0px 1.5px"> (0.000) </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Num. Observations </td>
#>    <td style="text-align:center;"> 6,703 </td>
#>    <td style="text-align:center;"> 30,762 </td>
#>    <td style="text-align:center;"> 6,703 </td>
#>    <td style="text-align:center;"> 30,762 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> $R^2$ </td>
#>    <td style="text-align:center;"> 0.004 </td>
#>    <td style="text-align:center;"> 0.001 </td>
#>    <td style="text-align:center;"> 0.004 </td>
#>    <td style="text-align:center;"> 0.001 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Outer radius in km </td>
#>    <td style="text-align:center;"> 10 </td>
#>    <td style="text-align:center;"> 20 </td>
#>    <td style="text-align:center;"> 10 </td>
#>    <td style="text-align:center;"> 20 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Treated<sup>1</sup> </td>
#>    <td style="text-align:center;"> 1,389 </td>
#>    <td style="text-align:center;"> 1,389 </td>
#>    <td style="text-align:center;"> 1,389 </td>
#>    <td style="text-align:center;"> 1,389 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;">  </td>
#>    <td style="text-align:center;"> [20.72] </td>
#>    <td style="text-align:center;"> [4.52] </td>
#>    <td style="text-align:center;"> [20.72] </td>
#>    <td style="text-align:center;"> [4.52] </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Clusters<sup>2</sup> </td>
#>    <td style="text-align:center;"> 20 </td>
#>    <td style="text-align:center;"> 20 </td>
#>    <td style="text-align:center;"> 20 </td>
#>    <td style="text-align:center;"> 20 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;">  </td>
#>    <td style="text-align:center;"> [20] </td>
#>    <td style="text-align:center;"> [20] </td>
#>    <td style="text-align:center;"> [20] </td>
#>    <td style="text-align:center;"> [20] </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Cluster histogram </td>
#>    <td style="text-align:center;"> <?xml version="1.0" encoding="UTF-8"?>
#> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="svglite" width="48.00pt" height="12.00pt" viewbox="0 0 48.00 12.00">
#>   <defs>
#>     <style type="text/css"><![CDATA[
#>     .svglite line, .svglite polyline, .svglite polygon, .svglite path, .svglite rect, .svglite circle {
#>       fill: none;
#>       stroke: #000000;
#>       stroke-linecap: round;
#>       stroke-linejoin: round;
#>       stroke-miterlimit: 10.00;
#>     }
#>     .svglite text {
#>       white-space: pre;
#>     }
#>   ]]></style>
#>   </defs>
#>   <rect width="100%" height="100%" style="stroke: none; fill: none;"></rect>
#>   <defs>
#>     <clippath id="cpMC4wMHw0OC4wMHwwLjAwfDEyLjAw">
#>       <rect x="0.00" y="0.00" width="48.00" height="12.00"></rect>
#>     </clippath>
#>   </defs>
#>   <g clip-path="url(#cpMC4wMHw0OC4wMHwwLjAwfDEyLjAw)">
#> </g>
#>   <defs>
#>     <clippath id="cpMC4wMHw0OC4wMHwyLjg4fDEyLjAw">
#>       <rect x="0.00" y="2.88" width="48.00" height="9.12"></rect>
#>     </clippath>
#>   </defs>
#>   <g clip-path="url(#cpMC4wMHw0OC4wMHwyLjg4fDEyLjAw)">
#>     <rect x="1.68" y="8.28" width="0.33" height="3.38" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="2.01" y="9.97" width="0.33" height="1.69" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="2.34" y="11.66" width="0.33" height="0.00" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="2.68" y="4.91" width="0.33" height="6.76" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="3.01" y="6.60" width="0.33" height="5.07" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="3.34" y="4.91" width="0.33" height="6.76" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="3.68" y="3.22" width="0.33" height="8.44" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="4.01" y="9.97" width="0.33" height="1.69" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>   </g>
#> </svg> </td>
#>    <td style="text-align:center;"> <?xml version="1.0" encoding="UTF-8"?>
#> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="svglite" width="48.00pt" height="12.00pt" viewbox="0 0 48.00 12.00">
#>   <defs>
#>     <style type="text/css"><![CDATA[
#>     .svglite line, .svglite polyline, .svglite polygon, .svglite path, .svglite rect, .svglite circle {
#>       fill: none;
#>       stroke: #000000;
#>       stroke-linecap: round;
#>       stroke-linejoin: round;
#>       stroke-miterlimit: 10.00;
#>     }
#>     .svglite text {
#>       white-space: pre;
#>     }
#>   ]]></style>
#>   </defs>
#>   <rect width="100%" height="100%" style="stroke: none; fill: none;"></rect>
#>   <defs>
#>     <clippath id="cpMC4wMHw0OC4wMHwwLjAwfDEyLjAw">
#>       <rect x="0.00" y="0.00" width="48.00" height="12.00"></rect>
#>     </clippath>
#>   </defs>
#>   <g clip-path="url(#cpMC4wMHw0OC4wMHwwLjAwfDEyLjAw)">
#> </g>
#>   <defs>
#>     <clippath id="cpMC4wMHw0OC4wMHwyLjg4fDEyLjAw">
#>       <rect x="0.00" y="2.88" width="48.00" height="9.12"></rect>
#>     </clippath>
#>   </defs>
#>   <g clip-path="url(#cpMC4wMHw0OC4wMHwyLjg4fDEyLjAw)">
#>     <rect x="40.30" y="3.22" width="1.66" height="8.44" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="41.96" y="3.22" width="1.66" height="8.44" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="43.63" y="3.22" width="1.66" height="8.44" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="45.29" y="8.85" width="1.66" height="2.81" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>   </g>
#> </svg> </td>
#>    <td style="text-align:center;"> <?xml version="1.0" encoding="UTF-8"?>
#> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="svglite" width="48.00pt" height="12.00pt" viewbox="0 0 48.00 12.00">
#>   <defs>
#>     <style type="text/css"><![CDATA[
#>     .svglite line, .svglite polyline, .svglite polygon, .svglite path, .svglite rect, .svglite circle {
#>       fill: none;
#>       stroke: #000000;
#>       stroke-linecap: round;
#>       stroke-linejoin: round;
#>       stroke-miterlimit: 10.00;
#>     }
#>     .svglite text {
#>       white-space: pre;
#>     }
#>   ]]></style>
#>   </defs>
#>   <rect width="100%" height="100%" style="stroke: none; fill: none;"></rect>
#>   <defs>
#>     <clippath id="cpMC4wMHw0OC4wMHwwLjAwfDEyLjAw">
#>       <rect x="0.00" y="0.00" width="48.00" height="12.00"></rect>
#>     </clippath>
#>   </defs>
#>   <g clip-path="url(#cpMC4wMHw0OC4wMHwwLjAwfDEyLjAw)">
#> </g>
#>   <defs>
#>     <clippath id="cpMC4wMHw0OC4wMHwyLjg4fDEyLjAw">
#>       <rect x="0.00" y="2.88" width="48.00" height="9.12"></rect>
#>     </clippath>
#>   </defs>
#>   <g clip-path="url(#cpMC4wMHw0OC4wMHwyLjg4fDEyLjAw)">
#>     <rect x="1.68" y="8.28" width="0.33" height="3.38" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="2.01" y="9.97" width="0.33" height="1.69" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="2.34" y="11.66" width="0.33" height="0.00" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="2.68" y="4.91" width="0.33" height="6.76" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="3.01" y="6.60" width="0.33" height="5.07" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="3.34" y="4.91" width="0.33" height="6.76" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="3.68" y="3.22" width="0.33" height="8.44" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="4.01" y="9.97" width="0.33" height="1.69" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>   </g>
#> </svg> </td>
#>    <td style="text-align:center;"> <?xml version="1.0" encoding="UTF-8"?>
#> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" class="svglite" width="48.00pt" height="12.00pt" viewbox="0 0 48.00 12.00">
#>   <defs>
#>     <style type="text/css"><![CDATA[
#>     .svglite line, .svglite polyline, .svglite polygon, .svglite path, .svglite rect, .svglite circle {
#>       fill: none;
#>       stroke: #000000;
#>       stroke-linecap: round;
#>       stroke-linejoin: round;
#>       stroke-miterlimit: 10.00;
#>     }
#>     .svglite text {
#>       white-space: pre;
#>     }
#>   ]]></style>
#>   </defs>
#>   <rect width="100%" height="100%" style="stroke: none; fill: none;"></rect>
#>   <defs>
#>     <clippath id="cpMC4wMHw0OC4wMHwwLjAwfDEyLjAw">
#>       <rect x="0.00" y="0.00" width="48.00" height="12.00"></rect>
#>     </clippath>
#>   </defs>
#>   <g clip-path="url(#cpMC4wMHw0OC4wMHwwLjAwfDEyLjAw)">
#> </g>
#>   <defs>
#>     <clippath id="cpMC4wMHw0OC4wMHwyLjg4fDEyLjAw">
#>       <rect x="0.00" y="2.88" width="48.00" height="9.12"></rect>
#>     </clippath>
#>   </defs>
#>   <g clip-path="url(#cpMC4wMHw0OC4wMHwyLjg4fDEyLjAw)">
#>     <rect x="40.30" y="3.22" width="1.66" height="8.44" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="41.96" y="3.22" width="1.66" height="8.44" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="43.63" y="3.22" width="1.66" height="8.44" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>     <rect x="45.29" y="8.85" width="1.66" height="2.81" style="stroke-width: 0.38; stroke: none; fill: #000000;"></rect>
#>   </g>
#> </svg> </td>
#>   </tr>
#> </tbody>
#> <tfoot><tr><td style="padding: 0; " colspan="100%">
#> <sup></sup> + p &lt; 0.1, * p &lt; 0.05, ** p &lt; 0.01, *** p &lt; 0.001</td></tr></tfoot>
#> <tfoot>
#> <tr><td style="padding: 0; " colspan="100%"><span style="font-style: italic;">Note: </span></td></tr>
#> <tr><td style="padding: 0; " colspan="100%">
#> <sup></sup> Numbers in parentheses refer to standard errors. P-values for the treatment status are bootstrapped, so standard errors are not applicable.</td></tr>
#> <tr><td style="padding: 0; " colspan="100%">
#> <sup>1</sup> Numbers in brackets refer to the treated percentage</td></tr>
#> <tr><td style="padding: 0; " colspan="100%">
#> <sup>2</sup> Numbers in brackets refer to the number of treated clusters</td></tr>
#> </tfoot>
#> </table>
models_basic <- donut_models(inner = 2:4, outer = c(10, 20), ds = donut_data,
dep_var = "wealth_index", indep_vars = "age", fe = "id", se = "basic")
donut_summary(models_basic, sort_variables = TRUE)
#> <table style="NAborder-bottom: 0; width: auto !important; margin-left: auto; margin-right: auto;border-bottom: 0;" class="table">
#> <caption>Regression results (4km inner radius)</caption>
#>  <thead>
#>   <tr>
#>    <th style="text-align:left;">   </th>
#>    <th style="text-align:center;">  (1) </th>
#>    <th style="text-align:center;">   (2) </th>
#>   </tr>
#>  </thead>
#> <tbody>
#>   <tr>
#>    <td style="text-align:left;"> age </td>
#>    <td style="text-align:center;"> −0.001 </td>
#>    <td style="text-align:center;"> 0.000 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;">  </td>
#>    <td style="text-align:center;"> (0.001) </td>
#>    <td style="text-align:center;"> (0.000) </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> dist </td>
#>    <td style="text-align:center;"> −0.023 </td>
#>    <td style="text-align:center;"> −0.024 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;box-shadow: 0px 1.5px">  </td>
#>    <td style="text-align:center;box-shadow: 0px 1.5px"> (0.046) </td>
#>    <td style="text-align:center;box-shadow: 0px 1.5px"> (0.039) </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Num. Observations </td>
#>    <td style="text-align:center;"> 6,703 </td>
#>    <td style="text-align:center;"> 30,762 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> $R^2$ </td>
#>    <td style="text-align:center;"> 0.003 </td>
#>    <td style="text-align:center;"> 0.001 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Outer radius in km </td>
#>    <td style="text-align:center;"> 10 </td>
#>    <td style="text-align:center;"> 20 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;"> Treated<sup>1</sup> </td>
#>    <td style="text-align:center;"> 1,804 </td>
#>    <td style="text-align:center;"> 1,804 </td>
#>   </tr>
#>   <tr>
#>    <td style="text-align:left;">  </td>
#>    <td style="text-align:center;"> [26.91] </td>
#>    <td style="text-align:center;"> [5.86] </td>
#>   </tr>
#> </tbody>
#> <tfoot><tr><td style="padding: 0; " colspan="100%">
#> <sup></sup> + p &lt; 0.1, * p &lt; 0.05, ** p &lt; 0.01, *** p &lt; 0.001</td></tr></tfoot>
#> <tfoot>
#> <tr><td style="padding: 0; " colspan="100%"><span style="font-style: italic;">Note: </span></td></tr>
#> <tr><td style="padding: 0; " colspan="100%">
#> <sup></sup> Numbers in parentheses refer to standard errors. </td></tr>
#> <tr><td style="padding: 0; " colspan="100%">
#> <sup>1</sup> Numbers in brackets refer to the treated percentage</td></tr>
#> </tfoot>
#> </table>