Skip to contents

[Experimental]

summary() summarises the sampled data and provides the minimum, first quartile, median, mean, third quartile, and maximum values for each category.

Usage

# S3 method for class 'cat_sample'
summary(object, option, ...)

Arguments

object

an object of class cat_sample created by the function cat_sample_data.

option

character string with the name of the option.

...

Unused arguments, included only for future extensions of the function.

Value

A tibble with the summary statistics.

See also

Other cat data helpers: cat_add_data(), cat_get_data(), cat_sample_data(), cat_start()

Author

Sergio Vignali

Examples

# Create the elic_cat object for an elicitation process with three topics,
# four options, five categories and a maximum of six experts per topic
my_categories <- c("category_1", "category_2", "category_3",
                   "category_4", "category_5")
my_options <- c("option_1", "option_2", "option_3", "option_4")
my_topics <- c("topic_1", "topic_2", "topic_3")
my_elicit <- cat_start(categories = my_categories,
                       options = my_options,
                       experts = 6,
                       topics = my_topics) |>
  cat_add_data(data_source = topic_1, topic = "topic_1") |>
  cat_add_data(data_source = topic_2, topic = "topic_2") |>
  cat_add_data(data_source = topic_3, topic = "topic_3")
#>  <elic_cat> object for "Elicitation" correctly initialised
#>  Data added to Topic "topic_1" from "data.frame"
#>  Data added to Topic "topic_2" from "data.frame"
#>  Data added to Topic "topic_3" from "data.frame"

# Sample data from Topic 1 for all options using the basic method
samp <- cat_sample_data(my_elicit,
                        method = "basic",
                        topic = "topic_1")
#>  Data sampled successfully using "basic" method.

# Summarise the sampled data
summary(samp, option = "option_1")
#> # A tibble: 5 × 7
#>   Category         Min       Q1   Median   Mean      Q3   Max
#>   <chr>          <dbl>    <dbl>    <dbl>  <dbl>   <dbl> <dbl>
#> 1 category_1 1.88e- 32 6.21e- 6 2.37e- 3 0.124  0.119   1.00 
#> 2 category_2 0         1.37e-77 1.35e-19 0.0710 0.00175 0.974
#> 3 category_3 9.81e- 27 3.14e- 3 1.79e- 1 0.366  0.765   1    
#> 4 category_4 3.91e-282 5.91e-25 5.58e- 4 0.139  0.113   1.00 
#> 5 category_5 5.07e- 62 1.31e- 4 9.37e- 2 0.300  0.619   1.00