summary method for class "btfit"

# S3 method for btfit
summary(object, subset = NULL, ref = NULL, SE = FALSE,
  ...)

Arguments

object

An object of class "btfit", typically the result ob of ob <- btfit(..). See btfit.

subset

A condition for selecting one or more subsets of the components. This can either be a character vector of names of the components (i.e. a subset of names(object$pi)), a single predicate function (that takes a vector of object$pi as its argument), or a logical vector of the same length as the number of components, (i.e. length(object$pi)).

ref

A reference item. Either a string with the item name, or the number 1, or NULL. If NULL, then the coefficients are constrained such that their mean is zero. If an item name is given, the coefficient estimates are shifted so that the coefficient for the ref item is zero. If there is more than one component, the components that do not include the ref item will be treated as if ref = NULL. If ref = 1, then the first item of each component is made the reference item.

SE

Logical. Whether to include the standard error of the estimate in the item_summary table. Default is FALSE. N.B. calculating the standard error can be slow when the number of items is large. See vcov.btfit.

...

other arguments

Value

An S3 object of class "summary.btfit". It is a list containing the following components:

item_summary

A tibble with columns for the item name, its coefficient, the standard error and the component it is in. Within each component, the items are arranged by estimate, in descending order. Note that the estimate is NOT the same as the values in summary$pi. See Details.

component_summary

A tibble with a row for each component in the btfit object (named according to the original btdata$components, with the number of items in the component, the number of iterations the fitting algorithm ran for, and whether it converged.

Details

Note that the values given in the estimate column of the item_summary element are NOT the same as the values in object$pi. Rather, they are the \(\lambda_i\), where \(\lambda_i = \log{\pi_i}\) (i.e. the coefficients as found by They are the coefficients, as found by coef.btfit.). By default, these are normalised so that mean(\(\lambda_i\)) = 0. However, if ref is not equal to NULL, then the \(\lambda_i\) in the component in which ref appears are shifted to \(\lambda_i - \lambda_{ref}\), for \(i = 1, \dots, K_c\), where \(K_c\) is the number of items in the component in which ref appears, and \(\lambda_{ref}\) is the estimate for the reference item.

See also

btfit, coef.btfit, vcov.btfit

Examples

citations_btdata <- btdata(BradleyTerryScalable::citations) fit1 <- btfit(citations_btdata, 1) summary(fit1)
#> $call #> btfit(btdata = citations_btdata, a = 1) #> #> $item_summary #> # A tibble: 4 x 3 #> component item estimate #> <chr> <chr> <dbl> #> 1 full_dataset JRSS-B 1.0604065 #> 2 full_dataset Biometrika 0.7897537 #> 3 full_dataset JASA 0.3095638 #> 4 full_dataset Comm Statist -2.1597241 #> #> $component_summary #> # A tibble: 1 x 4 #> component num_items iters converged #> <chr> <int> <int> <lgl> #> 1 full_dataset 4 2 TRUE #>
toy_df_4col <- codes_to_counts(BradleyTerryScalable::toy_data, c("W1", "W2", "D")) toy_btdata <- btdata(toy_df_4col) fit2a <- btfit(toy_btdata, 1) summary(fit2a)
#> $call #> btfit(btdata = toy_btdata, a = 1) #> #> $item_summary #> # A tibble: 7 x 3 #> component item estimate #> <chr> <chr> <dbl> #> 1 2 Han 0.69564153 #> 2 2 Gal 0.41253614 #> 3 2 Fin -1.10817768 #> 4 3 Cyd 0.59239992 #> 5 3 Amy 0.03250119 #> 6 3 Ben -0.24307179 #> 7 3 Dan -0.38182932 #> #> $component_summary #> # A tibble: 2 x 4 #> component num_items iters converged #> <chr> <int> <int> <lgl> #> 1 2 3 6 TRUE #> 2 3 4 10 TRUE #>
fit2b <- btfit(toy_btdata, 1.1) summary(fit2b, SE = TRUE)
#> $call #> btfit(btdata = toy_btdata, a = 1.1) #> #> $item_summary #> # A tibble: 8 x 4 #> component item estimate SE #> <chr> <chr> <dbl> <dbl> #> 1 full_dataset Eve 1.90113420 1.661724 #> 2 full_dataset Cyd 0.47237293 2.050380 #> 3 full_dataset Han 0.24535391 2.413081 #> 4 full_dataset Amy -0.07655328 1.860738 #> 5 full_dataset Gal -0.10175687 2.186308 #> 6 full_dataset Ben -0.42296697 1.784100 #> 7 full_dataset Dan -0.53638389 1.741972 #> 8 full_dataset Fin -1.48120003 2.385354 #> #> $component_summary #> # A tibble: 1 x 4 #> component num_items iters converged #> <chr> <int> <int> <lgl> #> 1 full_dataset 8 101 TRUE #>
fit2c <- btfit(toy_btdata, 1) summary(fit2c, subset = function(x) "Amy" %in% names(x))
#> $call #> btfit(btdata = toy_btdata, a = 1) #> #> $item_summary #> # A tibble: 4 x 3 #> component item estimate #> <chr> <chr> <dbl> #> 1 3 Cyd 0.59239992 #> 2 3 Amy 0.03250119 #> 3 3 Ben -0.24307179 #> 4 3 Dan -0.38182932 #> #> $component_summary #> # A tibble: 1 x 4 #> component num_items iters converged #> <chr> <int> <int> <lgl> #> 1 3 4 10 TRUE #>
summary(fit2c, subset = function(x) length(x) > 3, ref = "Amy")
#> $call #> btfit(btdata = toy_btdata, a = 1) #> #> $item_summary #> # A tibble: 4 x 3 #> component item estimate #> <chr> <chr> <dbl> #> 1 3 Cyd 0.5598987 #> 2 3 Amy 0.0000000 #> 3 3 Ben -0.2755730 #> 4 3 Dan -0.4143305 #> #> $component_summary #> # A tibble: 1 x 4 #> component num_items iters converged #> <chr> <int> <int> <lgl> #> 1 3 4 10 TRUE #>