diff --git a/man/coef_rename.html b/man/coef_rename.html
index a7b1efa9..572997d3 100644
--- a/man/coef_rename.html
+++ b/man/coef_rename.html
@@ -503,12 +503,12 @@
Examples
-
+
diff --git a/man/datasummary.html b/man/datasummary.html
index 6269c07c..605f6ca9 100644
--- a/man/datasummary.html
+++ b/man/datasummary.html
@@ -706,12 +706,12 @@ Examples
-
+
@@ -785,12 +785,12 @@ Examples
-
+
@@ -865,12 +865,12 @@ Examples
-
+
@@ -959,12 +959,12 @@ Examples
-
+
@@ -1058,12 +1058,12 @@ Examples
-
+
@@ -1157,12 +1157,12 @@ Examples
-
+
|
@@ -1287,12 +1287,12 @@ Examples
-
+
@@ -1446,12 +1446,12 @@ Examples
-
+
@@ -1538,12 +1538,12 @@ Examples
-
+
@@ -1630,12 +1630,12 @@ Examples
-
+
@@ -1744,12 +1744,12 @@ Examples
-
+
diff --git a/man/datasummary_balance.html b/man/datasummary_balance.html
index cebe918e..f0318d2f 100644
--- a/man/datasummary_balance.html
+++ b/man/datasummary_balance.html
@@ -734,12 +734,12 @@ Examples
-
+
|
diff --git a/man/datasummary_correlation.html b/man/datasummary_correlation.html
index a3b0574a..c15787d8 100644
--- a/man/datasummary_correlation.html
+++ b/man/datasummary_correlation.html
@@ -722,12 +722,12 @@ Examples
-
+
@@ -816,12 +816,12 @@ Examples
-
+
@@ -912,12 +912,12 @@ Examples
-
+
@@ -1038,12 +1038,12 @@ Examples
-
+
@@ -1129,12 +1129,12 @@ Examples
-
+
@@ -1224,12 +1224,12 @@ Examples
-
+
@@ -1328,12 +1328,12 @@ Examples
-
+
@@ -1459,12 +1459,12 @@ Examples
-
+
diff --git a/man/datasummary_correlation_format.html b/man/datasummary_correlation_format.html
index 824027ae..749857f5 100644
--- a/man/datasummary_correlation_format.html
+++ b/man/datasummary_correlation_format.html
@@ -535,12 +535,12 @@ Examples
-
+
diff --git a/man/datasummary_crosstab.html b/man/datasummary_crosstab.html
index 72eb1cda..97b1a2b4 100644
--- a/man/datasummary_crosstab.html
+++ b/man/datasummary_crosstab.html
@@ -716,12 +716,12 @@ Examples
-
+
@@ -908,12 +908,12 @@ Examples
-
+
@@ -1022,12 +1022,12 @@ Examples
-
+
@@ -1328,12 +1328,12 @@ Examples
-
+
diff --git a/man/dvnames.html b/man/dvnames.html
index 4c078de1..77657590 100644
--- a/man/dvnames.html
+++ b/man/dvnames.html
@@ -463,12 +463,12 @@ Examples
-
+
@@ -651,12 +651,12 @@ Examples
-
+
diff --git a/man/fmt_equivalence.html b/man/fmt_equivalence.html
index 63cf707b..59c7d856 100644
--- a/man/fmt_equivalence.html
+++ b/man/fmt_equivalence.html
@@ -467,12 +467,12 @@ Examples
-
+
@@ -613,12 +613,12 @@ Examples
-
+
@@ -759,12 +759,12 @@ Examples
-
+
diff --git a/search.json b/search.json
index a85b84d2..593a5b5d 100644
--- a/search.json
+++ b/search.json
@@ -609,7 +609,7 @@
"href": "vignettes/datasummary.html#arguments-weighted-mean",
"title": "Data Summaries",
"section": "Arguments: Weighted Mean",
- "text": "Arguments: Weighted Mean\nYou can use the Arguments mechanism to do various things, such as calculating weighted means:\n\nnewdata <- data.frame(\n x = rnorm(20),\n w = rnorm(20),\n y = rnorm(20))\n\ndatasummary(x + y ~ weighted.mean * Arguments(w = w),\n data = newdata)\n\n\n\n \n\n \n \n \n \n \n \n \n weighted.mean\n \n \n \n \n \n x\n -0.56\n \n \n y\n 2.06 \n \n \n \n \n\n\n\nWhich produces the same results as:\n\nweighted.mean(newdata$x, newdata$w)\n\n[1] -0.5608977\n\nweighted.mean(newdata$y, newdata$w)\n\n[1] 2.059661\n\n\nBut different results from:\n\nmean(newdata$x)\n\n[1] -0.2031828\n\nmean(newdata$y)\n\n[1] -0.01129047",
+ "text": "Arguments: Weighted Mean\nYou can use the Arguments mechanism to do various things, such as calculating weighted means:\n\nnewdata <- data.frame(\n x = rnorm(20),\n w = rnorm(20),\n y = rnorm(20))\n\ndatasummary(x + y ~ weighted.mean * Arguments(w = w),\n data = newdata)\n\n\n\n \n\n \n \n \n \n \n \n \n weighted.mean\n \n \n \n \n \n x\n -0.10\n \n \n y\n 0.09 \n \n \n \n \n\n\n\nWhich produces the same results as:\n\nweighted.mean(newdata$x, newdata$w)\n\n[1] -0.09821034\n\nweighted.mean(newdata$y, newdata$w)\n\n[1] 0.09157174\n\n\nBut different results from:\n\nmean(newdata$x)\n\n[1] 0.4488352\n\nmean(newdata$y)\n\n[1] -0.004286111",
"crumbs": [
"Get started",
"Data Summaries"
@@ -653,7 +653,7 @@
"href": "vignettes/datasummary.html#add-columns",
"title": "Data Summaries",
"section": "Add columns",
- "text": "Add columns\n\nnew_cols <- data.frame('New Stat' = runif(2))\ndatasummary(flipper_length_mm + body_mass_g ~ species * (Mean + SD),\n data = penguins,\n add_columns = new_cols)\n\n\n\n \n\n \n \n \n \n\n \nAdelie\nChinstrap\nGentoo\n \n\n \n \n \n Mean\n SD\n Mean\n SD\n Mean\n SD\n New.Stat\n \n \n \n \n \n flipper_length_mm\n 189.95 \n 6.54 \n 195.82 \n 7.13 \n 217.19 \n 6.48 \n 0.17\n \n \n body_mass_g \n 3700.66\n 458.57\n 3733.09\n 384.34\n 5076.02\n 504.12\n 0.46",
+ "text": "Add columns\n\nnew_cols <- data.frame('New Stat' = runif(2))\ndatasummary(flipper_length_mm + body_mass_g ~ species * (Mean + SD),\n data = penguins,\n add_columns = new_cols)\n\n\n\n \n\n \n \n \n \n\n \nAdelie\nChinstrap\nGentoo\n \n\n \n \n \n Mean\n SD\n Mean\n SD\n Mean\n SD\n New.Stat\n \n \n \n \n \n flipper_length_mm\n 189.95 \n 6.54 \n 195.82 \n 7.13 \n 217.19 \n 6.48 \n 0.21\n \n \n body_mass_g \n 3700.66\n 458.57\n 3733.09\n 384.34\n 5076.02\n 504.12\n 0.98",
"crumbs": [
"Get started",
"Data Summaries"
@@ -664,7 +664,7 @@
"href": "vignettes/modelsummary.html",
"title": "Model Summaries",
"section": "",
- "text": "modelsummary includes a powerful set of utilities to customize the information displayed in your model summary tables. You can easily rename, reorder, subset or omit parameter estimates; choose the set of goodness-of-fit statistics to display; display various “robust” standard errors or confidence intervals; add titles, footnotes, or source notes; insert stars or custom characters to indicate levels of statistical significance; or add rows with supplemental information about your models.\nBefore starting, we set modelsummary to use the tinytable package to draw table, and we set a few CSS properties to make tables more display in a more compact format on this website. This step is optional.\nNow, we download data, fit some models, and summarize them in a table using the modelsummary() function:\nlibrary(modelsummary)\n\nurl <- 'https://vincentarelbundock.github.io/Rdatasets/csv/HistData/Guerry.csv'\ndat <- read.csv(url)\n\nmodels <- list(\n \"OLS 1\" = lm(Donations ~ Literacy + Clergy, data = dat),\n \"Poisson\" = glm(Donations ~ Literacy + Commerce, family = poisson, data = dat),\n \"OLS 2\" = lm(Crime_pers ~ Literacy + Clergy, data = dat)\n)\n\nmodelsummary(models)\n\n\n\n \n\n \n \n \n \n \n \n \n OLS 1\n Poisson\n OLS 2\n \n \n \n \n \n (Intercept)\n 7948.667 \n 8.241 \n 16259.384 \n \n \n \n (2078.276)\n (0.006) \n (2611.140)\n \n \n Literacy \n -39.121 \n 0.003 \n 3.680 \n \n \n \n (37.052) \n (0.000) \n (46.552) \n \n \n Clergy \n 15.257 \n \n 77.148 \n \n \n \n (25.735) \n \n (32.334) \n \n \n Commerce \n \n 0.011 \n \n \n \n \n \n (0.000) \n \n \n \n Num.Obs. \n 86 \n 86 \n 86 \n \n \n R2 \n 0.020 \n \n 0.065 \n \n \n R2 Adj. \n -0.003 \n \n 0.043 \n \n \n AIC \n 1740.8 \n 274160.8 \n 1780.0 \n \n \n BIC \n 1750.6 \n 274168.2 \n 1789.9 \n \n \n Log.Lik. \n -866.392 \n -137077.401\n -886.021 \n \n \n F \n 0.866 \n 18294.559 \n 2.903 \n \n \n RMSE \n 5740.99 \n 5491.61 \n 7212.97",
+ "text": "modelsummary includes a powerful set of utilities to customize the information displayed in your model summary tables. You can easily rename, reorder, subset or omit parameter estimates; choose the set of goodness-of-fit statistics to display; display various “robust” standard errors or confidence intervals; add titles, footnotes, or source notes; insert stars or custom characters to indicate levels of statistical significance; or add rows with supplemental information about your models.\nBefore starting, we set a few CSS properties to make tables more display in a more compact format on this website. This step is optional.\nNow, we download data, fit some models, and summarize them in a table using the modelsummary() function:\nlibrary(modelsummary)\n\nurl <- 'https://vincentarelbundock.github.io/Rdatasets/csv/HistData/Guerry.csv'\ndat <- read.csv(url)\n\nmodels <- list(\n \"OLS 1\" = lm(Donations ~ Literacy + Clergy, data = dat),\n \"Poisson\" = glm(Donations ~ Literacy + Commerce, family = poisson, data = dat),\n \"OLS 2\" = lm(Crime_pers ~ Literacy + Clergy, data = dat)\n)\n\nmodelsummary(models)\n\n\n\n \n\n \n \n \n \n \n \n \n OLS 1\n Poisson\n OLS 2\n \n \n \n \n \n (Intercept)\n 7948.667 \n 8.241 \n 16259.384 \n \n \n \n (2078.276)\n (0.006) \n (2611.140)\n \n \n Literacy \n -39.121 \n 0.003 \n 3.680 \n \n \n \n (37.052) \n (0.000) \n (46.552) \n \n \n Clergy \n 15.257 \n \n 77.148 \n \n \n \n (25.735) \n \n (32.334) \n \n \n Commerce \n \n 0.011 \n \n \n \n \n \n (0.000) \n \n \n \n Num.Obs. \n 86 \n 86 \n 86 \n \n \n R2 \n 0.020 \n \n 0.065 \n \n \n R2 Adj. \n -0.003 \n \n 0.043 \n \n \n AIC \n 1740.8 \n 274160.8 \n 1780.0 \n \n \n BIC \n 1750.6 \n 274168.2 \n 1789.9 \n \n \n Log.Lik. \n -866.392 \n -137077.401\n -886.021 \n \n \n F \n 0.866 \n 18294.559 \n 2.903 \n \n \n RMSE \n 5740.99 \n 5491.61 \n 7212.97",
"crumbs": [
"Get started",
"Model Summaries"
@@ -752,7 +752,7 @@
"href": "vignettes/modelsummary.html#quarto",
"title": "Model Summaries",
"section": "Quarto",
- "text": "Quarto\nQuarto is an open source publishing system built on top of Pandoc. It was designed as a “successor” to Rmarkdown, and includes useful features for technical writing, such as built-in support for cross-references. modelsummary works automatically with Quarto. This is a minimal document with cross-references which should render automatically to PDF, HTML, and more:\n---\nformat: pdf\ntitle: Example\n---\n\n@tbl-mtcars shows that cars with high horse power get low miles per gallon.\n\n::: {#tbl-mtcars .cell tbl-cap='Horse Powers vs. Miles per Gallon'}\n\n```{.r .cell-code}\nlibrary(modelsummary)\nmod <- lm(mpg ~ hp, mtcars)\nmodelsummary(mod)\n```\n\n::: {.cell-output-display}\n\n```{=html}\n<!-- preamble start -->\n\n <script>\n function styleCell_heorg6ucchfb4at5w2q4(i, j, css_id) {\n var table = document.getElementById(\"tinytable_heorg6ucchfb4at5w2q4\");\n table.rows[i].cells[j].classList.add(css_id);\n }\n function insertSpanRow(i, colspan, content) {\n var table = document.getElementById('tinytable_heorg6ucchfb4at5w2q4');\n var newRow = table.insertRow(i);\n var newCell = newRow.insertCell(0);\n newCell.setAttribute(\"colspan\", colspan);\n // newCell.innerText = content;\n // this may be unsafe, but innerText does not interpret <br>\n newCell.innerHTML = content;\n }\n function spanCell_heorg6ucchfb4at5w2q4(i, j, rowspan, colspan) {\n var table = document.getElementById(\"tinytable_heorg6ucchfb4at5w2q4\");\n const targetRow = table.rows[i];\n const targetCell = targetRow.cells[j];\n for (let r = 0; r < rowspan; r++) {\n // Only start deleting cells to the right for the first row (r == 0)\n if (r === 0) {\n // Delete cells to the right of the target cell in the first row\n for (let c = colspan - 1; c > 0; c--) {\n if (table.rows[i + r].cells[j + c]) {\n table.rows[i + r].deleteCell(j + c);\n }\n }\n }\n // For rows below the first, delete starting from the target column\n if (r > 0) {\n for (let c = colspan - 1; c >= 0; c--) {\n if (table.rows[i + r] && table.rows[i + r].cells[j]) {\n table.rows[i + r].deleteCell(j);\n }\n }\n }\n }\n // Set rowspan and colspan of the target cell\n targetCell.rowSpan = rowspan;\n targetCell.colSpan = colspan;\n }\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(0, 0, 'tinytable_css_idqzj3qpnoa2klzdmcufow') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(0, 1, 'tinytable_css_idu9mksibtlydbfa8hqd1p') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(1, 0, 'tinytable_css_idybco77m5krifgsjrthoe') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(1, 1, 'tinytable_css_idbbxi85s3shb4vn7j9s3l') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(2, 0, 'tinytable_css_idybco77m5krifgsjrthoe') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(2, 1, 'tinytable_css_idbbxi85s3shb4vn7j9s3l') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(3, 0, 'tinytable_css_idybco77m5krifgsjrthoe') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(3, 1, 'tinytable_css_idbbxi85s3shb4vn7j9s3l') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(4, 0, 'tinytable_css_id2gbcghpjgs5mdm5loexj') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(4, 1, 'tinytable_css_idtvsc4isiyoqqt8qbk86i') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(5, 0, 'tinytable_css_idybco77m5krifgsjrthoe') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(5, 1, 'tinytable_css_idbbxi85s3shb4vn7j9s3l') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(6, 0, 'tinytable_css_idybco77m5krifgsjrthoe') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(6, 1, 'tinytable_css_idbbxi85s3shb4vn7j9s3l') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(7, 0, 'tinytable_css_idybco77m5krifgsjrthoe') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(7, 1, 'tinytable_css_idbbxi85s3shb4vn7j9s3l') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(8, 0, 'tinytable_css_idybco77m5krifgsjrthoe') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(8, 1, 'tinytable_css_idbbxi85s3shb4vn7j9s3l') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(9, 0, 'tinytable_css_idybco77m5krifgsjrthoe') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(9, 1, 'tinytable_css_idbbxi85s3shb4vn7j9s3l') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(10, 0, 'tinytable_css_idybco77m5krifgsjrthoe') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(10, 1, 'tinytable_css_idbbxi85s3shb4vn7j9s3l') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(11, 0, 'tinytable_css_idybco77m5krifgsjrthoe') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(11, 1, 'tinytable_css_idbbxi85s3shb4vn7j9s3l') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(12, 0, 'tinytable_css_idybco77m5krifgsjrthoe') })\nwindow.addEventListener('load', function () { styleCell_heorg6ucchfb4at5w2q4(12, 1, 'tinytable_css_idbbxi85s3shb4vn7j9s3l') })\n </script>\n\n <style>\n .table td.tinytable_css_idqzj3qpnoa2klzdmcufow, .table th.tinytable_css_idqzj3qpnoa2klzdmcufow { text-align: left; border-bottom: solid 0.1em #d3d8dc; }\n .table td.tinytable_css_idu9mksibtlydbfa8hqd1p, .table th.tinytable_css_idu9mksibtlydbfa8hqd1p { text-align: center; border-bottom: solid 0.1em #d3d8dc; }\n .table td.tinytable_css_idybco77m5krifgsjrthoe, .table th.tinytable_css_idybco77m5krifgsjrthoe { text-align: left; }\n .table td.tinytable_css_idbbxi85s3shb4vn7j9s3l, .table th.tinytable_css_idbbxi85s3shb4vn7j9s3l { text-align: center; }\n .table td.tinytable_css_id2gbcghpjgs5mdm5loexj, .table th.tinytable_css_id2gbcghpjgs5mdm5loexj { border-bottom: solid 0.05em black; text-align: left; }\n .table td.tinytable_css_idtvsc4isiyoqqt8qbk86i, .table th.tinytable_css_idtvsc4isiyoqqt8qbk86i { border-bottom: solid 0.05em black; text-align: center; }\n </style>\n <div class=\"container\">\n <table class=\"table table-borderless\" id=\"tinytable_heorg6ucchfb4at5w2q4\" style=\"width: auto; margin-left: auto; margin-right: auto;\" data-quarto-disable-processing='true'>\n <thead>\n \n <tr>\n <th scope=\"col\"> </th>\n <th scope=\"col\">(1)</th>\n </tr>\n </thead>\n \n <tbody>\n <tr>\n <td>(Intercept)</td>\n <td>30.099 </td>\n </tr>\n <tr>\n <td> </td>\n <td>(1.634)</td>\n </tr>\n <tr>\n <td>hp </td>\n <td>-0.068 </td>\n </tr>\n <tr>\n <td> </td>\n <td>(0.010)</td>\n </tr>\n <tr>\n <td>Num.Obs. </td>\n <td>32 </td>\n </tr>\n <tr>\n <td>R2 </td>\n <td>0.602 </td>\n </tr>\n <tr>\n <td>R2 Adj. </td>\n <td>0.589 </td>\n </tr>\n <tr>\n <td>AIC </td>\n <td>181.2 </td>\n </tr>\n <tr>\n <td>BIC </td>\n <td>185.6 </td>\n </tr>\n <tr>\n <td>Log.Lik. </td>\n <td>-87.619</td>\n </tr>\n <tr>\n <td>F </td>\n <td>45.460 </td>\n </tr>\n <tr>\n <td>RMSE </td>\n <td>3.74 </td>\n </tr>\n </tbody>\n </table>\n </div>\n<!-- hack to avoid NA insertion in last line -->\n```\n\n:::\n:::",
+ "text": "Quarto\nQuarto is an open source publishing system built on top of Pandoc. It was designed as a “successor” to Rmarkdown, and includes useful features for technical writing, such as built-in support for cross-references. modelsummary works automatically with Quarto. This is a minimal document with cross-references which should render automatically to PDF, HTML, and more:\n---\nformat: pdf\ntitle: Example\n---\n\n@tbl-mtcars shows that cars with high horse power get low miles per gallon.\n\n::: {#tbl-mtcars .cell tbl-cap='Horse Powers vs. Miles per Gallon'}\n\n```{.r .cell-code}\nlibrary(modelsummary)\nmod <- lm(mpg ~ hp, mtcars)\nmodelsummary(mod)\n```\n\n::: {.cell-output-display}\n\n```{=html}\n<!-- preamble start -->\n\n <script>\n function styleCell_1624ke16egd51f5yfatz(i, j, css_id) {\n var table = document.getElementById(\"tinytable_1624ke16egd51f5yfatz\");\n table.rows[i].cells[j].classList.add(css_id);\n }\n function insertSpanRow(i, colspan, content) {\n var table = document.getElementById('tinytable_1624ke16egd51f5yfatz');\n var newRow = table.insertRow(i);\n var newCell = newRow.insertCell(0);\n newCell.setAttribute(\"colspan\", colspan);\n // newCell.innerText = content;\n // this may be unsafe, but innerText does not interpret <br>\n newCell.innerHTML = content;\n }\n function spanCell_1624ke16egd51f5yfatz(i, j, rowspan, colspan) {\n var table = document.getElementById(\"tinytable_1624ke16egd51f5yfatz\");\n const targetRow = table.rows[i];\n const targetCell = targetRow.cells[j];\n for (let r = 0; r < rowspan; r++) {\n // Only start deleting cells to the right for the first row (r == 0)\n if (r === 0) {\n // Delete cells to the right of the target cell in the first row\n for (let c = colspan - 1; c > 0; c--) {\n if (table.rows[i + r].cells[j + c]) {\n table.rows[i + r].deleteCell(j + c);\n }\n }\n }\n // For rows below the first, delete starting from the target column\n if (r > 0) {\n for (let c = colspan - 1; c >= 0; c--) {\n if (table.rows[i + r] && table.rows[i + r].cells[j]) {\n table.rows[i + r].deleteCell(j);\n }\n }\n }\n }\n // Set rowspan and colspan of the target cell\n targetCell.rowSpan = rowspan;\n targetCell.colSpan = colspan;\n }\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(0, 0, 'tinytable_css_idz4idv2pp31vzfozc0bl5') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(0, 1, 'tinytable_css_id5ugdwowpbgoxrr2cv7da') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(1, 0, 'tinytable_css_idm2lj71ysn8vkiggdxjhn') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(1, 1, 'tinytable_css_idqp04jfukckfhql02iyt0') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(2, 0, 'tinytable_css_idm2lj71ysn8vkiggdxjhn') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(2, 1, 'tinytable_css_idqp04jfukckfhql02iyt0') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(3, 0, 'tinytable_css_idm2lj71ysn8vkiggdxjhn') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(3, 1, 'tinytable_css_idqp04jfukckfhql02iyt0') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(4, 0, 'tinytable_css_idpjgiw4iswko7v23oie2a') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(4, 1, 'tinytable_css_ido3fttuxjn7wx7bdvfvwj') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(5, 0, 'tinytable_css_idm2lj71ysn8vkiggdxjhn') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(5, 1, 'tinytable_css_idqp04jfukckfhql02iyt0') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(6, 0, 'tinytable_css_idm2lj71ysn8vkiggdxjhn') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(6, 1, 'tinytable_css_idqp04jfukckfhql02iyt0') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(7, 0, 'tinytable_css_idm2lj71ysn8vkiggdxjhn') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(7, 1, 'tinytable_css_idqp04jfukckfhql02iyt0') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(8, 0, 'tinytable_css_idm2lj71ysn8vkiggdxjhn') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(8, 1, 'tinytable_css_idqp04jfukckfhql02iyt0') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(9, 0, 'tinytable_css_idm2lj71ysn8vkiggdxjhn') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(9, 1, 'tinytable_css_idqp04jfukckfhql02iyt0') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(10, 0, 'tinytable_css_idm2lj71ysn8vkiggdxjhn') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(10, 1, 'tinytable_css_idqp04jfukckfhql02iyt0') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(11, 0, 'tinytable_css_idm2lj71ysn8vkiggdxjhn') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(11, 1, 'tinytable_css_idqp04jfukckfhql02iyt0') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(12, 0, 'tinytable_css_idm2lj71ysn8vkiggdxjhn') })\nwindow.addEventListener('load', function () { styleCell_1624ke16egd51f5yfatz(12, 1, 'tinytable_css_idqp04jfukckfhql02iyt0') })\n </script>\n\n <style>\n .table td.tinytable_css_idz4idv2pp31vzfozc0bl5, .table th.tinytable_css_idz4idv2pp31vzfozc0bl5 { text-align: left; border-bottom: solid 0.1em #d3d8dc; }\n .table td.tinytable_css_id5ugdwowpbgoxrr2cv7da, .table th.tinytable_css_id5ugdwowpbgoxrr2cv7da { text-align: center; border-bottom: solid 0.1em #d3d8dc; }\n .table td.tinytable_css_idm2lj71ysn8vkiggdxjhn, .table th.tinytable_css_idm2lj71ysn8vkiggdxjhn { text-align: left; }\n .table td.tinytable_css_idqp04jfukckfhql02iyt0, .table th.tinytable_css_idqp04jfukckfhql02iyt0 { text-align: center; }\n .table td.tinytable_css_idpjgiw4iswko7v23oie2a, .table th.tinytable_css_idpjgiw4iswko7v23oie2a { border-bottom: solid 0.05em black; text-align: left; }\n .table td.tinytable_css_ido3fttuxjn7wx7bdvfvwj, .table th.tinytable_css_ido3fttuxjn7wx7bdvfvwj { border-bottom: solid 0.05em black; text-align: center; }\n </style>\n <div class=\"container\">\n <table class=\"table table-borderless\" id=\"tinytable_1624ke16egd51f5yfatz\" style=\"width: auto; margin-left: auto; margin-right: auto;\" data-quarto-disable-processing='true'>\n <thead>\n \n <tr>\n <th scope=\"col\"> </th>\n <th scope=\"col\">(1)</th>\n </tr>\n </thead>\n \n <tbody>\n <tr>\n <td>(Intercept)</td>\n <td>30.099 </td>\n </tr>\n <tr>\n <td> </td>\n <td>(1.634)</td>\n </tr>\n <tr>\n <td>hp </td>\n <td>-0.068 </td>\n </tr>\n <tr>\n <td> </td>\n <td>(0.010)</td>\n </tr>\n <tr>\n <td>Num.Obs. </td>\n <td>32 </td>\n </tr>\n <tr>\n <td>R2 </td>\n <td>0.602 </td>\n </tr>\n <tr>\n <td>R2 Adj. </td>\n <td>0.589 </td>\n </tr>\n <tr>\n <td>AIC </td>\n <td>181.2 </td>\n </tr>\n <tr>\n <td>BIC </td>\n <td>185.6 </td>\n </tr>\n <tr>\n <td>Log.Lik. </td>\n <td>-87.619</td>\n </tr>\n <tr>\n <td>F </td>\n <td>45.460 </td>\n </tr>\n <tr>\n <td>RMSE </td>\n <td>3.74 </td>\n </tr>\n </tbody>\n </table>\n </div>\n<!-- hack to avoid NA insertion in last line -->\n```\n\n:::\n:::",
"crumbs": [
"Get started",
"Model Summaries"
@@ -796,7 +796,7 @@
"href": "vignettes/modelsummary.html#bootstrap",
"title": "Model Summaries",
"section": "Bootstrap",
- "text": "Bootstrap\nUsers often want to use estimates or standard errors that have been obtained using a custom strategy. To achieve this in an automated and replicable way, it can be useful to use the tidy_custom strategy described above in the “Cutomizing Existing Models” section.\nFor example, we can use the modelr package to draw 500 resamples of a dataset, and compute bootstrap standard errors by taking the standard deviation of estimates computed in all of those resampled datasets. To do this, we defined tidy_custom.lm function that will automatically bootstrap any lm model supplied to modelsummary, and replace the values in the table automatically.\nNote that the tidy_custom_lm returns a data.frame with 3 columns: term, estimate, and std.error:\n\nlibrary(\"broom\")\nlibrary(\"tidyverse\")\nlibrary(\"modelr\")\n\ntidy_custom.lm <- function(x, ...) {\n # extract data from the model\n model.frame(x) %>%\n # draw 500 bootstrap resamples\n modelr::bootstrap(n = 500) %>%\n # estimate the model 500 times\n mutate(results = map(strap, ~ update(x, data = .))) %>%\n # extract results using `broom::tidy`\n mutate(results = map(results, tidy)) %>%\n # unnest and summarize\n unnest(results) %>%\n group_by(term) %>%\n summarize(std.error = sd(estimate),\n estimate = mean(estimate))\n}\n\nmod = list(\n lm(hp ~ mpg, mtcars) ,\n lm(hp ~ mpg + drat, mtcars))\n\nmodelsummary(mod)\n\n\n\n \n\n \n \n \n \n \n \n \n (1)\n (2)\n \n \n \n \n \n (Intercept)\n 328.693 \n 282.235 \n \n \n \n (31.110)\n (47.022)\n \n \n mpg \n -9.074 \n -10.173 \n \n \n \n (1.401) \n (2.455) \n \n \n drat \n \n 18.758 \n \n \n \n \n (22.442)\n \n \n Num.Obs. \n 32 \n 32 \n \n \n R2 \n 0.602 \n 0.614 \n \n \n R2 Adj. \n 0.589 \n 0.588 \n \n \n AIC \n 336.9 \n 337.9 \n \n \n BIC \n 341.3 \n 343.7 \n \n \n Log.Lik. \n -165.428\n -164.940\n \n \n F \n 45.460 \n 23.100 \n \n \n RMSE \n 42.55 \n 41.91",
+ "text": "Bootstrap\nUsers often want to use estimates or standard errors that have been obtained using a custom strategy. To achieve this in an automated and replicable way, it can be useful to use the tidy_custom strategy described above in the “Cutomizing Existing Models” section.\nFor example, we can use the modelr package to draw 500 resamples of a dataset, and compute bootstrap standard errors by taking the standard deviation of estimates computed in all of those resampled datasets. To do this, we defined tidy_custom.lm function that will automatically bootstrap any lm model supplied to modelsummary, and replace the values in the table automatically.\nNote that the tidy_custom_lm returns a data.frame with 3 columns: term, estimate, and std.error:\n\nlibrary(\"broom\")\nlibrary(\"tidyverse\")\nlibrary(\"modelr\")\n\ntidy_custom.lm <- function(x, ...) {\n # extract data from the model\n model.frame(x) %>%\n # draw 500 bootstrap resamples\n modelr::bootstrap(n = 500) %>%\n # estimate the model 500 times\n mutate(results = map(strap, ~ update(x, data = .))) %>%\n # extract results using `broom::tidy`\n mutate(results = map(results, tidy)) %>%\n # unnest and summarize\n unnest(results) %>%\n group_by(term) %>%\n summarize(std.error = sd(estimate),\n estimate = mean(estimate))\n}\n\nmod = list(\n lm(hp ~ mpg, mtcars) ,\n lm(hp ~ mpg + drat, mtcars))\n\nmodelsummary(mod)\n\n\n\n \n\n \n \n \n \n \n \n \n (1)\n (2)\n \n \n \n \n \n (Intercept)\n 325.951 \n 287.229 \n \n \n \n (29.682)\n (42.535)\n \n \n mpg \n -8.979 \n -10.002 \n \n \n \n (1.348) \n (2.384) \n \n \n drat \n \n 16.576 \n \n \n \n \n (20.544)\n \n \n Num.Obs. \n 32 \n 32 \n \n \n R2 \n 0.602 \n 0.614 \n \n \n R2 Adj. \n 0.589 \n 0.588 \n \n \n AIC \n 336.9 \n 337.9 \n \n \n BIC \n 341.3 \n 343.7 \n \n \n Log.Lik. \n -165.428\n -164.940\n \n \n F \n 45.460 \n 23.100 \n \n \n RMSE \n 42.55 \n 41.91",
"crumbs": [
"Get started",
"Model Summaries"
@@ -807,7 +807,7 @@
"href": "vignettes/modelsummary.html#fixest-fixed-effects-and-instrumental-variable-regression",
"title": "Model Summaries",
"section": "fixest: Fixed effects and instrumental variable regression",
- "text": "fixest: Fixed effects and instrumental variable regression\nOne common use-case for glance_custom is to include additional goodness-of-fit statistics. For example, in an instrumental variable estimation computed by the fixest package, we may want to include an IV-Wald statistic for the first-stage regression of each endogenous regressor:\n\nlibrary(fixest)\nlibrary(tidyverse)\n\n# create a toy dataset\nbase <- iris\nnames(base) <- c(\"y\", \"x1\", \"x_endo_1\", \"x_inst_1\", \"fe\")\nbase$x_inst_2 <- 0.2 * base$y + 0.2 * base$x_endo_1 + rnorm(150, sd = 0.5)\nbase$x_endo_2 <- 0.2 * base$y - 0.2 * base$x_inst_1 + rnorm(150, sd = 0.5)\n\n# estimate an instrumental variable model\nmod <- feols(y ~ x1 | fe | x_endo_1 + x_endo_2 ~ x_inst_1 + x_inst_2, base)\n\n# custom extractor function returns a one-row data.frame (or tibble)\nglance_custom.fixest <- function(x) {\n tibble(\n \"Wald (x_endo_1)\" = fitstat(x, \"ivwald\")[[1]]$stat,\n \"Wald (x_endo_2)\" = fitstat(x, \"ivwald\")[[2]]$stat\n )\n}\n\n# draw table\nmodelsummary(mod)\n\n\n\n \n\n \n \n \n \n \n \n \n (1)\n \n \n \n \n \n fit_x_endo_1 \n 0.892 \n \n \n \n (0.409) \n \n \n fit_x_endo_2 \n 0.838 \n \n \n \n (0.652) \n \n \n x1 \n 0.276 \n \n \n \n (0.226) \n \n \n Num.Obs. \n 150 \n \n \n R2 \n 0.649 \n \n \n R2 Adj. \n 0.637 \n \n \n R2 Within \n 0.081 \n \n \n R2 Within Adj. \n 0.062 \n \n \n AIC \n 222.8 \n \n \n BIC \n 240.9 \n \n \n RMSE \n 0.49 \n \n \n Std.Errors \n by: fe \n \n \n FE: fe \n X \n \n \n Wald (x_endo_1)\n 4.3324965619483 \n \n \n Wald (x_endo_2)\n 11.6474582635098\n \n \n \n \n\n\n\n\nrm(\"glance_custom.fixest\")",
+ "text": "fixest: Fixed effects and instrumental variable regression\nOne common use-case for glance_custom is to include additional goodness-of-fit statistics. For example, in an instrumental variable estimation computed by the fixest package, we may want to include an IV-Wald statistic for the first-stage regression of each endogenous regressor:\n\nlibrary(fixest)\nlibrary(tidyverse)\n\n# create a toy dataset\nbase <- iris\nnames(base) <- c(\"y\", \"x1\", \"x_endo_1\", \"x_inst_1\", \"fe\")\nbase$x_inst_2 <- 0.2 * base$y + 0.2 * base$x_endo_1 + rnorm(150, sd = 0.5)\nbase$x_endo_2 <- 0.2 * base$y - 0.2 * base$x_inst_1 + rnorm(150, sd = 0.5)\n\n# estimate an instrumental variable model\nmod <- feols(y ~ x1 | fe | x_endo_1 + x_endo_2 ~ x_inst_1 + x_inst_2, base)\n\n# custom extractor function returns a one-row data.frame (or tibble)\nglance_custom.fixest <- function(x) {\n tibble(\n \"Wald (x_endo_1)\" = fitstat(x, \"ivwald\")[[1]]$stat,\n \"Wald (x_endo_2)\" = fitstat(x, \"ivwald\")[[2]]$stat\n )\n}\n\n# draw table\nmodelsummary(mod)\n\n\n\n \n\n \n \n \n \n \n \n \n (1)\n \n \n \n \n \n fit_x_endo_1 \n 1.243 \n \n \n \n (0.713) \n \n \n fit_x_endo_2 \n 2.067 \n \n \n \n (0.606) \n \n \n x1 \n 0.250 \n \n \n \n (0.494) \n \n \n Num.Obs. \n 150 \n \n \n R2 \n -0.415 \n \n \n R2 Adj. \n -0.464 \n \n \n R2 Within \n -2.710 \n \n \n R2 Within Adj. \n -2.788 \n \n \n AIC \n 432.1 \n \n \n BIC \n 450.2 \n \n \n RMSE \n 0.98 \n \n \n Std.Errors \n by: fe \n \n \n FE: fe \n X \n \n \n Wald (x_endo_1)\n 40.8150562320962\n \n \n Wald (x_endo_2)\n 9.50346988711168\n \n \n \n \n\n\n\n\nrm(\"glance_custom.fixest\")",
"crumbs": [
"Get started",
"Model Summaries"
@@ -818,7 +818,7 @@
"href": "vignettes/modelsummary.html#multiple-imputation",
"title": "Model Summaries",
"section": "Multiple imputation",
- "text": "Multiple imputation\nmodelsummary can pool and display analyses on several datasets imputed using the mice or Amelia packages. This code illustrates how:\n\nlibrary(mice)\n\nWarning in check_dep_version(): ABI version mismatch: \nlme4 was built with Matrix ABI version 2\nCurrent Matrix ABI version is 1\nPlease re-install lme4 from source or restore original 'Matrix' package\n\nlibrary(Amelia)\n\n# Download data from `Rdatasets`\nurl <- 'https://vincentarelbundock.github.io/Rdatasets/csv/HistData/Guerry.csv'\ndat <- read.csv(url)[, c('Clergy', 'Commerce', 'Literacy')]\n\n# Insert missing values\ndat$Clergy[sample(1:nrow(dat), 10)] <- NA\ndat$Commerce[sample(1:nrow(dat), 10)] <- NA\ndat$Literacy[sample(1:nrow(dat), 10)] <- NA\n\n# Impute with `mice` and `Amelia`\ndat_mice <- mice(dat, m = 5, printFlag = FALSE)\ndat_amelia <- amelia(dat, m = 5, p2s = 0)$imputations\n\n# Estimate models\nmod <- list()\nmod[['Listwise deletion']] <- lm(Clergy ~ Literacy + Commerce, dat)\nmod[['Mice']] <- with(dat_mice, lm(Clergy ~ Literacy + Commerce)) \nmod[['Amelia']] <- lapply(dat_amelia, function(x) lm(Clergy ~ Literacy + Commerce, x))\n\n# Pool results\nmod[['Mice']] <- mice::pool(mod[['Mice']])\nmod[['Amelia']] <- mice::pool(mod[['Amelia']])\n\n# Summarize\nmodelsummary(mod)\n\n\n\n \n\n \n \n \n \n \n \n \n Listwise deletion\n Mice\n Amelia\n \n \n \n \n \n (Intercept)\n 76.064 \n 81.131 \n 80.544 \n \n \n \n (12.352)\n (12.219)\n (12.305)\n \n \n Literacy \n -0.541 \n -0.584 \n -0.581 \n \n \n \n (0.194) \n (0.207) \n (0.194) \n \n \n Commerce \n -0.300 \n -0.354 \n -0.351 \n \n \n \n (0.138) \n (0.128) \n (0.127) \n \n \n Num.Obs. \n 60 \n 86 \n 86 \n \n \n Num.Imp. \n \n 5 \n 5 \n \n \n R2 \n 0.128 \n 0.147 \n 0.139 \n \n \n R2 Adj. \n 0.098 \n 0.126 \n 0.118 \n \n \n AIC \n 551.5 \n \n \n \n \n BIC \n 559.9 \n \n \n \n \n Log.Lik. \n -271.764\n \n \n \n \n F \n 4.192 \n \n \n \n \n RMSE \n 22.43",
+ "text": "Multiple imputation\nmodelsummary can pool and display analyses on several datasets imputed using the mice or Amelia packages. This code illustrates how:\n\nlibrary(mice)\n\nWarning in check_dep_version(): ABI version mismatch: \nlme4 was built with Matrix ABI version 2\nCurrent Matrix ABI version is 1\nPlease re-install lme4 from source or restore original 'Matrix' package\n\nlibrary(Amelia)\n\n# Download data from `Rdatasets`\nurl <- 'https://vincentarelbundock.github.io/Rdatasets/csv/HistData/Guerry.csv'\ndat <- read.csv(url)[, c('Clergy', 'Commerce', 'Literacy')]\n\n# Insert missing values\ndat$Clergy[sample(1:nrow(dat), 10)] <- NA\ndat$Commerce[sample(1:nrow(dat), 10)] <- NA\ndat$Literacy[sample(1:nrow(dat), 10)] <- NA\n\n# Impute with `mice` and `Amelia`\ndat_mice <- mice(dat, m = 5, printFlag = FALSE)\ndat_amelia <- amelia(dat, m = 5, p2s = 0)$imputations\n\n# Estimate models\nmod <- list()\nmod[['Listwise deletion']] <- lm(Clergy ~ Literacy + Commerce, dat)\nmod[['Mice']] <- with(dat_mice, lm(Clergy ~ Literacy + Commerce)) \nmod[['Amelia']] <- lapply(dat_amelia, function(x) lm(Clergy ~ Literacy + Commerce, x))\n\n# Pool results\nmod[['Mice']] <- mice::pool(mod[['Mice']])\nmod[['Amelia']] <- mice::pool(mod[['Amelia']])\n\n# Summarize\nmodelsummary(mod)\n\n\n\n \n\n \n \n \n \n \n \n \n Listwise deletion\n Mice\n Amelia\n \n \n \n \n \n (Intercept)\n 89.767 \n 92.551 \n 91.865 \n \n \n \n (14.901)\n (13.638)\n (15.252)\n \n \n Literacy \n -0.633 \n -0.648 \n -0.670 \n \n \n \n (0.229) \n (0.215) \n (0.251) \n \n \n Commerce \n -0.465 \n -0.524 \n -0.521 \n \n \n \n (0.168) \n (0.136) \n (0.156) \n \n \n Num.Obs. \n 58 \n 86 \n 86 \n \n \n Num.Imp. \n \n 5 \n 5 \n \n \n R2 \n 0.146 \n 0.189 \n 0.178 \n \n \n R2 Adj. \n 0.115 \n 0.170 \n 0.158 \n \n \n AIC \n 536.8 \n \n \n \n \n BIC \n 545.1 \n \n \n \n \n Log.Lik. \n -264.422\n \n \n \n \n RMSE \n 23.11",
"crumbs": [
"Get started",
"Model Summaries"
@@ -873,7 +873,7 @@
"href": "vignettes/modelsummary.html#how-can-i-speed-up-modelsummary",
"title": "Model Summaries",
"section": "How can I speed up modelsummary?",
- "text": "How can I speed up modelsummary?\nThe modelsummary function, by itself, is not slow: it should only take a couple seconds to produce a table in any output format. However, sometimes it can be computationally expensive (and long) to extract estimates and to compute goodness-of-fit statistics for your model.\nThe main options to speed up modelsummary are:\n\nSet gof_map=NA to avoid computing expensive goodness-of-fit statistics.\nUse the easystats extractor functions and the metrics argument to avoid computing expensive statistics (see below for an example).\nUse parallel computation if you are summarizing multiple models. See the “Parallel computation” section in the ?modelsummary documentation.\n\nTo diagnose the slowdown and find the bottleneck, you can try to benchmark the various extractor functions:\n\nlibrary(tictoc)\n\ndata(trade)\nmod <- lm(mpg ~ hp + drat, mtcars)\n\ntic(\"tidy\")\nx <- broom::tidy(mod)\ntoc()\n\ntidy: 0.003 sec elapsed\n\ntic(\"glance\")\nx <- broom::glance(mod)\ntoc()\n\nglance: 0.004 sec elapsed\n\ntic(\"parameters\")\nx <- parameters::parameters(mod)\ntoc()\n\nparameters: 0.034 sec elapsed\n\ntic(\"performance\")\nx <- performance::performance(mod)\ntoc()\n\nperformance: 0.011 sec elapsed\n\n\nIn my experience, the main bottleneck tends to be computing goodness-of-fit statistics. The performance extractor allows users to specify a metrics argument to select a subset of GOF to include. Using this can speedup things considerably.\nWe call modelsummary with the metrics argument:\n\nmodelsummary(mod, metrics = \"rmse\")\n\n\n\n \n\n \n \n \n \n \n \n \n (1)\n \n \n \n \n \n (Intercept)\n 10.790 \n \n \n \n (5.078)\n \n \n hp \n -0.052 \n \n \n \n (0.009)\n \n \n drat \n 4.698 \n \n \n \n (1.192)\n \n \n Num.Obs. \n 32 \n \n \n R2 \n 0.741 \n \n \n R2 Adj. \n 0.723 \n \n \n AIC \n 169.5 \n \n \n BIC \n 175.4 \n \n \n Log.Lik. \n -80.752\n \n \n F \n 41.522",
+ "text": "How can I speed up modelsummary?\nThe modelsummary function, by itself, is not slow: it should only take a couple seconds to produce a table in any output format. However, sometimes it can be computationally expensive (and long) to extract estimates and to compute goodness-of-fit statistics for your model.\nThe main options to speed up modelsummary are:\n\nSet gof_map=NA to avoid computing expensive goodness-of-fit statistics.\nUse the easystats extractor functions and the metrics argument to avoid computing expensive statistics (see below for an example).\nUse parallel computation if you are summarizing multiple models. See the “Parallel computation” section in the ?modelsummary documentation.\n\nTo diagnose the slowdown and find the bottleneck, you can try to benchmark the various extractor functions:\n\nlibrary(tictoc)\n\ndata(trade)\nmod <- lm(mpg ~ hp + drat, mtcars)\n\ntic(\"tidy\")\nx <- broom::tidy(mod)\ntoc()\n\ntidy: 0.003 sec elapsed\n\ntic(\"glance\")\nx <- broom::glance(mod)\ntoc()\n\nglance: 0.003 sec elapsed\n\ntic(\"parameters\")\nx <- parameters::parameters(mod)\ntoc()\n\nparameters: 0.021 sec elapsed\n\ntic(\"performance\")\nx <- performance::performance(mod)\ntoc()\n\nperformance: 0.011 sec elapsed\n\n\nIn my experience, the main bottleneck tends to be computing goodness-of-fit statistics. The performance extractor allows users to specify a metrics argument to select a subset of GOF to include. Using this can speedup things considerably.\nWe call modelsummary with the metrics argument:\n\nmodelsummary(mod, metrics = \"rmse\")\n\n\n\n \n\n \n \n \n \n \n \n \n (1)\n \n \n \n \n \n (Intercept)\n 10.790 \n \n \n \n (5.078)\n \n \n hp \n -0.052 \n \n \n \n (0.009)\n \n \n drat \n 4.698 \n \n \n \n (1.192)\n \n \n Num.Obs. \n 32 \n \n \n R2 \n 0.741 \n \n \n R2 Adj. \n 0.723 \n \n \n AIC \n 169.5 \n \n \n BIC \n 175.4 \n \n \n Log.Lik. \n -80.752\n \n \n F \n 41.522",
"crumbs": [
"Get started",
"Model Summaries"
@@ -895,7 +895,7 @@
"href": "vignettes/modelsummary.html#bayesian-models",
"title": "Model Summaries",
"section": "Bayesian models",
- "text": "Bayesian models\nMany bayesian models are supported out-of-the-box, including those produced by the rstanarm and brms packages. The statistics available for bayesian models are slightly different than those available for most frequentist models. Users can call get_estimates to see what is available:\n\nlibrary(rstanarm)\n\nThis is rstanarm version 2.32.1\n\n\n- See https://mc-stan.org/rstanarm/articles/priors for changes to default priors!\n\n\n- Default priors may change, so it's safest to specify priors, even if equivalent to the defaults.\n\n\n- For execution on a local, multicore CPU with excess RAM we recommend calling\n\n\n options(mc.cores = parallel::detectCores())\n\n\n\nAttaching package: 'rstanarm'\n\n\nThe following object is masked from 'package:fixest':\n\n se\n\nmod <- stan_glm(am ~ hp + drat, data = mtcars)\n\n\nget_estimates(mod)\n\n term estimate mad conf.level conf.low conf.high prior.distribution prior.location prior.scale group std.error statistic p.value\n1 (Intercept) -2.2209547134 0.572283135 0.95 -3.395462445 -1.048236801 normal 0.40625 1.24747729 NA NA NA\n2 hp 0.0006854169 0.001066324 0.95 -0.001439685 0.002839335 normal 0.00000 0.01819465 NA NA NA\n3 drat 0.7026334264 0.136646210 0.95 0.423891333 0.978551063 normal 0.00000 2.33313429 NA NA NA\n\n\nThis shows that there is no std.error column, but that there is a mad statistic (mean absolute deviation). So we can do:\n\nmodelsummary(mod, statistic = \"mad\")\n\nWarning: \n`modelsummary` uses the `performance` package to extract goodness-of-fit\nstatistics from models of this class. You can specify the statistics you wish\nto compute by supplying a `metrics` argument to `modelsummary`, which will then\npush it forward to `performance`. Acceptable values are: \"all\", \"common\",\n\"none\", or a character vector of metrics names. For example: `modelsummary(mod,\nmetrics = c(\"RMSE\", \"R2\")` Note that some metrics are computationally\nexpensive. See `?performance::performance` for details.\n This warning appears once per session.\n\n\n\n\n \n\n \n \n \n \n \n \n \n (1)\n \n \n \n \n \n (Intercept)\n -2.221 \n \n \n \n (0.572)\n \n \n hp \n 0.001 \n \n \n \n (0.001)\n \n \n drat \n 0.703 \n \n \n \n (0.137)\n \n \n Num.Obs. \n 32 \n \n \n R2 \n 0.498 \n \n \n R2 Adj. \n 0.436 \n \n \n Log.Lik. \n -12.071\n \n \n ELPD \n -15.1 \n \n \n ELPD s.e. \n 3.1 \n \n \n LOOIC \n 30.2 \n \n \n LOOIC s.e. \n 6.2 \n \n \n WAIC \n 30.0 \n \n \n RMSE \n 0.34 \n \n \n \n \n\n\n\nAs noted in the modelsummary() documentation, model results are extracted using the parameters package. Users can pass additional arguments to modelsummary(), which will then push forward those arguments to the parameters::parameters function to change the results. For example, the parameters documentation for bayesian models shows that there is a centrality argument, which allows users to report the mean and standard deviation of the posterior distribution, instead of the median and MAD:\n\nget_estimates(mod, centrality = \"mean\")\n\n term estimate std.dev conf.level conf.low conf.high prior.distribution prior.location prior.scale group std.error statistic p.value\n1 (Intercept) -2.2207674936 0.602108911 0.95 -3.395462445 -1.048236801 normal 0.40625 1.24747729 NA NA NA\n2 hp 0.0007001895 0.001104204 0.95 -0.001439685 0.002839335 normal 0.00000 0.01819465 NA NA NA\n3 drat 0.7023998071 0.140670784 0.95 0.423891333 0.978551063 normal 0.00000 2.33313429 NA NA NA\n\nmodelsummary(mod, statistic = \"std.dev\", centrality = \"mean\")\n\n\n\n \n\n \n \n \n \n \n \n \n (1)\n \n \n \n \n \n (Intercept)\n -2.221 \n \n \n \n (0.602)\n \n \n hp \n 0.001 \n \n \n \n (0.001)\n \n \n drat \n 0.702 \n \n \n \n (0.141)\n \n \n Num.Obs. \n 32 \n \n \n R2 \n 0.498 \n \n \n R2 Adj. \n 0.436 \n \n \n Log.Lik. \n -12.071\n \n \n ELPD \n -15.1 \n \n \n ELPD s.e. \n 3.1 \n \n \n LOOIC \n 30.2 \n \n \n LOOIC s.e. \n 6.2 \n \n \n WAIC \n 30.0 \n \n \n RMSE \n 0.34 \n \n \n \n \n\n\n\nWe can also get additional test statistics using the test argument:\n\nget_estimates(mod, test = c(\"pd\", \"rope\"))\n\n term estimate mad conf.level conf.low conf.high pd rope.percentage prior.distribution prior.location prior.scale group std.error statistic p.value\n1 (Intercept) -2.2209547134 0.572283135 0.95 -3.395462445 -1.048236801 0.99925 0 normal 0.40625 1.24747729 NA NA NA\n2 hp 0.0006854169 0.001066324 0.95 -0.001439685 0.002839335 0.74525 1 normal 0.00000 0.01819465 NA NA NA\n3 drat 0.7026334264 0.136646210 0.95 0.423891333 0.978551063 1.00000 0 normal 0.00000 2.33313429 NA NA NA",
+ "text": "Bayesian models\nMany bayesian models are supported out-of-the-box, including those produced by the rstanarm and brms packages. The statistics available for bayesian models are slightly different than those available for most frequentist models. Users can call get_estimates to see what is available:\n\nlibrary(rstanarm)\n\nThis is rstanarm version 2.32.1\n\n\n- See https://mc-stan.org/rstanarm/articles/priors for changes to default priors!\n\n\n- Default priors may change, so it's safest to specify priors, even if equivalent to the defaults.\n\n\n- For execution on a local, multicore CPU with excess RAM we recommend calling\n\n\n options(mc.cores = parallel::detectCores())\n\n\n\nAttaching package: 'rstanarm'\n\n\nThe following object is masked from 'package:fixest':\n\n se\n\nmod <- stan_glm(am ~ hp + drat, data = mtcars)\n\n\nget_estimates(mod)\n\n term estimate mad conf.level conf.low conf.high prior.distribution prior.location prior.scale group std.error statistic p.value\n1 (Intercept) -2.2120118509 0.604120394 0.95 -3.441993573 -0.939045750 normal 0.40625 1.24747729 NA NA NA\n2 hp 0.0006728326 0.001113702 0.95 -0.001664825 0.002824257 normal 0.00000 0.01819465 NA NA NA\n3 drat 0.7000544165 0.142063291 0.95 0.402271239 0.986980334 normal 0.00000 2.33313429 NA NA NA\n\n\nThis shows that there is no std.error column, but that there is a mad statistic (mean absolute deviation). So we can do:\n\nmodelsummary(mod, statistic = \"mad\")\n\nWarning: \n`modelsummary` uses the `performance` package to extract goodness-of-fit\nstatistics from models of this class. You can specify the statistics you wish\nto compute by supplying a `metrics` argument to `modelsummary`, which will then\npush it forward to `performance`. Acceptable values are: \"all\", \"common\",\n\"none\", or a character vector of metrics names. For example: `modelsummary(mod,\nmetrics = c(\"RMSE\", \"R2\")` Note that some metrics are computationally\nexpensive. See `?performance::performance` for details.\n This warning appears once per session.\n\n\n\n\n \n\n \n \n \n \n \n \n \n (1)\n \n \n \n \n \n (Intercept)\n -2.212 \n \n \n \n (0.604)\n \n \n hp \n 0.001 \n \n \n \n (0.001)\n \n \n drat \n 0.700 \n \n \n \n (0.142)\n \n \n Num.Obs. \n 32 \n \n \n R2 \n 0.499 \n \n \n R2 Adj. \n 0.415 \n \n \n Log.Lik. \n -12.065\n \n \n ELPD \n -15.3 \n \n \n ELPD s.e. \n 3.2 \n \n \n LOOIC \n 30.7 \n \n \n LOOIC s.e. \n 6.3 \n \n \n WAIC \n 30.4 \n \n \n RMSE \n 0.34 \n \n \n \n \n\n\n\nAs noted in the modelsummary() documentation, model results are extracted using the parameters package. Users can pass additional arguments to modelsummary(), which will then push forward those arguments to the parameters::parameters function to change the results. For example, the parameters documentation for bayesian models shows that there is a centrality argument, which allows users to report the mean and standard deviation of the posterior distribution, instead of the median and MAD:\n\nget_estimates(mod, centrality = \"mean\")\n\n term estimate std.dev conf.level conf.low conf.high prior.distribution prior.location prior.scale group std.error statistic p.value\n1 (Intercept) -2.2024688812 0.632078279 0.95 -3.441993573 -0.939045750 normal 0.40625 1.24747729 NA NA NA\n2 hp 0.0006342765 0.001148073 0.95 -0.001664825 0.002824257 normal 0.00000 0.01819465 NA NA NA\n3 drat 0.6991966324 0.146927309 0.95 0.402271239 0.986980334 normal 0.00000 2.33313429 NA NA NA\n\nmodelsummary(mod, statistic = \"std.dev\", centrality = \"mean\")\n\n\n\n \n\n \n \n \n \n \n \n \n (1)\n \n \n \n \n \n (Intercept)\n -2.202 \n \n \n \n (0.632)\n \n \n hp \n 0.001 \n \n \n \n (0.001)\n \n \n drat \n 0.699 \n \n \n \n (0.147)\n \n \n Num.Obs. \n 32 \n \n \n R2 \n 0.499 \n \n \n R2 Adj. \n 0.415 \n \n \n Log.Lik. \n -12.065\n \n \n ELPD \n -15.3 \n \n \n ELPD s.e. \n 3.2 \n \n \n LOOIC \n 30.7 \n \n \n LOOIC s.e. \n 6.3 \n \n \n WAIC \n 30.4 \n \n \n RMSE \n 0.34 \n \n \n \n \n\n\n\nWe can also get additional test statistics using the test argument:\n\nget_estimates(mod, test = c(\"pd\", \"rope\"))\n\n term estimate mad conf.level conf.low conf.high pd rope.percentage prior.distribution prior.location prior.scale group std.error statistic p.value\n1 (Intercept) -2.2120118509 0.604120394 0.95 -3.441993573 -0.939045750 0.99925 0 normal 0.40625 1.24747729 NA NA NA\n2 hp 0.0006728326 0.001113702 0.95 -0.001664825 0.002824257 0.72225 1 normal 0.00000 0.01819465 NA NA NA\n3 drat 0.7000544165 0.142063291 0.95 0.402271239 0.986980334 1.00000 0 normal 0.00000 2.33313429 NA NA NA",
"crumbs": [
"Get started",
"Model Summaries"
diff --git a/vignettes/appearance.html b/vignettes/appearance.html
index ec0f2d03..85426105 100644
--- a/vignettes/appearance.html
+++ b/vignettes/appearance.html
@@ -486,12 +486,12 @@ tinytable
-
+
|
@@ -787,12 +787,12 @@ tinytable
-
+
@@ -864,13 +864,13 @@ tinytable
mpg |
20.09 |
6.03 |
- |
+ |
hp |
146.69 |
68.56 |
- |
+ |
@@ -897,12 +897,12 @@ tinytable
-
+
@@ -1193,12 +1193,12 @@ Starting fresh
-
+
@@ -1377,12 +1377,12 @@ Starting fresh
-
+
@@ -1573,23 +1573,23 @@ gt
tab_style(style = cell_fill(color = 'lightblue'),
locations = cells_body(rows = 5))
-
-
@@ -2129,23 +2129,23 @@
gt
tab %>%
text_transform(locations = cells_body(columns = 2:6, rows = 1), fn = f)
-
-
@@ -2700,23 +2700,23 @@
Themes
mod <- lm(mpg ~ hp + drat, mtcars)
modelsummary(mod, output = "gt")
-
-
@@ -3226,23 +3226,23 @@
Themes
datasummary_crosstab(island ~ sex * species, output = "gt", data = penguins)
-
-
@@ -3834,8 +3834,8 @@
Themes: Data Frame
options("modelsummary_theme_dataframe" = theme_df)
modelsummary(mod, output = "dataframe")
Restore default theme:
@@ -3859,12 +3859,12 @@
Variable labels
-
+
@@ -4016,12 +4016,12 @@ Variable labels
-
+
@@ -4125,7 +4125,7 @@ Variable labels
10.4 |
19.2 |
33.9 |
- |
+ |
Transmission |
@@ -4136,7 +4136,7 @@ Variable labels
0.0 |
0.0 |
1.0 |
- |
+ |
drat |
@@ -4147,7 +4147,7 @@ Variable labels
2.8 |
3.7 |
4.9 |
- |
+ |
diff --git a/vignettes/datasummary.html b/vignettes/datasummary.html
index 6dcb93b1..e053de8a 100644
--- a/vignettes/datasummary.html
+++ b/vignettes/datasummary.html
@@ -492,12 +492,12 @@ datasummary_skim
-
+
@@ -583,7 +583,7 @@ datasummary_skim
1.0 |
172.5 |
344.0 |
- |
+ |
bill_length_mm |
@@ -594,7 +594,7 @@ datasummary_skim
32.1 |
44.5 |
59.6 |
- |
+ |
bill_depth_mm |
@@ -605,7 +605,7 @@ datasummary_skim
13.1 |
17.3 |
21.5 |
- |
+ |
flipper_length_mm |
@@ -616,7 +616,7 @@ datasummary_skim
172.0 |
197.0 |
231.0 |
- |
+ |
body_mass_g |
@@ -627,7 +627,7 @@ datasummary_skim
2700.0 |
4050.0 |
6300.0 |
- |
+ |
year |
@@ -638,7 +638,7 @@ datasummary_skim
2007.0 |
2008.0 |
2009.0 |
- |
+ |
|
@@ -763,12 +763,12 @@ datasummary_skim
-
+
@@ -967,12 +967,12 @@ datasummary_balance
-
+
@@ -1170,12 +1170,12 @@ datasummary_correlation
-
+
@@ -1563,12 +1563,12 @@ datasummary_correlation
-
+
@@ -1902,12 +1902,12 @@ datasummary_crosstab
-
+
@@ -2078,12 +2078,12 @@ datasummary_crosstab
-
+
|
@@ -2347,12 +2347,12 @@ datasummary_crosstab
-
+
@@ -2471,12 +2471,12 @@ datasummary
-
+
@@ -2552,12 +2552,12 @@ datasummary
-
+
@@ -2635,12 +2635,12 @@ Custom summary fu
-
+
@@ -2719,12 +2719,12 @@ Custom summary fu
-
+
@@ -2799,12 +2799,12 @@ Custom summary fu