Create reports for model comparison as obtained by the
performance::compare_performance()
function in the performance
package.
Usage
# S3 method for test_performance
report(x, ...)
# S3 method for test_performance
report_table(x, ...)
# S3 method for test_performance
report_statistics(x, table = NULL, ...)
# S3 method for test_performance
report_parameters(x, table = NULL, ...)
# S3 method for test_performance
report_text(x, table = NULL, ...)
Arguments
- x
Object of class
NEW OBJECT
.- ...
Arguments passed to or from other methods.
- table
Provide the output of
report_table()
to avoid its re-computation.
Value
An object of class report()
.
See also
Specific components of reports (especially for stats models):
Other types of reports:
Methods:
Template file for supporting new models:
Examples
# \donttest{
library(report)
library(performance)
m1 <- lm(Sepal.Length ~ Petal.Length * Species, data = iris)
m2 <- lm(Sepal.Length ~ Petal.Length + Species, data = iris)
m3 <- lm(Sepal.Length ~ Petal.Length, data = iris)
x <- performance::test_performance(m1, m2, m3)
r <- report(x)
r
#> We compared three models; lm (BF = 26.52; Omega2 = 0.03, p = 0.223; LR = 3.47,
#> p = 0.200), lm (BF = 4.20e-11; Omega2 = 0.31, p < .001; LR = 57.81, p < .001)
#> and lm (BF = 26.52; Omega2 = 0.03, p = 0.223; LR = 3.47, p = 0.200).
summary(r)
#> We compared three models; lm (), lm () and lm ().
as.data.frame(r)
#> Name | Model | BF | Omega2 | p (Omega2) | LR | p (LR)
#> -------------------------------------------------------------
#> m1 | lm | | | | |
#> m2 | lm | 26.52 | 0.03 | 0.223 | 3.47 | 0.200
#> m3 | lm | < 0.001 | 0.31 | < .001 | 57.81 | < .001
#> Models were detected as nested (in terms of fixed parameters) and are compared in sequential order.
summary(as.data.frame(r))
#> Name | Model | BF | Omega2 | p (Omega2) | LR | p (LR)
#> -------------------------------------------------------------
#> m1 | lm | | | | |
#> m2 | lm | 26.52 | 0.03 | 0.223 | 3.47 | 0.200
#> m3 | lm | < 0.001 | 0.31 | < .001 | 57.81 | < .001
#> Models were detected as nested (in terms of fixed parameters) and are compared in sequential order.
# Specific reports
report_table(x)
#> Name | Model | BF | Omega2 | p (Omega2) | LR | p (LR)
#> -------------------------------------------------------------
#> m1 | lm | | | | |
#> m2 | lm | 26.52 | 0.03 | 0.223 | 3.47 | 0.200
#> m3 | lm | < 0.001 | 0.31 | < .001 | 57.81 | < .001
#> Models were detected as nested (in terms of fixed parameters) and are compared in sequential order.
report_statistics(x)
#> BF = 26.52; Omega2 = 0.03, p = 0.223; LR = 3.47, p = 0.200
#> BF = 4.20e-11; Omega2 = 0.31, p < .001; LR = 57.81, p < .001
report_parameters(x)
#> - lm (BF = 26.52; Omega2 = 0.03, p = 0.223; LR = 3.47, p = 0.200)
#> - lm (BF = 4.20e-11; Omega2 = 0.31, p < .001; LR = 57.81, p < .001)
#> - lm (BF = 26.52; Omega2 = 0.03, p = 0.223; LR = 3.47, p = 0.200)
# }