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 
#> 613 633 607 572 567 598 612 607 591 
#> 
#> freshness:
#> 
#> Excellent   Average      Poor 
#>      1826      1802      1772 
#> 
#> type:
#> 
#>       Fuji       Gala Honeycrisp 
#>       1825       1777       1798 
#> 
#> =====================================
#> Pairwise attribute level counts
#> 
#> price x freshness:
#> 
#>         Excellent Average Poor
#>      NA      1826    1802 1772
#> 1   613       203     220  190
#> 1.5 633       219     185  229
#> 2   607       207     229  171
#> 2.5 572       200     211  161
#> 3   567       193     184  190
#> 3.5 598       193     197  208
#> 4   612       211     190  211
#> 4.5 607       189     205  213
#> 5   591       211     181  199
#> 
#> price x type:
#> 
#>         Fuji Gala Honeycrisp
#>      NA 1825 1777       1798
#> 1   613  233  191        189
#> 1.5 633  207  218        208
#> 2   607  197  192        218
#> 2.5 572  199  188        185
#> 3   567  194  199        174
#> 3.5 598  213  179        206
#> 4   612  198  200        214
#> 4.5 607  189  214        204
#> 5   591  195  196        200
#> 
#> freshness x type:
#> 
#>                Fuji Gala Honeycrisp
#>             NA 1825 1777       1798
#> Excellent 1826  627  573        626
#> Average   1802  596  614        592
#> Poor      1772  602  590        580
#> 

# Inspect the design overlap
cbc_overlap(design)
#> ==============================
#> Counts of attribute overlap:
#> (# of questions with N unique levels)
#> 
#> price:
#> 
#>    1    2    3 
#>   12  483 1305 
#> 
#> freshness:
#> 
#>    1    2    3 
#>  188 1200  412 
#> 
#> type:
#> 
#>    1    2    3 
#>  182 1194  424 
#>