\[ ME(a) = \]
\[ \left( \frac{A + AB + AC + ABC}{4}\right) - \]
\[ \left( \frac{I + B + C + BC}{4}\right) \]
(A: Electric? Yes+ or No-)
\[ INT(ab) = \]
\[ \frac{1}{2}\left[ \left( \frac{AB + ABC}{2}\right) - \left( \frac{B + BC}{2}\right) \right] - \]
\[ \frac{1}{2}\left[ \left( \frac{A + AC}{2}\right) - \left( \frac{I + C}{2}\right) \right] \]
| meat | wine |
|---|---|
| fish | white |
| fish | red |
| steak | white |
| steak | red |
meat: Fish or Steak?wine: Red or White?| meat | wine |
|---|---|
| fish | white |
| fish | red |
| steak | white |
| steak | red |
meat: Fish or Steak?wine: Red or White?meat*wine: Red or White wine with Steak?meat*wine: Red or White wine with Fish?interactions.qmdAll levels appear an equal number of times.
All pairs of levels appear together an equal number of times.
balance-orthogonality.qmd
Consider the following experiment design
| a | b | c | Effect |
|---|---|---|---|
| + | - | - | A |
| - | + | - | B |
| + | - | + | AC |
| - | + | + | BC |
Is the design balanced? Is is orthogonal?
Write out the equation to compute the main effect for a, b, and c.
Are any main effects confounded? If so, what are they confounded with?
| Attribute | Levels |
|---|---|
| Brand | GM, BMW, Ferrari |
| Price | $20k, $40k, $100k |
Design: 9 choice sets, 3 alternatives each
#> Attribute counts:
#>
#> brand:
#>
#> GM BMW Ferrari
#> 10 11 6
#>
#> price:
#>
#> 20k 40k 100k
#> 8 10 9
#> Pairwise attribute counts:
#>
#> brand & price:
#>
#> 20k 40k 100k
#> GM 3 5 2
#> BMW 4 4 3
#> Ferrari 1 1 4
| Attribute | Levels |
|---|---|
| Brand | GM, BMW, Ferrari |
| Price | $20k, $40k, $100k |
Design: 90 choice sets, 3 alternatives each
#> Attribute counts:
#>
#> brand:
#>
#> GM BMW Ferrari
#> 93 89 88
#>
#> price:
#>
#> 20k 40k 100k
#> 93 91 86
#> Pairwise attribute counts:
#>
#> brand & price:
#>
#> 20k 40k 100k
#> GM 39 27 27
#> BMW 33 31 25
#> Ferrari 21 33 34
| Attribute | Levels | Prior |
|---|---|---|
| Brand | GM, BMW, Ferrari | 0, 1, 2 |
| Price | $20k, $40k, $100k | 0, -1, -4 |
\[v_j = 1 \delta^{\mathrm{BMW}} + 2 \delta^{\mathrm{Ferrari}} -1 \delta^{\mathrm{40k}} -4 \delta^{\mathrm{100k}}\]
| Attribute | Levels | Prior |
|---|---|---|
| Brand | GM, BMW, Ferrari | 0, 1, 2 |
| Price | $20k, $40k, $100k | 0, -1, -4 |
#> Attribute counts:
#>
#> brand:
#>
#> GM BMW Ferrari
#> 100 90 80
#>
#> price:
#>
#> 20k 40k 100k
#> 80 120 70
#> Pairwise attribute counts:
#>
#> brand & price:
#>
#> 20k 40k 100k
#> GM 40 50 10
#> BMW 30 40 20
#> Ferrari 10 30 40
where \(p\) is the number of coefficients in the model
cbc_inspect() and cbc_compare() report a design’s D-error"stochastic", "modfed", "cea") - D-error gets computed during the optimization(random designs have no D-error to report)
design-efficiency.qmd
Individually, create a Bayesian D-efficient fractional factorial survey design. Inspect the attribute balance and overlap.
Try all three D-optimal methods and compare them with cbc_compare(). Which gives the lowest D-error? Which is the most balanced?
Compare your results with your teammates.
power-analysis.qmd
Individually:
Using the survey design you created in the last practice, conduct a power analysis. Use summary() to find the sample size you need to reach 80% power (at \(\alpha = 0.05\)) on every parameter.
Re-run it with a more conservative set of priors. How much does your required sample size change?
Compare your results with your teammates.