Power Analysis - Battery Choices

Step 1: Generate Profiles

profiles <- cbc_profiles(
  veh_mileage        = seq(1.5, 5, 0.5), # unit: 10000
  veh_price          = seq(0.8, 1.2, 0.1), # unit: 20000
  battery_refurbish  = c('original', 'cellreplace','packreplace'),
  battery_range_year0 = seq(2, 3.6, 0.4), # unit: 100
  battery_degradation = seq(1,7, 2)
)

profiles
CBC Profiles
============
veh_mileage : Continuous (8 levels, range: 1.50-5.00)
veh_price   : Continuous (5 levels, range: 0.80-1.20)
battery_refurbish: Categorical (3 levels: original, cellreplace, packreplace)
battery_range_year0: Continuous (5 levels, range: 2.00-3.60)
battery_degradation: Continuous (4 levels, range: 1.00-7.00)

Profiles: 2400
First few rows:
  profileID veh_mileage veh_price battery_refurbish battery_range_year0
1         1         1.5       0.8          original                   2
2         2         2.0       0.8          original                   2
3         3         2.5       0.8          original                   2
4         4         3.0       0.8          original                   2
5         5         3.5       0.8          original                   2
6         6         4.0       0.8          original                   2
  battery_degradation
1                   1
2                   1
3                   1
4                   1
5                   1
6                   1
... and 2394 more rows

Resrictions

None

Step 2: Set up priors

Attribute Expectation Theory Suggested Sign
veh_price Lower price preferred Standard economic theory (price disutility) Negative (−)
veh_mileage Lower mileage preferred Higher mileage = older/worn vehicle Negative (−)
battery_refurbish Original battery > pack-based refurbishment > cell-based refurbishment Risk aversion, resale concerns, BEV reliability Negative (−)
battery_range_year0 More range preferred Reduces range anxiety Positive (+)
battery_degradation Less degradation preferred Reflects battery health and future value Negative (−)

Fixed Parameters

For example, if the coefficient of battery degradation is -10, then:

- A 1% increase in degradation (from 0.01 to 0.02) reduces utility by 0.10.
- A full 7% increase in degradation (from 0.01 to 0.08) would reduce utility by -0.7.

In DCE models, utilities usually range between -2 and +2, so a utility loss of -0.7 is noticeable, but not extreme. It reflects that battery degradation is an important factor in evaluating a used EV.

priors_fixed <- cbc_priors(
  profiles = profiles,
  veh_mileage          = -0.5,     # Each 10000 mile increase reduces utility by 0.05
  veh_price            = -0.1,      # Each $20000 increase reduces utility by 0.1
  battery_refurbish = c(-1.0, -0.5),   # Cell refurbishment least preferred
  battery_range_year0  = 0.5,         # Each 100 mile of range adds utility by 0.5
  battery_degradation  = -1          # Each 1% of degradation increases subtracts utility by 1

)

priors_fixed
CBC Prior Specifications:

veh_mileage:
  Continuous variable
  Levels: 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5 
  Fixed parameter
    Coefficient: -0.5

veh_price:
  Continuous variable
  Levels: 0.8, 0.9, 1, 1.1, 1.2 
  Fixed parameter
    Coefficient: -0.1

battery_refurbish:
  Categorical variable
  Levels: original, cellreplace, packreplace 
  Reference level: original
  Fixed parameter
    cellreplace: -1
    packreplace: -0.5

battery_range_year0:
  Continuous variable
  Levels: 2, 2.4, 2.8, 3.2, 3.6 
  Fixed parameter
    Coefficient: 0.5

battery_degradation:
  Continuous variable
  Levels: 1, 3, 5, 7 
  Fixed parameter
    Coefficient: -1

Random Parameters

priors_random_parameter <- cbc_priors(
  profiles = profiles,
  veh_mileage          = -0.5,     # Each 10000 mile increase reduces utility by 0.5
  veh_price = -0.1, # Assume $1,000 price increase = -0.1 utility
  battery_refurbish = rand_spec("n", c(-1.0, -0.5), c(0.1, 0.1)), # Reference = "original"
  battery_range_year0 = 0.5,   # Each 100 mile of range adds utility by 0.5
  battery_degradation = -1 # 1% increase in degradation = -1 utility
)

priors_random_parameter
CBC Prior Specifications:

veh_mileage:
  Continuous variable
  Levels: 1.5, 2, 2.5, 3, 3.5, 4, 4.5, 5 
  Fixed parameter
    Coefficient: -0.5

veh_price:
  Continuous variable
  Levels: 0.8, 0.9, 1, 1.1, 1.2 
  Fixed parameter
    Coefficient: -0.1

battery_refurbish:
  Categorical variable
  Levels: original, cellreplace, packreplace 
  Reference level: original
  Random - Normal distribution
    cellreplace:
      Mean: -1
      SD:   0.1
    packreplace:
      Mean: -0.5
      SD:   0.1

battery_range_year0:
  Continuous variable
  Levels: 2, 2.4, 2.8, 3.2, 3.6 
  Fixed parameter
    Coefficient: 0.5

battery_degradation:
  Continuous variable
  Levels: 1, 3, 5, 7 
  Fixed parameter
    Coefficient: -1

Correlation Matrix:
                             battery_refurbishcellreplace
battery_refurbishcellreplace                            1
battery_refurbishpackreplace                            0
                             battery_refurbishpackreplace
battery_refurbishcellreplace                            0
battery_refurbishpackreplace                            1

Step 3: Generate Designs

Different designs

Random Method

  • random: randomly samples profiles for each respondent independently; maximum diversity but may be less statistically efficient
design_random_fixed_parameter <- cbc_design(
  profiles = profiles,
  priors = priors_fixed,
  method = "random", # randomized full-factorial design
  n_resp   = 3000, # Number of respondents
  n_alts   = 3,    # Number of alternatives per question
  n_q      = 6,    # Number of questions per respondent #6
  remove_dominant = TRUE
) 

design_random_random_parameter <- cbc_design(
  profiles = profiles,
  priors = priors_random_parameter,
  method = "random", # randomized full-factorial design
  n_resp   = 3000, # Number of respondents
  n_alts   = 3,    # Number of alternatives per question
  n_q      = 6,    # Number of questions per respondent #6
  remove_dominant = TRUE
) 

Frequency-Based Methods

  • shortcut: balances attribute level frequencies while avoiding duplicate profiles within questions.
  • minoverlap: prioritizes minimizing attribute overlap within choice questions.
  • balanced: optimizes both frequency balance and pairwise attribute interactions.
design_shortcut <- cbc_design(
  profiles = profiles,
  method = "shortcut",
  n_resp   = 3000, # Number of respondents
  n_alts   = 3,    # Number of alternatives per question
  n_q      = 6    # Number of questions per respondent #6
  
)
Generating shortcut design for 3000 respondents using 13 cores...
design_shortcut_fixed_parameter <- cbc_design(
  profiles = profiles,
  priors = priors_fixed,
  method = "shortcut",
  n_resp   = 3000, # Number of respondents
  n_alts   = 3,    # Number of alternatives per question
  n_q      = 6   # Number of questions per respondent #6
)
Generating shortcut design for 3000 respondents using 13 cores...
## Code will not run
# design_shortcut_fixed_parameter_remove_dominant <- cbc_design(
#   profiles = profiles,
#   priors = priors_fixed,
#   method = "shortcut",
#   n_resp   = 3000, # Number of respondents
#   n_alts   = 3,    # Number of alternatives per question
#   n_q      = 6,   # Number of questions per respondent #6
#   remove_dominant = TRUE
# )

Design comparisons

cbc_compare(
  "Random_fixed_parameter" = design_random_fixed_parameter,
  "Random_random_parameter" = design_random_random_parameter,
  "Shortcut" = design_shortcut,
  "Shortcut_fixed_parameter" = design_shortcut_fixed_parameter
)
CBC Design Comparison
=====================
Designs compared: 4
Metrics: structure, efficiency, balance, overlap
Sorted by: d_error (ascending)

Structure
=====================
                   Design   Method respondents questions
   Random_fixed_parameter   random        3000         6
  Random_random_parameter   random        3000         6
                 Shortcut shortcut        3000         6
 Shortcut_fixed_parameter shortcut        3000         6
 Alternatives Blocks    Profile Usage
            3      1 (2399/2400) 100%
            3      1 (2399/2400) 100%
            3      1 (2400/2400) 100%
            3      1 (2400/2400) 100%
 No Choice Labeled?
        No       No
        No       No
        No       No
        No       No

Design Metrics
=====================
                   Design   Method D-Error (Null) D-Error (Prior) Balance
   Random_fixed_parameter   random             NA              NA   0.866
  Random_random_parameter   random             NA              NA   0.864
                 Shortcut shortcut             NA              NA   0.892
 Shortcut_fixed_parameter shortcut             NA              NA   0.892
 Overlap
   0.144
   0.144
   0.000
   0.000

Interpretation:
- D-Error: Lower is better (design efficiency)
- Balance: Higher is better (level distribution)
- Overlap: Lower is better (attribute variation)
- Profile Usage: Higher means more profiles used

Best performers:
- Balance: Shortcut (0.892)
- Overlap: Shortcut (0.000)
- Profile Usage: Random_fixed_parameter (100.0%)

Use summary() for detailed information on any one design.

Step 4: Inspect Design

Goal: Evaluate the quality and properties of the design. - D-error: Lower values indicate more efficient designs - Balance: Higher scores indicate better attribute level balance - Overlap: Lower scores indicate less attribute overlap within questions - Profile usage: Higher percentages indicate better use of available profiles

cbc_inspect(design_random_fixed_parameter)
DESIGN SUMMARY
=========================

STRUCTURE
================
Method: random
Created: 2025-07-15 13:27:06
Respondents: 3000
Questions per respondent: 6
Alternatives per question: 3
Total choice sets: 18000
Profile usage: 2399/2400 (100.0%)
Special features:
  • Dominance removal: total, partial

SUMMARY METRICS
=================
D-error calculation not available for random designs
Overall balance score: 0.866 (higher is better)
Overall overlap score: 0.144 (lower is better)

VARIABLE ENCODING
=================
Format: Dummy-coded (battery_refurbish)
💡 Use cbc_decode_design() to convert to categorical format

ATTRIBUTE BALANCE
=================
Overall balance score: 0.866 (higher is better)

Individual attribute level counts:

veh_mileage:

 1.5    2  2.5    3  3.5    4  4.5    5 
6733 6622 6641 6716 6797 6836 6861 6794 
  Balance score: 0.987 (higher is better)

veh_price:

  0.8   0.9     1   1.1   1.2 
10926 10699 10585 10975 10815 
  Balance score: 0.985 (higher is better)

battery_refurbishcellreplace:

    0     1 
35960 18040 
  Balance score: 0.681 (higher is better)

battery_refurbishpackreplace:

    0     1 
35806 18194 
  Balance score: 0.684 (higher is better)

battery_range_year0:

    2   2.4   2.8   3.2   3.6 
10806 10771 10861 10768 10794 
  Balance score: 0.997 (higher is better)

battery_degradation:

    1     3     5     7 
13661 15961 13627 10751 
  Balance score: 0.864 (higher is better)

ATTRIBUTE OVERLAP
=================
Overall overlap score: 0.144 (lower is better)

Counts of attribute overlap:
(# of questions with N unique levels)

veh_mileage: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   1.4%  (249 / 18000 questions)
  2 (partial overlap):   32.2%  (5788 / 18000 questions)
  3 (partial overlap):   66.5%  (11963 / 18000 questions)
  4 (partial overlap):    0.0%  (0 / 18000 questions)
  5 (partial overlap):    0.0%  (0 / 18000 questions)
  6 (partial overlap):    0.0%  (0 / 18000 questions)
  7 (partial overlap):    0.0%  (0 / 18000 questions)
  8 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 2.65

veh_price: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   3.7%  (669 / 18000 questions)
  2 (partial overlap):   47.5%  (8544 / 18000 questions)
  3 (partial overlap):   48.8%  (8787 / 18000 questions)
  4 (partial overlap):    0.0%  (0 / 18000 questions)
  5 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 2.45

battery_refurbishcellreplace: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):  32.7%  (5892 / 18000 questions)
  2 (no overlap):        67.3%  (12108 / 18000 questions)
  Average unique levels per question: 1.67

battery_refurbishpackreplace: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):  32.5%  (5850 / 18000 questions)
  2 (no overlap):        67.5%  (12150 / 18000 questions)
  Average unique levels per question: 1.68

battery_range_year0: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   3.7%  (674 / 18000 questions)
  2 (partial overlap):   47.8%  (8603 / 18000 questions)
  3 (partial overlap):   48.5%  (8723 / 18000 questions)
  4 (partial overlap):    0.0%  (0 / 18000 questions)
  5 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 2.45

battery_degradation: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):  12.3%  (2217 / 18000 questions)
  2 (partial overlap):   67.7%  (12188 / 18000 questions)
  3 (partial overlap):   20.0%  (3595 / 18000 questions)
  4 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 2.08
cbc_inspect(design_random_random_parameter)
DESIGN SUMMARY
=========================

STRUCTURE
================
Method: random
Created: 2025-07-15 13:27:51
Respondents: 3000
Questions per respondent: 6
Alternatives per question: 3
Total choice sets: 18000
Profile usage: 2399/2400 (100.0%)
Special features:
  • Dominance removal: total, partial

SUMMARY METRICS
=================
D-error calculation not available for random designs
Overall balance score: 0.864 (higher is better)
Overall overlap score: 0.144 (lower is better)

VARIABLE ENCODING
=================
Format: Dummy-coded (battery_refurbish)
💡 Use cbc_decode_design() to convert to categorical format

ATTRIBUTE BALANCE
=================
Overall balance score: 0.864 (higher is better)

Individual attribute level counts:

veh_mileage:

 1.5    2  2.5    3  3.5    4  4.5    5 
6571 6840 6628 6737 6815 6884 6829 6696 
  Balance score: 0.984 (higher is better)

veh_price:

  0.8   0.9     1   1.1   1.2 
10976 10660 10640 10927 10797 
  Balance score: 0.986 (higher is better)

battery_refurbishcellreplace:

    0     1 
36048 17952 
  Balance score: 0.678 (higher is better)

battery_refurbishpackreplace:

    0     1 
35826 18174 
  Balance score: 0.684 (higher is better)

battery_range_year0:

    2   2.4   2.8   3.2   3.6 
10868 10828 10833 10670 10801 
  Balance score: 0.993 (higher is better)

battery_degradation:

    1     3     5     7 
14030 16042 13251 10677 
  Balance score: 0.859 (higher is better)

ATTRIBUTE OVERLAP
=================
Overall overlap score: 0.144 (lower is better)

Counts of attribute overlap:
(# of questions with N unique levels)

veh_mileage: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   1.4%  (252 / 18000 questions)
  2 (partial overlap):   32.6%  (5870 / 18000 questions)
  3 (partial overlap):   66.0%  (11878 / 18000 questions)
  4 (partial overlap):    0.0%  (0 / 18000 questions)
  5 (partial overlap):    0.0%  (0 / 18000 questions)
  6 (partial overlap):    0.0%  (0 / 18000 questions)
  7 (partial overlap):    0.0%  (0 / 18000 questions)
  8 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 2.65

veh_price: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   3.8%  (678 / 18000 questions)
  2 (partial overlap):   47.6%  (8576 / 18000 questions)
  3 (partial overlap):   48.6%  (8746 / 18000 questions)
  4 (partial overlap):    0.0%  (0 / 18000 questions)
  5 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 2.45

battery_refurbishcellreplace: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):  32.9%  (5930 / 18000 questions)
  2 (no overlap):        67.1%  (12070 / 18000 questions)
  Average unique levels per question: 1.67

battery_refurbishpackreplace: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):  32.6%  (5864 / 18000 questions)
  2 (no overlap):        67.4%  (12136 / 18000 questions)
  Average unique levels per question: 1.67

battery_range_year0: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   3.8%  (678 / 18000 questions)
  2 (partial overlap):   47.5%  (8547 / 18000 questions)
  3 (partial overlap):   48.8%  (8775 / 18000 questions)
  4 (partial overlap):    0.0%  (0 / 18000 questions)
  5 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 2.45

battery_degradation: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):  12.2%  (2193 / 18000 questions)
  2 (partial overlap):   67.9%  (12216 / 18000 questions)
  3 (partial overlap):   20.0%  (3591 / 18000 questions)
  4 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 2.08
cbc_inspect(design_shortcut)
DESIGN SUMMARY
=========================

STRUCTURE
================
Method: shortcut
Created: 2025-07-15 13:39:36
Respondents: 3000
Questions per respondent: 6
Alternatives per question: 3
Total choice sets: 18000
Profile usage: 2400/2400 (100.0%)

SUMMARY METRICS
=================
(Lower values indicate more efficient designs)

Overall balance score: 0.892 (higher is better)
Overall overlap score: 0.000 (lower is better)

VARIABLE ENCODING
=================
Format: Dummy-coded (battery_refurbish)
💡 Use cbc_decode_design() to convert to categorical format

ATTRIBUTE BALANCE
=================
Overall balance score: 0.892 (higher is better)

Individual attribute level counts:

veh_mileage:

 1.5    2  2.5    3  3.5    4  4.5    5 
6763 6737 6740 6747 6752 6773 6763 6725 
  Balance score: 0.998 (higher is better)

veh_price:

  0.8   0.9     1   1.1   1.2 
10806 10775 10835 10806 10778 
  Balance score: 0.998 (higher is better)

battery_refurbishcellreplace:

    0     1 
36000 18000 
  Balance score: 0.680 (higher is better)

battery_refurbishpackreplace:

    0     1 
36000 18000 
  Balance score: 0.680 (higher is better)

battery_range_year0:

    2   2.4   2.8   3.2   3.6 
10810 10802 10713 10842 10833 
  Balance score: 0.995 (higher is better)

battery_degradation:

    1     3     5     7 
13498 13488 13501 13513 
  Balance score: 0.999 (higher is better)

ATTRIBUTE OVERLAP
=================
Overall overlap score: 0.000 (lower is better)

Counts of attribute overlap:
(# of questions with N unique levels)

veh_mileage: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   0.0%  (0 / 18000 questions)
  2 (partial overlap):    0.0%  (0 / 18000 questions)
  3 (partial overlap):  100.0%  (18000 / 18000 questions)
  4 (partial overlap):    0.0%  (0 / 18000 questions)
  5 (partial overlap):    0.0%  (0 / 18000 questions)
  6 (partial overlap):    0.0%  (0 / 18000 questions)
  7 (partial overlap):    0.0%  (0 / 18000 questions)
  8 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 3.00

veh_price: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   0.0%  (0 / 18000 questions)
  2 (partial overlap):    0.0%  (0 / 18000 questions)
  3 (partial overlap):  100.0%  (18000 / 18000 questions)
  4 (partial overlap):    0.0%  (0 / 18000 questions)
  5 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 3.00

battery_refurbishcellreplace: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   0.0%  (0 / 18000 questions)
  2 (no overlap):       100.0%  (18000 / 18000 questions)
  Average unique levels per question: 2.00

battery_refurbishpackreplace: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   0.0%  (0 / 18000 questions)
  2 (no overlap):       100.0%  (18000 / 18000 questions)
  Average unique levels per question: 2.00

battery_range_year0: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   0.0%  (0 / 18000 questions)
  2 (partial overlap):    0.0%  (0 / 18000 questions)
  3 (partial overlap):  100.0%  (18000 / 18000 questions)
  4 (partial overlap):    0.0%  (0 / 18000 questions)
  5 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 3.00

battery_degradation: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   0.0%  (0 / 18000 questions)
  2 (partial overlap):    0.0%  (0 / 18000 questions)
  3 (partial overlap):  100.0%  (18000 / 18000 questions)
  4 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 3.00
cbc_inspect(design_shortcut_fixed_parameter)
DESIGN SUMMARY
=========================

STRUCTURE
================
Method: shortcut
Created: 2025-07-16 08:11:25
Respondents: 3000
Questions per respondent: 6
Alternatives per question: 3
Total choice sets: 18000
Profile usage: 2400/2400 (100.0%)

SUMMARY METRICS
=================
(Lower values indicate more efficient designs)

Overall balance score: 0.892 (higher is better)
Overall overlap score: 0.000 (lower is better)

VARIABLE ENCODING
=================
Format: Dummy-coded (battery_refurbish)
💡 Use cbc_decode_design() to convert to categorical format

ATTRIBUTE BALANCE
=================
Overall balance score: 0.892 (higher is better)

Individual attribute level counts:

veh_mileage:

 1.5    2  2.5    3  3.5    4  4.5    5 
6753 6754 6744 6717 6740 6778 6748 6766 
  Balance score: 0.997 (higher is better)

veh_price:

  0.8   0.9     1   1.1   1.2 
10792 10796 10796 10823 10793 
  Balance score: 0.999 (higher is better)

battery_refurbishcellreplace:

    0     1 
36000 18000 
  Balance score: 0.680 (higher is better)

battery_refurbishpackreplace:

    0     1 
36000 18000 
  Balance score: 0.680 (higher is better)

battery_range_year0:

    2   2.4   2.8   3.2   3.6 
10781 10846 10763 10803 10807 
  Balance score: 0.997 (higher is better)

battery_degradation:

    1     3     5     7 
13471 13531 13477 13521 
  Balance score: 0.998 (higher is better)

ATTRIBUTE OVERLAP
=================
Overall overlap score: 0.000 (lower is better)

Counts of attribute overlap:
(# of questions with N unique levels)

veh_mileage: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   0.0%  (0 / 18000 questions)
  2 (partial overlap):    0.0%  (0 / 18000 questions)
  3 (partial overlap):  100.0%  (18000 / 18000 questions)
  4 (partial overlap):    0.0%  (0 / 18000 questions)
  5 (partial overlap):    0.0%  (0 / 18000 questions)
  6 (partial overlap):    0.0%  (0 / 18000 questions)
  7 (partial overlap):    0.0%  (0 / 18000 questions)
  8 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 3.00

veh_price: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   0.0%  (0 / 18000 questions)
  2 (partial overlap):    0.0%  (0 / 18000 questions)
  3 (partial overlap):  100.0%  (18000 / 18000 questions)
  4 (partial overlap):    0.0%  (0 / 18000 questions)
  5 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 3.00

battery_refurbishcellreplace: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   0.0%  (0 / 18000 questions)
  2 (no overlap):       100.0%  (18000 / 18000 questions)
  Average unique levels per question: 2.00

battery_refurbishpackreplace: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   0.0%  (0 / 18000 questions)
  2 (no overlap):       100.0%  (18000 / 18000 questions)
  Average unique levels per question: 2.00

battery_range_year0: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   0.0%  (0 / 18000 questions)
  2 (partial overlap):    0.0%  (0 / 18000 questions)
  3 (partial overlap):  100.0%  (18000 / 18000 questions)
  4 (partial overlap):    0.0%  (0 / 18000 questions)
  5 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 3.00

battery_degradation: Continuous variable
  Questions by # unique levels:
  1 (complete overlap):   0.0%  (0 / 18000 questions)
  2 (partial overlap):    0.0%  (0 / 18000 questions)
  3 (partial overlap):  100.0%  (18000 / 18000 questions)
  4 (no overlap):         0.0%  (0 / 18000 questions)
  Average unique levels per question: 3.00

Step 5: Simulate Choices

choices_random_fixed_parameter <- cbc_choices(design_random_fixed_parameter, priors = priors_fixed)
choices_random_random_parameter <- cbc_choices(design_random_random_parameter, priors = priors_random_parameter)

choices_shortcut <- cbc_choices(design_shortcut)
choices_shortcut_fixed_parameter <- cbc_choices(design_shortcut_fixed_parameter,priors = priors_fixed)

random_fixed_parameter

choices_cat <- cbc_decode(choices_random_fixed_parameter)

# Filter for the chosen rows only
choices_cat <- choices_cat[which(choices_cat$choice == 1), ]

# Counts of choices made for each attribute level
table(choices_cat$veh_mileage)

 1.5    2  2.5    3  3.5    4  4.5    5 
2525 2359 2360 2291 2236 2145 2082 2002 
table(choices_cat$veh_price)

 0.8  0.9    1  1.1  1.2 
3473 3543 3541 3724 3719 
table(choices_cat$battery_refurbish)

   original cellreplace packreplace 
       6295        5595        6110 
table(choices_cat$battery_range_year0)

   2  2.4  2.8  3.2  3.6 
3387 3594 3678 3660 3681 
table(choices_cat$battery_degradation)

   1    3    5    7 
6965 6153 3680 1202 

random_random_parameter

choices_cat <- cbc_decode(choices_random_random_parameter)

# Filter for the chosen rows only
choices_cat <- choices_cat[which(choices_cat$choice == 1), ]

# Counts of choices made for each attribute level
table(choices_cat$veh_mileage)

 1.5    2  2.5    3  3.5    4  4.5    5 
2420 2444 2402 2225 2251 2198 2068 1992 
table(choices_cat$veh_price)

 0.8  0.9    1  1.1  1.2 
3626 3579 3535 3653 3607 
table(choices_cat$battery_refurbish)

   original cellreplace packreplace 
       6334        5571        6095 
table(choices_cat$battery_range_year0)

   2  2.4  2.8  3.2  3.6 
3432 3549 3615 3637 3767 
table(choices_cat$battery_degradation)

   1    3    5    7 
7137 6166 3518 1179 

shortcut

choices_cat <- cbc_decode(choices_shortcut)

# Filter for the chosen rows only
choices_cat <- choices_cat[which(choices_cat$choice == 1), ]

# Counts of choices made for each attribute level
table(choices_cat$veh_mileage)

 1.5    2  2.5    3  3.5    4  4.5    5 
2244 2211 2226 2248 2212 2235 2305 2319 
table(choices_cat$veh_price)

 0.8  0.9    1  1.1  1.2 
3566 3677 3559 3639 3559 
table(choices_cat$battery_refurbish)

   original cellreplace packreplace 
       5986        5946        6068 
table(choices_cat$battery_range_year0)

   2  2.4  2.8  3.2  3.6 
3536 3601 3612 3652 3599 
table(choices_cat$battery_degradation)

   1    3    5    7 
4512 4522 4558 4408 

shortcut_fixed_parameter

choices_cat_fixed_parameter <- cbc_decode(choices_shortcut_fixed_parameter)

# Filter for the chosen rows only
choices_cat <- choices_cat[which(choices_cat$choice == 1), ]

# Counts of choices made for each attribute level
table(choices_cat$veh_mileage)

 1.5    2  2.5    3  3.5    4  4.5    5 
2244 2211 2226 2248 2212 2235 2305 2319 
table(choices_cat$veh_price)

 0.8  0.9    1  1.1  1.2 
3566 3677 3559 3639 3559 
table(choices_cat$battery_refurbish)

   original cellreplace packreplace 
       5986        5946        6068 
table(choices_cat$battery_range_year0)

   2  2.4  2.8  3.2  3.6 
3536 3601 3612 3652 3599 
table(choices_cat$battery_degradation)

   1    3    5    7 
4512 4522 4558 4408 

Step 6: Assess Power

  • Statistical power is the probability of correctly detecting an effect when it truly exists, which depends on effect size, sample size, design efficiency, and model complexity.
  • Power analysis focuses on prevision (standard errors)

random_fixed_parameter

power_random_fixed_parameter <- cbc_power(
  data=choices_random_fixed_parameter,
  outcome = "choice",
  obsID = "obsID",
  n_q = 6,
  n_breaks = 10
  )
Auto-detected parameters: veh_mileage, veh_price, battery_refurbishcellreplace, battery_refurbishpackreplace, battery_range_year0, battery_degradation
Using 'respID' as panelID for panel data estimation.
Estimating models using 10 cores...
Model estimation complete!
plot(power_random_fixed_parameter, type = "power", power_threshold = 0.9)

plot(power_random_fixed_parameter, type = "se")

summary(power_random_fixed_parameter, power_threshold = 0.9)
CBC Power Analysis Summary
===========================

Sample size requirements for 90% power:

veh_mileage    : n >= 300 (achieves 100.0% power, SE = 0.0361)
veh_price      : Threshold not reached (max 16.3% power at n = 3000)
battery_refurbishcellreplace: n >= 300 (achieves 100.0% power, SE = 0.0904)
battery_refurbishpackreplace: n >= 300 (achieves 100.0% power, SE = 0.0841)
battery_range_year0: n >= 300 (achieves 100.0% power, SE = 0.0633)
battery_degradation: n >= 300 (achieves 100.0% power, SE = 0.0426)

random_random_parameter

power_random_random_parameter <- cbc_power(
  data=choices_random_random_parameter,
  outcome = "choice",
  obsID = "obsID",
  n_q = 6,
  n_breaks = 10)
Auto-detected parameters: veh_mileage, veh_price, battery_refurbishcellreplace, battery_refurbishpackreplace, battery_range_year0, battery_degradation
Using 'respID' as panelID for panel data estimation.
Estimating models using 10 cores...
Model estimation complete!
plot(power_random_random_parameter, type = "power", power_threshold = 0.9)

plot(power_random_random_parameter, type = "se")

summary(power_random_random_parameter, power_threshold = 0.9)
CBC Power Analysis Summary
===========================

Sample size requirements for 90% power:

veh_mileage    : n >= 300 (achieves 100.0% power, SE = 0.0341)
veh_price      : Threshold not reached (max 46.2% power at n = 3000)
battery_refurbishcellreplace: n >= 300 (achieves 100.0% power, SE = 0.0919)
battery_refurbishpackreplace: n >= 300 (achieves 99.7% power, SE = 0.0834)
battery_range_year0: n >= 300 (achieves 100.0% power, SE = 0.0622)
battery_degradation: n >= 300 (achieves 100.0% power, SE = 0.0425)

shortcut

power_shortcut <- cbc_power(
  data=choices_shortcut,
  outcome = "choice",
  obsID = "obsID",
  n_q = 6,
  n_breaks = 10)
Auto-detected parameters: veh_mileage, veh_price, battery_refurbishcellreplace, battery_refurbishpackreplace, battery_range_year0, battery_degradation
Using 'respID' as panelID for panel data estimation.
Estimating models using 10 cores...
Model estimation complete!
plot(power_shortcut, type = "power", power_threshold = 0.9)

plot(power_shortcut, type = "se", power_threshold = 0.9)

summary(power_shortcut, power_threshold = 0.9)
CBC Power Analysis Summary
===========================

Sample size requirements for 90% power:

veh_mileage    : Threshold not reached (max 44.6% power at n = 3000)
veh_price      : Threshold not reached (max 19.5% power at n = 3000)
battery_refurbishcellreplace: Threshold not reached (max 9.9% power at n = 3000)
battery_refurbishpackreplace: Threshold not reached (max 21.9% power at n = 3000)
battery_range_year0: Threshold not reached (max 21.5% power at n = 3000)
battery_degradation: Threshold not reached (max 24.3% power at n = 3000)

shortcut_fixed_parameter

power_shortcut_fixed_parameter <- cbc_power(
  data=choices_shortcut_fixed_parameter,
  outcome = "choice",
  obsID = "obsID",
  n_q = 6,
  n_breaks = 10)
Auto-detected parameters: veh_mileage, veh_price, battery_refurbishcellreplace, battery_refurbishpackreplace, battery_range_year0, battery_degradation
Using 'respID' as panelID for panel data estimation.
Estimating models using 10 cores...
Model estimation complete!
plot(power_shortcut_fixed_parameter, type = "power", power_threshold = 0.9)

plot(power_shortcut_fixed_parameter, type = "se", power_threshold = 0.9)

summary(power_shortcut_fixed_parameter, power_threshold = 0.9)
CBC Power Analysis Summary
===========================

Sample size requirements for 90% power:

veh_mileage    : n >= 300 (achieves 100.0% power, SE = 0.0464)
veh_price      : Threshold not reached (max 15.5% power at n = 3000)
battery_refurbishcellreplace: n >= 300 (achieves 100.0% power, SE = 0.1107)
battery_refurbishpackreplace: n >= 300 (achieves 94.6% power, SE = 0.1026)
battery_range_year0: n >= 300 (achieves 100.0% power, SE = 0.0828)
battery_degradation: n >= 300 (achieves 100.0% power, SE = 0.0364)

comparison

plot_compare_power(
  random_fixed_parameter = power_random_fixed_parameter,
  random_random_parameter = power_random_random_parameter,
  shortcut = power_shortcut,
  shortcut_fixed_parameter = power_shortcut_fixed_parameter,
  type = "power"
)

plot_compare_power(
  random_fixed_parameter = power_random_fixed_parameter,
  random_random_parameter = power_random_random_parameter,
  shortcut = power_shortcut,
  shortcut_fixed_parameter = power_shortcut_fixed_parameter,
  type = "se"
)