This function prints out a summary of the amount of "overlap" across attributes within the choice questions. For example, for each attribute, the count under "1" is the number of choice questions in which the same level was shown across all alternatives for that attribute (because there was only one level shown). Likewise, the count under "2" is the number of choice questions in which only two unique levels of that attribute were shown, and so on.

cbc_overlap(design)

Arguments

design

A data frame of a survey design.

Value

Prints the counts of the number of choice questions that contain the unique number of levels for each attribute.

Examples

library(cbcTools)

# A simple conjoint experiment about apples

# Generate all possible profiles
profiles <- cbc_profiles(
  price     = c(1, 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5),
  freshness = c("Excellent", "Average", "Poor"),
  type      = c("Fuji", "Gala", "Honeycrisp")
)

# Make a randomized survey design
design <- cbc_design(
  profiles = profiles,
  n_resp   = 300, # Number of respondents
  n_alts   = 3, # Number of alternatives per question
  n_q      = 6 # Number of questions per respondent
)

# Inspect the design balance
cbc_balance(design)
#> =====================================
#> Individual attribute level counts
#> 
#> price:
#> 
#>   1 1.5   2 2.5   3 3.5   4 4.5   5 
#> 574 611 583 619 609 593 587 616 608 
#> 
#> freshness:
#> 
#> Excellent   Average      Poor 
#>      1754      1789      1857 
#> 
#> type:
#> 
#>       Fuji       Gala Honeycrisp 
#>       1814       1776       1810 
#> 
#> =====================================
#> Pairwise attribute level counts
#> 
#> price x freshness:
#> 
#>         Excellent Average Poor
#>      NA      1754    1789 1857
#> 1   574       188     177  209
#> 1.5 611       214     200  197
#> 2   583       190     195  198
#> 2.5 619       192     215  212
#> 3   609       201     203  205
#> 3.5 593       189     196  208
#> 4   587       207     195  185
#> 4.5 616       177     210  229
#> 5   608       196     198  214
#> 
#> price x type:
#> 
#>         Fuji Gala Honeycrisp
#>      NA 1814 1776       1810
#> 1   574  194  179        201
#> 1.5 611  203  197        211
#> 2   583  201  195        187
#> 2.5 619  185  235        199
#> 3   609  217  197        195
#> 3.5 593  184  210        199
#> 4   587  188  177        222
#> 4.5 616  234  186        196
#> 5   608  208  200        200
#> 
#> freshness x type:
#> 
#>                Fuji Gala Honeycrisp
#>             NA 1814 1776       1810
#> Excellent 1754  565  604        585
#> Average   1789  619  551        619
#> Poor      1857  630  621        606
#> 

# Inspect the design overlap
cbc_overlap(design)
#> ==============================
#> Counts of attribute overlap:
#> (# of questions with N unique levels)
#> 
#> price:
#> 
#>    1    2    3 
#>   14  472 1314 
#> 
#> freshness:
#> 
#>    1    2    3 
#>  182 1191  427 
#> 
#> type:
#> 
#>    1    2    3 
#>  187 1180  433 
#>