diff --git a/DESCRIPTION b/DESCRIPTION index 78144ea..609b5ac 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -47,4 +47,4 @@ Encoding: UTF-8 Language: en-US LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 6.1.99.9001 +RoxygenNote: 7.0.2 diff --git a/docs/404.html b/docs/404.html index 786b076..35c71a7 100644 --- a/docs/404.html +++ b/docs/404.html @@ -73,7 +73,7 @@ broomExtra - 0.0.6 + 0.0.6.9000 diff --git a/docs/ISSUE_TEMPLATE.html b/docs/ISSUE_TEMPLATE.html index 193a328..280f0ca 100644 --- a/docs/ISSUE_TEMPLATE.html +++ b/docs/ISSUE_TEMPLATE.html @@ -141,7 +141,7 @@

NA

Please include a minimal reproducible example (AKA a reprex). If you’ve never heard of a reprex before, start by reading https://www.tidyverse.org/help/#reprex.


Brief description of the problem

-
# insert reprex here
+
# insert reprex here
diff --git a/docs/LICENSE.html b/docs/LICENSE.html index fd9cb55..b5ae8fe 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -333,27 +333,27 @@

How to Apply These Terms to Your New Programs

If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.

To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.

-
<one line to give the program's name and a brief idea of what it does.>
-Copyright (C) 2019 Indrajeet Patil
-
-This program is free software: you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
<one line to give the program's name and a brief idea of what it does.>
+Copyright (C) 2019 Indrajeet Patil
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:

-
broomExtra Copyright (C) 2019 Indrajeet Patil
-This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
-This is free software, and you are welcome to redistribute it
-under certain conditions; type 'show c' for details.
+
broomExtra Copyright (C) 2019 Indrajeet Patil
+This program comes with ABSOLUTELY NO WARRANTY; for details type 'show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type 'show c' for details.

The hypothetical commands show w and show c should show the appropriate parts of the General Public License. Of course, your program’s commands might be different; for a GUI interface, you would use an “about box”.

You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.

diff --git a/docs/articles/available_methods.html b/docs/articles/available_methods.html index d3cf683..3714050 100644 --- a/docs/articles/available_methods.html +++ b/docs/articles/available_methods.html @@ -33,7 +33,7 @@ broomExtra - 0.0.6 + 0.0.6.9000 @@ -96,7 +96,7 @@

Available methods

Indrajeet Patil

-

2019-10-26

+

2019-12-09

Source: vignettes/available_methods.Rmd @@ -108,10 +108,10 @@

2019-10-26

Introduction

-
library(broomExtra)
-#> Registered S3 method overwritten by 'broom.mixed':
-#>   method      from 
-#>   tidy.gamlss broom
+
library(broomExtra)
+#> Registered S3 method overwritten by 'broom.mixed':
+#>   method      from 
+#>   tidy.gamlss broom

Currently, S3 methods for mixed-effects model objects are included in the broom.mixed package, while the rest of the object classes are included in the broom package. This means that you constantly need to keep track of the class of the object (e.g., “if it is merMod object, use broom.mixed::tidy()/broom.mixed::glance()/broom.mixed::augment(), but if it is polr object, use broom::tidy()/broom::glance()/broom::augment()”). Using generics from broomExtra means you no longer have to worry about this, as calling broomExtra::tidy()/broomExtra::glance()/broomExtra::augment() will search the appropriate method from these two packages and return the results.

@@ -121,812 +121,812 @@

- + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -935,7 +935,7 @@

- -
@@ -461,51 +461,51 @@

boot_tidy

Let’s see an example with linear mixed-effects regression.

-
# setup
-set.seed(123)
-library(lme4)
-library(ggplot2)
-library(broomExtra)
-
-# dataframe with estimates from each of the 25 bootstrap sample
-(df_boot <- broomExtra::boot_tidy(
-  data = sleepstudy,
-  times = 100,
-  ..f = lme4::lmer,
-  formula = Reaction ~ Days + (Days | Subject),
-  control = lme4::lmerControl(
-    check.conv.grad = .makeCC("ignore", tol = 2e-3, relTol = NULL),
-    check.conv.singular = .makeCC(action = "ignore", tol = 1e-4),
-    check.conv.hess = .makeCC(action = "ignore", tol = 1e-6)
-  ),
-  tidy.args = list(effects = "fixed")
-))
-#> # A tibble: 200 x 7
-#>    splits         id          effect term      estimate std.error statistic
-#>    <list>         <chr>       <chr>  <chr>        <dbl>     <dbl>     <dbl>
-#>  1 <split [180/6~ Bootstrap0~ fixed  (Interce~   251.        7.59     33.1 
-#>  2 <split [180/6~ Bootstrap0~ fixed  Days         10.2       1.68      6.04
-#>  3 <split [180/6~ Bootstrap0~ fixed  (Interce~   247.        8.93     27.7 
-#>  4 <split [180/6~ Bootstrap0~ fixed  Days         12.6       2.46      5.11
-#>  5 <split [180/6~ Bootstrap0~ fixed  (Interce~   254.        7.89     32.2 
-#>  6 <split [180/6~ Bootstrap0~ fixed  Days         10.3       1.72      6.00
-#>  7 <split [180/6~ Bootstrap0~ fixed  (Interce~   254.        5.78     44.0 
-#>  8 <split [180/6~ Bootstrap0~ fixed  Days          9.47      1.48      6.41
-#>  9 <split [180/6~ Bootstrap0~ fixed  (Interce~   246.        7.12     34.5 
-#> 10 <split [180/6~ Bootstrap0~ fixed  Days         11.4       1.66      6.88
-#> # ... with 190 more rows
-
-# plotting estimates from each bootstrapped sample
-dplyr::filter(df_boot, term != "(Intercept)") %>%
-  tibble::rowid_to_column(.data = .) %>%
-  ggplot(data = ., aes(rowid, estimate)) +
-  geom_point(size = 3, alpha = 0.5, color = "red") + geom_line() +
-  ggstatsplot::theme_ggstatsplot() +
-  labs(
-    title = "regression estimates from bootstrap samples",
-    x = "bootstrap sample",
-    y = "regression estimate"
-  )
+
# setup
+set.seed(123)
+library(lme4)
+library(ggplot2)
+library(broomExtra)
+
+# dataframe with estimates from each of the 25 bootstrap sample
+(df_boot <- broomExtra::boot_tidy(
+  data = sleepstudy,
+  times = 100,
+  ..f = lme4::lmer,
+  formula = Reaction ~ Days + (Days | Subject),
+  control = lme4::lmerControl(
+    check.conv.grad = .makeCC("ignore", tol = 2e-3, relTol = NULL),
+    check.conv.singular = .makeCC(action = "ignore", tol = 1e-4),
+    check.conv.hess = .makeCC(action = "ignore", tol = 1e-6)
+  ),
+  tidy.args = list(effects = "fixed")
+))
+#> # A tibble: 200 x 7
+#>    splits         id          effect term      estimate std.error statistic
+#>    <list>         <chr>       <chr>  <chr>        <dbl>     <dbl>     <dbl>
+#>  1 <split [180/6~ Bootstrap0~ fixed  (Interce~   251.        7.59     33.1 
+#>  2 <split [180/6~ Bootstrap0~ fixed  Days         10.2       1.68      6.04
+#>  3 <split [180/6~ Bootstrap0~ fixed  (Interce~   247.        8.93     27.7 
+#>  4 <split [180/6~ Bootstrap0~ fixed  Days         12.6       2.46      5.11
+#>  5 <split [180/6~ Bootstrap0~ fixed  (Interce~   254.        7.89     32.2 
+#>  6 <split [180/6~ Bootstrap0~ fixed  Days         10.3       1.72      6.00
+#>  7 <split [180/6~ Bootstrap0~ fixed  (Interce~   254.        5.78     44.0 
+#>  8 <split [180/6~ Bootstrap0~ fixed  Days          9.47      1.48      6.41
+#>  9 <split [180/6~ Bootstrap0~ fixed  (Interce~   246.        7.12     34.5 
+#> 10 <split [180/6~ Bootstrap0~ fixed  Days         11.4       1.66      6.88
+#> # ... with 190 more rows
+
+# plotting estimates from each bootstrapped sample
+dplyr::filter(df_boot, term != "(Intercept)") %>%
+  tibble::rowid_to_column(.data = .) %>%
+  ggplot(data = ., aes(rowid, estimate)) +
+  geom_point(size = 3, alpha = 0.5, color = "red") + geom_line() +
+  ggstatsplot::theme_ggstatsplot() +
+  labs(
+    title = "regression estimates from bootstrap samples",
+    x = "bootstrap sample",
+    y = "regression estimate"
+  )

@@ -513,102 +513,102 @@

boot_glance

A similar function can also be used to extract model summaries from bootstrapped samples.

- +
# setup
+set.seed(123)
+library(ggplot2)
+
+# dataframe with model summaries from each of the 500 bootstrap samples
+(df_glance <-
+  broomExtra::boot_glance(
+    data = mtcars,
+    times = 500,
+    ..f = stats::lm,
+    formula = mpg ~ wt,
+    na.action = na.omit
+  )
+)
+#> # A tibble: 500 x 14
+#>    splits id    r.squared adj.r.squared sigma statistic  p.value    df
+#>    <list> <chr>     <dbl>         <dbl> <dbl>     <dbl>    <dbl> <dbl>
+#>  1 <spli~ Boot~     0.799         0.792  2.71     119.  5.63e-12     1
+#>  2 <spli~ Boot~     0.726         0.717  2.49      79.6 6.06e-10     1
+#>  3 <spli~ Boot~     0.754         0.746  3.29      92.1 1.18e-10     1
+#>  4 <spli~ Boot~     0.731         0.722  2.74      81.7 4.59e-10     1
+#>  5 <spli~ Boot~     0.700         0.690  3.33      69.9 2.49e- 9     1
+#>  6 <spli~ Boot~     0.830         0.824  2.19     146.  4.70e-13     1
+#>  7 <spli~ Boot~     0.768         0.761  3.61      99.5 4.87e-11     1
+#>  8 <spli~ Boot~     0.550         0.535  3.01      36.6 1.20e- 6     1
+#>  9 <spli~ Boot~     0.815         0.809  2.66     132.  1.57e-12     1
+#> 10 <spli~ Boot~     0.680         0.670  3.32      63.8 6.43e- 9     1
+#> # ... with 490 more rows, and 6 more variables: logLik <dbl>, AIC <dbl>,
+#> #   BIC <dbl>, deviance <dbl>, df.residual <int>, nobs <int>
+
+# plotting log-likelihood for the model for each of the samples
+tibble::rowid_to_column(.data = df_glance) %>%
+  ggplot(data = ., aes(rowid, logLik)) +
+  geom_point(size = 3, alpha = 0.5, color = "darkgreen") + geom_line() +
+  ggstatsplot::theme_ggstatsplot() +
+  labs(
+    title = "log-likelihood of the model from bootstrap samples",
+    x = "bootstrap sample",
+    y = "log-likelihood"
+  )

boot_augment

-
# setup
-set.seed(123)
-library(ggplot2)
-
-# dataframe with augmented data from each of the 100 bootstrap samples
-(df_augment <-
-  broomExtra::boot_augment(
-    data = mtcars,
-    times = 500,
-    ..f = stats::lm,
-    formula = mpg ~ wt,
-    na.action = na.omit,
-    augment.args = list(se_fit = TRUE)
-  )
-)
-#> # A tibble: 16,000 x 12
-#>    splits id    .rownames   mpg    wt .fitted .se.fit  .resid .std.resid
-#>    <list> <chr> <chr>     <dbl> <dbl>   <dbl>   <dbl>   <dbl>      <dbl>
-#>  1 <spli~ Boot~ Maserati~  15    3.57   18.0    0.579  2.96      -1.12  
-#>  2 <spli~ Boot~ Cadillac~  10.4  5.25    7.71   1.35  -2.69       1.15  
-#>  3 <spli~ Boot~ Honda Ci~  30.4  1.62   29.9    0.902 -0.522      0.205 
-#>  4 <spli~ Boot~ Merc 450~  15.2  3.78   16.7    0.653  1.48      -0.563 
-#>  5 <spli~ Boot~ Datsun 7~  22.8  2.32   25.6    0.605  2.78      -1.05  
-#>  6 <spli~ Boot~ Merc 280   19.2  3.44   18.8    0.542 -0.449      0.170 
-#>  7 <spli~ Boot~ Fiat 128   32.4  2.2    26.3    0.649 -6.09       2.32  
-#>  8 <spli~ Boot~ Dodge Ch~  15.5  3.52   18.3    0.564  2.76      -1.04  
-#>  9 <spli~ Boot~ Merc 280C  17.8  3.44   18.8    0.542  0.951     -0.359 
-#> 10 <spli~ Boot~ Hornet S~  18.7  3.44   18.8    0.542  0.0506    -0.0191
-#> # ... with 15,990 more rows, and 3 more variables: .hat <dbl>,
-#> #   .sigma <dbl>, .cooksd <dbl>
-
-# plotting those estimates
-dplyr::group_by(.data = df_augment, id) %>%
-  dplyr::summarise(.data = ., mean.resid = mean(.resid)) %>%
-  dplyr::ungroup(x = .) %>%
-  tibble::rowid_to_column(.data = .) %>% # creating a plot
-  ggplot(data = ., aes(rowid, mean.resid)) +
-  geom_point(size = 3, alpha = 0.5, color = "blue") +
-  geom_line(color = "black") +
-  geom_hline(aes(yintercept = 0),
-    color = "red",
-    size = 1,
-    linetype = "dashed"
-  ) +
-  ggstatsplot::theme_ggstatsplot() +
-  labs(
-    title = "mean difference between fitted and observed values from bootstrap samples",
-    x = "bootstrap sample",
-    y = "residual score"
-  )
+
# setup
+set.seed(123)
+library(ggplot2)
+
+# dataframe with augmented data from each of the 100 bootstrap samples
+(df_augment <-
+  broomExtra::boot_augment(
+    data = mtcars,
+    times = 500,
+    ..f = stats::lm,
+    formula = mpg ~ wt,
+    na.action = na.omit,
+    augment.args = list(se_fit = TRUE)
+  )
+)
+#> # A tibble: 16,000 x 12
+#>    splits id    .rownames   mpg    wt .fitted .se.fit  .resid .std.resid
+#>    <list> <chr> <chr>     <dbl> <dbl>   <dbl>   <dbl>   <dbl>      <dbl>
+#>  1 <spli~ Boot~ Maserati~  15    3.57   18.0    0.579  2.96      -1.12  
+#>  2 <spli~ Boot~ Cadillac~  10.4  5.25    7.71   1.35  -2.69       1.15  
+#>  3 <spli~ Boot~ Honda Ci~  30.4  1.62   29.9    0.902 -0.522      0.205 
+#>  4 <spli~ Boot~ Merc 450~  15.2  3.78   16.7    0.653  1.48      -0.563 
+#>  5 <spli~ Boot~ Datsun 7~  22.8  2.32   25.6    0.605  2.78      -1.05  
+#>  6 <spli~ Boot~ Merc 280   19.2  3.44   18.8    0.542 -0.449      0.170 
+#>  7 <spli~ Boot~ Fiat 128   32.4  2.2    26.3    0.649 -6.09       2.32  
+#>  8 <spli~ Boot~ Dodge Ch~  15.5  3.52   18.3    0.564  2.76      -1.04  
+#>  9 <spli~ Boot~ Merc 280C  17.8  3.44   18.8    0.542  0.951     -0.359 
+#> 10 <spli~ Boot~ Hornet S~  18.7  3.44   18.8    0.542  0.0506    -0.0191
+#> # ... with 15,990 more rows, and 3 more variables: .hat <dbl>,
+#> #   .sigma <dbl>, .cooksd <dbl>
+
+# plotting those estimates
+dplyr::group_by(.data = df_augment, id) %>%
+  dplyr::summarise(.data = ., mean.resid = mean(.resid)) %>%
+  dplyr::ungroup(x = .) %>%
+  tibble::rowid_to_column(.data = .) %>% # creating a plot
+  ggplot(data = ., aes(rowid, mean.resid)) +
+  geom_point(size = 3, alpha = 0.5, color = "blue") +
+  geom_line(color = "black") +
+  geom_hline(aes(yintercept = 0),
+    color = "red",
+    size = 1,
+    linetype = "dashed"
+  ) +
+  ggstatsplot::theme_ggstatsplot() +
+  labs(
+    title = "mean difference between fitted and observed values from bootstrap samples",
+    x = "bootstrap sample",
+    y = "residual score"
+  )

@@ -626,7 +626,7 @@

-

- + @@ -268,19 +267,31 @@

Examp formula = mpg ~ wt, na.action = na.omit )
#> # A tibble: 320 x 11 -#> splits id .rownames mpg wt .fitted .resid .std.resid .hat .sigma -#> <list> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 <spli~ Boot~ Maserati~ 15 3.57 18.0 2.96 -1.12 0.0458 2.69 -#> 2 <spli~ Boot~ Cadillac~ 10.4 5.25 7.71 -2.69 1.15 0.250 2.69 -#> 3 <spli~ Boot~ Honda Ci~ 30.4 1.62 29.9 -0.522 0.205 0.111 2.75 -#> 4 <spli~ Boot~ Merc 450~ 15.2 3.78 16.7 1.48 -0.563 0.0582 2.74 -#> 5 <spli~ Boot~ Datsun 7~ 22.8 2.32 25.6 2.78 -1.05 0.0500 2.70 -#> 6 <spli~ Boot~ Merc 280 19.2 3.44 18.8 -0.449 0.170 0.0401 2.75 -#> 7 <spli~ Boot~ Fiat 128 32.4 2.2 26.3 -6.09 2.32 0.0574 2.49 -#> 8 <spli~ Boot~ Dodge Ch~ 15.5 3.52 18.3 2.76 -1.04 0.0435 2.70 -#> 9 <spli~ Boot~ Merc 280C 17.8 3.44 18.8 0.951 -0.359 0.0401 2.75 -#> 10 <spli~ Boot~ Hornet S~ 18.7 3.44 18.8 0.0506 -0.0191 0.0401 2.75 -#> # ... with 310 more rows, and 1 more variable: .cooksd <dbl>
+#> splits id .rownames mpg wt .fitted .resid +#> <list> <chr> <chr> <dbl> <dbl> <dbl> <dbl> +#> 1 <split [32/11]> Bootstrap01 Maserati Bora 15 3.57 18.0 2.96 +#> 2 <split [32/11]> Bootstrap01 Cadillac Fleetwood 10.4 5.25 7.71 -2.69 +#> 3 <split [32/11]> Bootstrap01 Honda Civic 30.4 1.62 29.9 -0.522 +#> 4 <split [32/11]> Bootstrap01 Merc 450SLC 15.2 3.78 16.7 1.48 +#> 5 <split [32/11]> Bootstrap01 Datsun 710 22.8 2.32 25.6 2.78 +#> 6 <split [32/11]> Bootstrap01 Merc 280 19.2 3.44 18.8 -0.449 +#> 7 <split [32/11]> Bootstrap01 Fiat 128 32.4 2.2 26.3 -6.09 +#> 8 <split [32/11]> Bootstrap01 Dodge Challenger 15.5 3.52 18.3 2.76 +#> 9 <split [32/11]> Bootstrap01 Merc 280C 17.8 3.44 18.8 0.951 +#> 10 <split [32/11]> Bootstrap01 Hornet Sportabout 18.7 3.44 18.8 0.0506 +#> .std.resid .hat .sigma .cooksd +#> <dbl> <dbl> <dbl> <dbl> +#> 1 -1.12 0.0458 2.69 0.0301 +#> 2 1.15 0.250 2.69 0.218 +#> 3 0.205 0.111 2.75 0.00261 +#> 4 -0.563 0.0582 2.74 0.00978 +#> 5 -1.05 0.0500 2.70 0.0293 +#> 6 0.170 0.0401 2.75 0.000600 +#> 7 2.32 0.0574 2.49 0.164 +#> 8 -1.04 0.0435 2.70 0.0248 +#> 9 -0.359 0.0401 2.75 0.00268 +#> 10 -0.0191 0.0401 2.75 0.00000761 +#> # ... with 310 more rows
# example-2: linear mixed-effects model library(lme4) @@ -290,22 +301,33 @@

Examp ..f = lme4::lmer, formula = Reaction ~ Days + (Days | Subject) )

#> Warning: Model failed to converge with max|grad| = 0.00416738 (tol = 0.002, component 1)
#> Warning: Model failed to converge with max|grad| = 0.344884 (tol = 0.002, component 1)
#> Warning: Model failed to converge with max|grad| = 0.00307876 (tol = 0.002, component 1)
#> # A tibble: 4,500 x 17 -#> splits id .rownames Reaction Days Subject .fitted .resid .hat .cooksd -#> <list> <chr> <chr> <dbl> <dbl> <fct> <dbl> <dbl> <dbl> <dbl> -#> 1 <spli~ Boot~ 145 315. 4 369 305. 9.37 0.0689 0.00686 -#> 2 <spli~ Boot~ 165 279. 4 371 293. -13.5 0.0689 0.0143 -#> 3 <spli~ Boot~ 57 454. 6 332 341. 114. 0.164 2.97 -#> 4 <spli~ Boot~ 148 348. 7 369 336. 12.2 0.157 0.0321 -#> 5 <spli~ Boot~ 163 278. 2 371 269. 8.61 0.124 0.0117 -#> 6 <spli~ Boot~ 161 270. 0 371 246. 24.0 0.223 0.208 -#> 7 <spli~ Boot~ 66 338. 5 333 324. 14.0 0.109 0.0265 -#> 8 <spli~ Boot~ 4 321. 3 308 309. 12.4 0.155 0.0331 -#> 9 <spli~ Boot~ 74 255. 3 334 262. -7.52 0.134 0.00994 -#> 10 <spli~ Boot~ 133 327. 2 352 323. 3.46 0.213 0.00404 -#> # ... with 4,490 more rows, and 7 more variables: .fixed <dbl>, .mu <dbl>, -#> # .offset <dbl>, .sqrtXwt <dbl>, .sqrtrwt <dbl>, .weights <dbl>, .wtres <dbl>
+#> splits id .rownames Reaction Days Subject .fitted .resid +#> <list> <chr> <chr> <dbl> <dbl> <fct> <dbl> <dbl> +#> 1 <split [180/69]> Bootstrap01 145 315. 4 369 305. 9.37 +#> 2 <split [180/69]> Bootstrap01 165 279. 4 371 293. -13.5 +#> 3 <split [180/69]> Bootstrap01 57 454. 6 332 341. 114. +#> 4 <split [180/69]> Bootstrap01 148 348. 7 369 336. 12.2 +#> 5 <split [180/69]> Bootstrap01 163 278. 2 371 269. 8.61 +#> 6 <split [180/69]> Bootstrap01 161 270. 0 371 246. 24.0 +#> 7 <split [180/69]> Bootstrap01 66 338. 5 333 324. 14.0 +#> 8 <split [180/69]> Bootstrap01 4 321. 3 308 309. 12.4 +#> 9 <split [180/69]> Bootstrap01 74 255. 3 334 262. -7.52 +#> 10 <split [180/69]> Bootstrap01 133 327. 2 352 323. 3.46 +#> .hat .cooksd .fixed .mu .offset .sqrtXwt .sqrtrwt .weights .wtres +#> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 0.0689 0.00686 297. 305. 0 1 1 1 9.37 +#> 2 0.0689 0.0143 297. 293. 0 1 1 1 -13.5 +#> 3 0.164 2.97 319. 341. 0 1 1 1 114. +#> 4 0.157 0.0321 330. 336. 0 1 1 1 12.2 +#> 5 0.124 0.0117 275. 269. 0 1 1 1 8.61 +#> 6 0.223 0.208 253. 246. 0 1 1 1 24.0 +#> 7 0.109 0.0265 308. 324. 0 1 1 1 14.0 +#> 8 0.155 0.0331 286. 309. 0 1 1 1 12.4 +#> 9 0.134 0.00994 286. 262. 0 1 1 1 -7.52 +#> 10 0.213 0.00404 275. 323. 0 1 1 1 3.46 +#> # ... with 4,490 more rows -

- +
classtidytidy glance augment
aaregxx x
acfxx
anovaxx
aovxx x
aovlistxx
Arimaxx x
betaregxx x x
biglmxx x
binDesignxx x
binWidthxx
bootxx
brmsfitxx x x
btergmxx
cchxx x
cldxx
clmxx x x
clmmxx x
coeftestxx
confint.glhtxx
confusionMatrixxx
coxphxx x x
cv.glmnetxx x
defaultxx x x
densityxx
distxx
drcxx x x
durbinWatsonTestxx x
emmGridxx
epi.2by2xx
ergmxx x
factanalxx x x
felmxx x x
fitdistrxx x
ftablexx
gamxx x
Gamxx x
gamlssxx x
gamm4xx x x
garchxx x
geeglmxx x
glhtxx
glmxx x x
glmmadmbxx x x
glmmTMBxx x x
glmnetxx x
glmrobxx x
glmRobxx x x
glsxx x x
gmmxx x
htestxx x x
ivregxx x x
kappaxx
kdexx
Kendallxx
kmeansxx x x
lavaanxx x
Linexx
Linesxx
listxx x
lmxx x x
lm.betaxx
lmexx x x
lmList4xx
lmodel2xx x
lmrobxx x x
lmRobxx x x
lsmobjxx
manovaxx
mapxx
Mclustxx x x
mcmcxx
mcmc.listxx
MCMCglmmxx
mediatexx
merModxx x x
mjointxx x x
mle2xx
mlmxx x
muhazxx x
multinomxx x
nested_cvxx
nlrqxx x x
nlsxx x x
NULLxx x x
orcuttxx x
pairwise.htestxx
pamxx x x
plmxx x x
poLCAxx x x
polrxx x x
Polygonxx
Polygonsxx
power.htestxx
prcompxx x
pyearsxx x
rcorrxx
ref.gridxx
regsubsetsxx
ridgelmxx x
rjagsxx
rlmxx x x
rlmerModxx
rmaxx x x
rocxx
rqxx x x
rqsxx x x
rsetxx
rsplitxx
SpatialLinesDataFramexx
SpatialPolygonsxx
SpatialPolygonsDataFramexx
specxx
speedglmxx x x
speedlmxx x x
stanfitxx
stanregxx x
summary.glhtxx
summary.lmxx
summary.lm.betaxx
summary.manovaxx
summary_emmxx
survdiffxx x
survexpxx x
survfitxx x
survregxx x x
svyglmxx x
svyolrxx x
systemfitxx
tablexx
TMBxx
tsxx
TukeyHSDxx
vfold_cvxx
zooxx
...

Arguments to function.

-

These dots support tidy-dots features.

<dynamic> Arguments for .fn.

augment.args
...

Arguments to function.

-

These dots support tidy-dots features.

<dynamic> Arguments for .fn.

@@ -278,20 +277,31 @@

Examp formula = mpg ~ wt, na.action = na.omit )

#> # A tibble: 500 x 14 -#> splits id r.squared adj.r.squared sigma statistic p.value df logLik -#> <list> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 <spli~ Boot~ 0.799 0.792 2.71 119. 5.63e-12 1 -76.2 -#> 2 <spli~ Boot~ 0.726 0.717 2.49 79.6 6.06e-10 1 -73.6 -#> 3 <spli~ Boot~ 0.754 0.746 3.29 92.1 1.18e-10 1 -82.4 -#> 4 <spli~ Boot~ 0.731 0.722 2.74 81.7 4.59e-10 1 -76.6 -#> 5 <spli~ Boot~ 0.700 0.690 3.33 69.9 2.49e- 9 1 -82.9 -#> 6 <spli~ Boot~ 0.830 0.824 2.19 146. 4.70e-13 1 -69.4 -#> 7 <spli~ Boot~ 0.768 0.761 3.61 99.5 4.87e-11 1 -85.4 -#> 8 <spli~ Boot~ 0.550 0.535 3.01 36.6 1.20e- 6 1 -79.7 -#> 9 <spli~ Boot~ 0.815 0.809 2.66 132. 1.57e-12 1 -75.7 -#> 10 <spli~ Boot~ 0.680 0.670 3.32 63.8 6.43e- 9 1 -82.8 -#> # ... with 490 more rows, and 5 more variables: AIC <dbl>, BIC <dbl>, -#> # deviance <dbl>, df.residual <int>, nobs <int>
+#> splits id r.squared adj.r.squared sigma statistic p.value +#> <list> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 <split [32/11]> Bootstrap001 0.799 0.792 2.71 119. 5.63e-12 +#> 2 <split [32/9]> Bootstrap002 0.726 0.717 2.49 79.6 6.06e-10 +#> 3 <split [32/10]> Bootstrap003 0.754 0.746 3.29 92.1 1.18e-10 +#> 4 <split [32/14]> Bootstrap004 0.731 0.722 2.74 81.7 4.59e-10 +#> 5 <split [32/11]> Bootstrap005 0.700 0.690 3.33 69.9 2.49e- 9 +#> 6 <split [32/8]> Bootstrap006 0.830 0.824 2.19 146. 4.70e-13 +#> 7 <split [32/12]> Bootstrap007 0.768 0.761 3.61 99.5 4.87e-11 +#> 8 <split [32/13]> Bootstrap008 0.550 0.535 3.01 36.6 1.20e- 6 +#> 9 <split [32/15]> Bootstrap009 0.815 0.809 2.66 132. 1.57e-12 +#> 10 <split [32/12]> Bootstrap010 0.680 0.670 3.32 63.8 6.43e- 9 +#> df logLik AIC BIC deviance df.residual nobs +#> <dbl> <dbl> <dbl> <dbl> <dbl> <int> <int> +#> 1 1 -76.2 158. 163. 220. 30 32 +#> 2 1 -73.6 153. 158. 186. 30 32 +#> 3 1 -82.4 171. 175. 324. 30 32 +#> 4 1 -76.6 159. 164. 225. 30 32 +#> 5 1 -82.9 172. 176. 333. 30 32 +#> 6 1 -69.4 145. 149. 144. 30 32 +#> 7 1 -85.4 177. 181. 390. 30 32 +#> 8 1 -79.7 165. 170. 273. 30 32 +#> 9 1 -75.7 157. 162. 212. 30 32 +#> 10 1 -82.8 172. 176. 331. 30 32 +#> # ... with 490 more rows
# example-2: linear mixed-effects model library(lme4) @@ -315,7 +325,7 @@

Examp #> 10 <split [180/68]> Bootstrap10 23.7 -859. 1730. 1749. 1718. 174 #> # ... with 15 more rows

-
#> # A tibble: 1,000 x 9 -#> splits id term estimate std.error statistic p.value conf.low conf.high -#> <list> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 <split~ Boots~ (Int~ 39.7 1.73 22.9 1.44e-20 38.5 40.9 -#> 2 <split~ Boots~ wt -6.10 0.558 -10.9 5.63e-12 -6.48 -5.72 -#> 3 <split~ Boots~ (Int~ 35.0 1.79 19.5 1.29e-18 33.8 36.2 -#> 4 <split~ Boots~ wt -4.76 0.533 -8.92 6.06e-10 -5.12 -4.39 -#> 5 <split~ Boots~ (Int~ 37.2 1.93 19.2 2.04e-18 35.9 38.5 -#> 6 <split~ Boots~ wt -5.11 0.532 -9.60 1.18e-10 -5.47 -4.74 -#> 7 <split~ Boots~ (Int~ 36.2 1.98 18.3 7.90e-18 34.8 37.5 -#> 8 <split~ Boots~ wt -5.24 0.580 -9.04 4.59e-10 -5.64 -4.85 -#> 9 <split~ Boots~ (Int~ 36.5 2.18 16.8 8.60e-17 35.0 38.0 -#> 10 <split~ Boots~ wt -5.12 0.613 -8.36 2.49e- 9 -5.54 -4.71 +#> splits id term estimate std.error statistic +#> <list> <chr> <chr> <dbl> <dbl> <dbl> +#> 1 <split [32/11]> Bootstrap001 (Intercept) 39.7 1.73 22.9 +#> 2 <split [32/11]> Bootstrap001 wt -6.10 0.558 -10.9 +#> 3 <split [32/9]> Bootstrap002 (Intercept) 35.0 1.79 19.5 +#> 4 <split [32/9]> Bootstrap002 wt -4.76 0.533 -8.92 +#> 5 <split [32/10]> Bootstrap003 (Intercept) 37.2 1.93 19.2 +#> 6 <split [32/10]> Bootstrap003 wt -5.11 0.532 -9.60 +#> 7 <split [32/14]> Bootstrap004 (Intercept) 36.2 1.98 18.3 +#> 8 <split [32/14]> Bootstrap004 wt -5.24 0.580 -9.04 +#> 9 <split [32/11]> Bootstrap005 (Intercept) 36.5 2.18 16.8 +#> 10 <split [32/11]> Bootstrap005 wt -5.12 0.613 -8.36 +#> p.value conf.low conf.high +#> <dbl> <dbl> <dbl> +#> 1 1.44e-20 38.5 40.9 +#> 2 5.63e-12 -6.48 -5.72 +#> 3 1.29e-18 33.8 36.2 +#> 4 6.06e-10 -5.12 -4.39 +#> 5 2.04e-18 35.9 38.5 +#> 6 1.18e-10 -5.47 -4.74 +#> 7 7.90e-18 34.8 37.5 +#> 8 4.59e-10 -5.64 -4.85 +#> 9 8.60e-17 35.0 38.0 +#> 10 2.49e- 9 -5.54 -4.71 #> # ... with 990 more rows
# example-2: linear mixed-effects model library(lme4) @@ -382,7 +393,7 @@

Examp #> 10 <split [180/68]> Bootstrap05 fixed Days 9.78 1.66 5.88 #> # ... with 40 more rows

- +#> deviance df.residual nobs +#> <dbl> <int> <int> +#> 1 405252. 178 180 -
+#> .cooksd +#> <dbl> +#> 1 0.00154 +#> 2 0.00536 +#> 3 0.00150 +#> 4 0.0442 +#> 5 0.00624 +#> 6 0.0140 +#> 7 0.00113 +#> 8 0.000254 +#> 9 0.00457 +#> 10 0.105 +#> # ... with 26,960 more rows
# linear mixed effects model broomExtra::grouped_augment( data = dplyr::sample_frac(tbl = ggplot2::diamonds, size = 0.5), @@ -274,22 +285,33 @@

Examp formula = price ~ carat + (carat | color) - 1, control = lme4::lmerControl(optimizer = "bobyqa") )

#> # A tibble: 26,970 x 15 -#> cut price carat color .fitted .resid .hat .cooksd .fixed .mu .offset -#> <ord> <int> <dbl> <ord> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 Fair 2848 0.75 D 3144. -296. 0.0117 3.13e-4 2850. 3.14e3 0 -#> 2 Fair 5268 1.5 J 5765. -497. 0.0145 1.10e-3 5699. 5.76e3 0 -#> 3 Fair 4205 1.01 D 4994. -789. 0.0108 2.06e-3 3838. 4.99e3 0 -#> 4 Fair 1633 0.68 G 2226. -593. 0.00915 9.78e-4 2584. 2.23e3 0 -#> 5 Fair 3975 1 F 4426. -451. 0.00640 3.94e-4 3800. 4.43e3 0 -#> 6 Fair 3876 1.03 E 4665. -789. 0.0110 2.10e-3 3914. 4.67e3 0 -#> 7 Fair 4072 1.01 G 4229. -157. 0.00576 4.30e-5 3838. 4.23e3 0 -#> 8 Fair 527 0.37 F 83.3 444. 0.0172 1.05e-3 1406. 8.33e1 0 -#> 9 Fair 15030 2.48 I 12504. 2526. 0.104 2.47e-1 9423. 1.25e4 0 -#> 10 Fair 4791 1.01 F 4495. 296. 0.00646 1.71e-4 3838. 4.50e3 0 -#> # ... with 26,960 more rows, and 4 more variables: .sqrtXwt <dbl>, -#> # .sqrtrwt <dbl>, .weights <dbl>, .wtres <dbl>
+#> cut price carat color .fitted .resid .hat .cooksd .fixed .mu +#> <ord> <int> <dbl> <ord> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 Fair 2848 0.75 D 3144. -296. 0.0117 0.000313 2850. 3144. +#> 2 Fair 5268 1.5 J 5765. -497. 0.0145 0.00110 5699. 5765. +#> 3 Fair 4205 1.01 D 4994. -789. 0.0108 0.00206 3838. 4994. +#> 4 Fair 1633 0.68 G 2226. -593. 0.00915 0.000978 2584. 2226. +#> 5 Fair 3975 1 F 4426. -451. 0.00640 0.000394 3800. 4426. +#> 6 Fair 3876 1.03 E 4665. -789. 0.0110 0.00210 3914. 4665. +#> 7 Fair 4072 1.01 G 4229. -157. 0.00576 0.0000430 3838. 4229. +#> 8 Fair 527 0.37 F 83.3 444. 0.0172 0.00105 1406. 83.3 +#> 9 Fair 15030 2.48 I 12504. 2526. 0.104 0.247 9423. 12504. +#> 10 Fair 4791 1.01 F 4495. 296. 0.00646 0.000171 3838. 4495. +#> .offset .sqrtXwt .sqrtrwt .weights .wtres +#> <dbl> <dbl> <dbl> <dbl> <dbl> +#> 1 0 1 1 1 -296. +#> 2 0 1 1 1 -497. +#> 3 0 1 1 1 -789. +#> 4 0 1 1 1 -593. +#> 5 0 1 1 1 -451. +#> 6 0 1 1 1 -789. +#> 7 0 1 1 1 -157. +#> 8 0 1 1 1 444. +#> 9 0 1 1 1 2526. +#> 10 0 1 1 1 296. +#> # ... with 26,960 more rows -
+#> AIC BIC deviance df.residual nobs +#> <dbl> <dbl> <dbl> <int> <int> +#> 1 1524. 1529. 289568733. 84 85 +#> 2 1749. 1754. 187724139. 100 101 +#> 3 2816. 2822. 613473518. 155 156 +#> 4 2893. 2899. 722351124. 158 159 +#> 5 2618. 2624. 820050299. 141 142 +#> 6 1400. 1405. 177605917. 79 80 +#> 7 1005. 1009. 258660541. 54 55 +#> 8 5966. 5974. 1001144317. 335 336 +#> 9 8173. 8181. 1291712250. 461 462 +#> 10 7998. 8006. 1267954026. 451 452 +#> # ... with 25 more rows
# linear mixed effects model broomExtra::grouped_glance( data = dplyr::sample_frac(tbl = ggplot2::diamonds, size = 0.5), @@ -300,7 +310,7 @@

Examp #> 4 Premium 1557. -60736. 121482. 121516. 121472. 6917 #> 5 Ideal 1257. -92766. 185542. 185579. 185532. 10833

-
#> # A tibble: 25 x 9 -#> cut effect group term estimate std.error statistic conf.low conf.high -#> <ord> <chr> <chr> <chr> <dbl> <dbl> <dbl> <dbl> <dbl> -#> 1 Fair fixed NA carat 3800. 228. 16.7 3212. 4387. -#> 2 Fair ran_pa~ color sd__(In~ 2158. NA NA NA NA -#> 3 Fair ran_pa~ color cor__(I~ -0.975 NA NA NA NA -#> 4 Fair ran_pa~ color sd__car~ 2545. NA NA NA NA -#> 5 Fair ran_pa~ Resid~ sd__Obs~ 1830. NA NA NA NA -#> 6 Good fixed NA carat 9217. 105. 87.6 8946. 9488. -#> 7 Good ran_pa~ color sd__(In~ 2686. NA NA NA NA -#> 8 Good ran_pa~ color cor__(I~ 0.998 NA NA NA NA -#> 9 Good ran_pa~ color sd__car~ 1609. NA NA NA NA -#> 10 Good ran_pa~ Resid~ sd__Obs~ 1373. NA NA NA NA +#> cut effect group term estimate std.error statistic +#> <ord> <chr> <chr> <chr> <dbl> <dbl> <dbl> +#> 1 Fair fixed NA carat 3800. 228. 16.7 +#> 2 Fair ran_pars color sd__(Intercept) 2158. NA NA +#> 3 Fair ran_pars color cor__(Intercept).carat -0.975 NA NA +#> 4 Fair ran_pars color sd__carat 2545. NA NA +#> 5 Fair ran_pars Residual sd__Observation 1830. NA NA +#> 6 Good fixed NA carat 9217. 105. 87.6 +#> 7 Good ran_pars color sd__(Intercept) 2686. NA NA +#> 8 Good ran_pars color cor__(Intercept).carat 0.998 NA NA +#> 9 Good ran_pars color sd__carat 1609. NA NA +#> 10 Good ran_pars Residual sd__Observation 1373. NA NA +#> conf.low conf.high +#> <dbl> <dbl> +#> 1 3212. 4387. +#> 2 NA NA +#> 3 NA NA +#> 4 NA NA +#> 5 NA NA +#> 6 8946. 9488. +#> 7 NA NA +#> 8 NA NA +#> 9 NA NA +#> 10 NA NA #> # ... with 15 more rows
- -
#> NULL
-